pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Atkins <steve@blighty.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Using unlogged tables for web sessions
Date: Fri, 17 Apr 2020 09:13:08 +0100
Message-ID: <856f24eb-91e5-94ef-4a32-cb57302275db@blighty.com> (raw)
In-Reply-To: <CAN-rLW8X=5g++nqfo34NLWk6+NgtP=_9RUnO0D5Nnb=Zfv3rMg@mail.gmail.com>
References: <CAN-rLW8X=5g++nqfo34NLWk6+NgtP=_9RUnO0D5Nnb=Zfv3rMg@mail.gmail.com>


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







view thread (4+ messages)  latest in thread

Message-ID: <856f24eb-91e5-94ef-4a32-cb57302275db@blighty.com>
Permalink:  ../856f24eb-91e5-94ef-4a32-cb57302275db@blighty.com/
Also on:    postgresql.org/message-id/856f24eb-91e5-94ef-4a32-cb57302275db@blighty.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: steve@blighty.com
  Subject: Re: Using unlogged tables for web sessions
  In-Reply-To: <856f24eb-91e5-94ef-4a32-cb57302275db@blighty.com>
  References: <CAN-rLW8X=5g++nqfo34NLWk6+NgtP=_9RUnO0D5Nnb=Zfv3rMg@mail.gmail.com> <856f24eb-91e5-94ef-4a32-cb57302275db@blighty.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox