On 16/04/2020 19:39, Stephen Carboni wrote:
> Hello.
>
> I was wondering if anyone was using unlogged tables for website
> sessions in production. I'm interested if it breaks the prevailing
> opinion that you don't put sessions in PG.
I generally put sessions in postgresql, with regular tables, when I'm
using persistent server-side sessions, rather than just stashing all the
user data in a signed cookie or local storage.
It ... works fine? It drastically simplifies app deployment to have a
single point of persistent storage, and having one that you can easily
interrogate by hand simplifies development and debugging. Reads are a
single indexed query, writes are typically HOT, so the IO and overhead
aren't drastically different from any other persistent store.
A lot of webapp development advice is based on "Ah, but how will you
scale it up to Facebook levels of traffic?" and then skipping over the
answer "Um, I won't ever need to. And if I did I'd have enough revenue
to hire someone very, very good to rearchitect my session storage.".
Cheers,
Steve