Maintaining the session state at the database is not completely desirable, especially if we want to scale out, as it becomes a major source of contention.
sandeep6189
NOTE: Here Database can be a single point of failure. This is a very practical problem in industries as scaling Databases are not very easy.
Metalbird
While this is one approach that can work, this method relies on having to scale out the database to handle more clients as all of their states need to be stored there. As was mentioned above this can be a challenging problem.
vasua
An interesting problem with databases is how you ensure consistency across nodes, especially on a global scale. I heard about a DB from Google that was recently announced which apparently ensures global consistency in real time.
https://cloud.google.com/spanner/
jk2d
Even though the load balancer has cheap logic, it could also be a point of contention in practice. However, DB is a much more significant source of contention.
Maintaining the session state at the database is not completely desirable, especially if we want to scale out, as it becomes a major source of contention.
NOTE: Here Database can be a single point of failure. This is a very practical problem in industries as scaling Databases are not very easy.
While this is one approach that can work, this method relies on having to scale out the database to handle more clients as all of their states need to be stored there. As was mentioned above this can be a challenging problem.
An interesting problem with databases is how you ensure consistency across nodes, especially on a global scale. I heard about a DB from Google that was recently announced which apparently ensures global consistency in real time.
https://cloud.google.com/spanner/
Even though the load balancer has cheap logic, it could also be a point of contention in practice. However, DB is a much more significant source of contention.