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

From Tim Cross
Subject Re: Using unlogged tables for web sessions
Date
Msg-id 877dyf10go.fsf@gmail.com
Whole thread Raw
In response to Using unlogged tables for web sessions  (Stephen Carboni <stephen.entropy@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: File Foreign Table Doesn't Exist when in Exception
Next
From: Ted Toth
Date:
Subject: performance of first exec of prepared statement