wiki:rfc/jforms-storage
developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Version 1 (modified by laurentj, 9 years ago) (diff)

--

Efficient storage for instances of forms

Why

Instances of forms are stored in session. With the time, a user can have dozen instances, so the session contains too many data. In term of performance, this is not a good way, since, most of time in a controller, we only work on a single form.

Furthermore, we can have issue when retrieving a form, for example when a session was timeout (we loose all instances...).

Propositions

During the creation of an instance, generate a unique ID (how?). And the instance is stored in a database (NoSQL -> jKvDb ?), with the ID as the key. So session will not contain anymore forms data and will be "light".

This ID will be included in an hidden field in the html form. When we will call jForms::get() or jForms::fill(), it will use the value of the hidden field to retrieve the instance.

To study: What about security? performance? the debugbar?