Reputation: 5291
Is it possible to store Grails session in Database? After starting a load balancer my app randomly asks users to login (almost on every other webpage redirection). I know I can enable sticky sessions but I have seen it with rails that sessions can be saved in db so there would be no problems in multi server environments.
Upvotes: 2
Views: 1341
Reputation: 75671
Typically the database is the hardest part of an app to scale. It's pretty easy to horizontally scale by adding more web servers, but you usually vertically scale the database. So it doesn't make much sense to add more work to your database by storing sessions there in addition to your real application data.
See this blog post for a simple way to cluster Grails in multiple Tomcat servers and enable session replication: http://www.tomcatexpert.com/blog/2010/07/20/basic-tomcat-clustering-grails-applications
Upvotes: 3
Reputation: 51925
Terracotta might allow you do that (I haven't used it so I don't know it's mechanism for sharing between servers). There is a Terracotta plugin for Grails, which is suggested here.
Upvotes: 0