[CDBI] Re: Serializing a CDBI object

Perrin Harkins perrin at elem.com
Thu May 3 16:57:08 BST 2007


On 5/3/07, Bill Moseley <moseley at hank.org> wrote:
> In that you can lose session data?

Yes.

> Cache::FastMmap is the same way
> and is often used for session data.

That's a bad idea too.  It's somewhat safer than memcached, since at
least you don't lost all your data if there's a problem, but it is
still designed to silently drop data.

> Just looking at options at this point, but thinking about
> session stores when using a number of web servers on different
> machines -- and not using sticky sessions.  So the session data has to
> be available to all servers.

Well, if it's data, and it's important, it's hard to see why it
shouldn't go in the database.  I often see people spend a lot of time
tuning their database and building backup and failover systems for it,
and then put their sessions into a totally different system.

But I should get off my high horse because sometimes people just
decide session data is not important.  You have to make a choice about
what's appropriate for your site.  For example, I read an article
about the architecture of MySpace where they said that they
essentially don't care if their users lose session data and get logged
out or have other problems, so they store it in a very fast and
unreliable way.  That can work for some people.

> The database might indeed turn out to be the best approach, but also
> considering ways to reduce the load on the database.

A write-through cache with memcached or the like will accomplish that
if the sessions are read more than written.

- Perrin



More information about the ClassDBI mailing list