[ckan-dev] Session storage and stateless instances

Adrià Mercader adria.mercader at okfn.org
Wed May 21 14:50:43 UTC 2014


Hi,

I'm with Alice on this one. We can definitely add some notes about the
beaker session to the configuration file docs [1] describing the file
an db-based options

Regarding what the session is used for, I might be missing something
else but I think the session is currently only used to store lang
settings and the flash messages that appear on the frontend (the code
for that should be in ckan/lib/base.py). Other projects like DGU use
it for "shopping basket"-like features.

Adrià



[1] http://docs.ckan.org/en/latest/maintaining/configuration.html

On 20 May 2014 11:37, Alice Heaton <a.heaton at nhm.ac.uk> wrote:
> On 16/05/14 19:05, Nick Stenning wrote:
>>
>> Hi all,
>>
>> I have two questions: one specific, and one general.
>>
>> 1. If I found time to make the appropriate adjustments to CKAN to make
>> the database the default session store, would anyone be averse to that?
>> Storing sessions on disk causes all kinds of problems, the most
>> important of which for me is that it makes it difficult to load balance
>> multiple identically-configured CKAN instances. One either has to define
>> server affinity based on session cookies, or put the filesystem session
>> storage onto a network filesystem, which is a terrible idea on many
>> levels (atomicity, network partitions, etc.)
>
>
> Probably good documentation on setting up load balancing would be more
> useful than setting defaults?
>
> It's easy enough to setup:
>
> beaker.session.type = ext:database
> beaker.session.url = postgresql://.....
>
> Also - what would the default values be? Would it use the main ckan
> database, or a separate one? I think it would make more sense to use a
> separate database (don't want session tables in my backups, or in my
> read-only slaves), but that means extra configuration steps for first time
> users.
>
>
>> 2. More generally, is anyone aware of any other aspects of CKAN which
>> stand in the way of application instances being fully stateless?
>>
>> -N
>>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev



More information about the ckan-dev mailing list