pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Using unlogged tables for web sessions
Date: Fri, 17 Apr 2020 09:21:11 +1000
Message-ID: <877dyf10go.fsf@gmail.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>


Stephen Carboni <stephen.entropy@gmail.com> writes:

> 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.

This really depends on what you define as website session data and what
benefit you would see compared to the additional overhead of maintaining
this session information remotely (from the client). Depending on your
application, there is often some session information which makes more
sense stored on the back end server rather than in the client - notably,
data used by your server API to modify responses or possibly encrypted
data to handle 'remember me' type functionality. However, you probably
don't want to store session data used by the client API e.g. browser
Javascript as this would introduce additional network overheads,
latency, load on web and db server, increased web and db server API
complexity and possibly additional data privacy/security concerns you
will need to manage. This can be hard to justify when you have good
client data storage facilities available.

I have not come across a use case where it made sense to store ALL
session data remotely in the database. I have seen situations with a
very specialised application where having a more full featured LOCAL (to
the client) database server to record session information can be useful,
but this is rare.


--
Tim Cross





view thread (4+ messages)  latest in thread

Message-ID: <877dyf10go.fsf@gmail.com>
Permalink:  ../877dyf10go.fsf@gmail.com/
Also on:    postgresql.org/message-id/877dyf10go.fsf@gmail.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: theophilusx@gmail.com
  Subject: Re: Using unlogged tables for web sessions
  In-Reply-To: <877dyf10go.fsf@gmail.com>
  References: <CAN-rLW8X=5g++nqfo34NLWk6+NgtP=_9RUnO0D5Nnb=Zfv3rMg@mail.gmail.com> <877dyf10go.fsf@gmail.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