[Cubicweb] [pyramid] Persistent session - RQL or SQL ?

Christophe de Vienne christophe at unlish.com
Fri Aug 22 20:55:54 CEST 2014


Hi everyone,

We need to make decisions about the default session factory.

Currently, pyramid_cubicweb setup a SignedCookieSessionFactory, which 
stores its datas inside a cookie. Imo it is not an acceptable default 
for cubicweb, so we need to use another one.

The new session handler should provide session persistence out of the 
box for cubicweb applications, with no need to install extra services 
(ruling out redis for example), no extra sysadmin work, and works 
properly in a multi-instance environment (ruling out local filesystem 
storage).

The answer is pretty simple : we need to store the session data in the 
database.

The real question is, do we store the data in a ER model or directly 
with SQL ?

The easy way is to use an ER model and RQL. Problem is: having this in 
the data model kind of makes it an official API, and exposes too much of 
the implementation details. The risk is to have people think they can 
rely on those data being in the ER model, which may be false if an 
alternate session factory is used.

Using SQL directly would solve this issue, but implies a little more 
work. It would also probably be a little faster.

Before going myself into a first implementation I would like to hear 
opinions, and we can make a decision.

So, what do you prefer : RQL or SQL ?

Best regards,

Christophe



More information about the Cubicweb mailing list