I wanted to know is it a good practice to use SQLite as a main session storage or at least as a backup session storage with primary memcached?
Could you give me some pros and cons?
(I am building a MVC Framework for education purposes and was thinking of different possibilities and implemetations)
SQLite Pros
SQLite Cons
Even Better Solution – Memcache
Since sessions are usually accessed with every page hit it would make sense to use the fastest mechanism possible without all the overhead of a database layer while still allowing it to work in a distributed system (multiple PHP servers for example).
Use Memcache which is well tested with PHP and you can even integrate memcache sessions just by modifying a few php.ini settings or for more fine grained control (or to use other software like redis) you can create your own custom session handler.
This has different pros and cons
Memcache Pros
Memcache Cons
Though you should be using other software that monitor both those things or write a cron job script that checks the memcache service is still running – but thats another question and answer for another day. Point is, those cons can be lessened to some degree.
Further reading on the topics covered