[Seaside] persistence for lazy people
Avi Bryant
avi.bryant at gmail.com
Sun Nov 27 23:03:12 CET 2005
On Nov 26, 2005, at 3:10 PM, Ross Boylan wrote:
> Since the image is already an object database, I was thinking of using
> it to serve seaside, with some thread that wakes every 10? minutes and
> does a save.
>
> I'm not, at least at first, going to have a lot of data or users.
>
> Is this a bad idea, or does it qualify as the simplest thing that
> could possible work?
>
It does, absolutely. It's a great 80% solution when you can get away
with it. If you're worried about dropping requests in the couple of
seconds that the image is saving, see the thread I started on squeak-
dev a bit ago about forking and snapshotting in the background. I
can send you patches for a couple of approaches to this, one which
still involves a GC and one which lives more dangerously and
doesn't. I've been testing both and haven't run into any problems.
Saving an image then becomes nearly free, and you can probably up the
frequency to every 2 or 3 minutes instead.
There's still the problem of potentially losing data if the image
crashes or hangs during those 2 or 3 minutes. One dead-simple way to
handle this that seems like it should work in theory, but still
scares me a bit in practice, is to fully log all of HTTP requests
that come in. If you need to, you can then restart the image from
the last save point and replay those requests. This could also
potentially make for a great forensic tool - you could step through
the requests one by one and hopefully find out *why* the image crashed.
Avi
More information about the Seaside
mailing list