• 2 Posts
  • 50 Comments
Joined 1 year ago
cake
Cake day: June 5th, 2023

help-circle















  • I’m not one of these 2 arguing. But in general the app servers don’t do caching or state handling.

    You cache things in a third external cache such as redis or memcached. So if a user connects to app server 1 and then to app server 2 they will both grab cachee info from redis. No extra db calls required. This has been the basic way of doing things even with old school WordPress sites forever. You also store session cookies in there or in the db.

    And even if you weren’t caching externally like this, databases use up a lot of memory to cache tons of data. So even if the same query hits the db the second hit would probably still be hot in memory and return super fast. It’s not double the load. At least with postgres this is the case and it’s what Lemmy uses.