Re: Using unlogged tables for web sessions - Mailing list pgsql-general

From Steve Atkins
Subject Re: Using unlogged tables for web sessions
Date
Msg-id 856f24eb-91e5-94ef-4a32-cb57302275db@blighty.com
Whole thread Raw
In response to Using unlogged tables for web sessions  (Stephen Carboni <stephen.entropy@gmail.com>)
List pgsql-general
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





pgsql-general by date:

Previous
From: Paul Förster
Date:
Subject: Re: Could not resolve host name error in psycopg2
Next
From: Kiwoong Choi
Date:
Subject: Is there a script and sample data to test the performance ofpostgresql?