Maintaining a session is something most web apps need to do, and all web frameworks implement some sort of session management system.
Pylons allows you to specify the type of session your web app should use: database, file, memcached, etc. The great thing about it is that you can easily implement your own session manager and plug it right in.
Here I am implementing a session manager that uses Tokyo Cabinet and JSON (instead of cPickle). The simplejson module now has speedups that use C extensions so load and dump are more or less on par with cPickle. With JSON serialization you'll be able to share the session data in apps written in other languages (such as Java, Perl, Ruby).
Tokyo Cabinet is a class of DBM that is a key-value store. It differs from RDBMS in that data are stored solely as key-value pairs, with no relations to each other. The advantage over RDBMS is that Tokyo Cabinet is lightning fast in comparison. If you're familiar with memcached, you can think of it like memcached except with persistent data. Since sessions need to be accessed frequently, and sessions are essentially key-value pairs -- a key/namespace mapping to a session object -- I thought it'd be a good candidate to use Tokyo Cabinet.
Assuming you already have a Pylons project setup, let's create a file under [project path]/lib/ called tcjson.py (Tokyo Cabinet JSON... get it?), and fill it with the following.
Now, put this in your [project path]/config/environment.py file.
You can then specify ext:tcjson as your beaker session in your INI file (e.g. development.ini).
Fire up your app and it should be using Tokyo Cabinet for your sessions! :)