ActiveRecord SessionStore Session Performance

How big is the performance switch from cookieStore to SessionStore ActiveRecord?

By default, Ruby on Rails uses a CookieStore. But this has the disadvantage that the client must have its own cookies.

Switching to Active SessionStore seems to solve this problem. I am considering switching.

I read that performance is worse using SessionStore ActiveRecord. But what's worse? Will the user notice this, or is it a matter of milliseconds? Has anyone seen control results comparing 2 options?

Any other reasons (not) for switching to SessionStore ActiveRecord?

+5
source share
2 answers

The worst part is that he needs to query the database, which then has to calculate the response, and not go directly to the cookie on the client side.

But is it really that bad? You are correct that the difference in performance is very small in most cases.

Pros:

Affinity- If your web application has ever expanded to more than one server, moving your sessions to the database may allow you to run your servers without any affinity for the server .

Security - Since you only save the session identifier on the client side, this reduces the user's chances of manipulating any data through the client side.

against

. / cookie .

+4

AR cookie - .

, Rails cookie.

+4

All Articles