This is a rough rendering of a page from the old Prevayler wiki. Please see the new wiki for current documentation.
No. The snapshot can be taken without stopping the system.
How can you expect to produce a consistent snapshot of a system that is constantly being modified?
This is the fundamental problem with AmbitiousTransparentPersistence
projects. With prevalence, the problem is solved simply by using the command log.
The command log enables the system to have a replica
of the business logic on another virtual machine. All commands applied to the "hot" system are also read by the replica and applied in the exact same order. At backup time, the replica stops reading the commands and its snapshot is safely taken. Then, the replica resumes reading the command queue and gets back in sync with the "hot" system.
Doesn't that replica give me fault-tolerance as a bonus?
Yes it does. I have mentioned one but you can have several replicas. If the "hot" system crashes, any other replica can be elected and take over. Of course, you must be able to afford a machine for every replica you want.
What about business rules involving dates and time? Won't all those replicas get out of sync?
No. If you ask the use-case gurus, they will tell you: "TheClockIsAnExternalActor
to the system.". This means that clock ticks are commands to the business objects and are sequentially applied to all replicas, just like all other commands.
Back to: ObjectPrevalenceSkepticalFAQ
You could explain that "The Clock Is An External Actor To The System" a little better. How about giving some examples, too? How would I make a Command that deals with date & time logic without blowing it all?
If you want your system to be deterministic or at least testable, it cannot simply use "new Date()" to find out what time it is. Your system must use a clock interface that can be implemented as a real clock in production or as a fake clock (stub) for testing. Prevayler
's distribution comes with such an interface and implementation. --KlausWuestefeld
That implementation is the AlarmClock
class. It's quite simple to use, yet very flexible. -- CarlosVillela
How much long takes to do an snapshot for a database under heavy load?
Is this persistent process done incrementally? I mean, are all the operations done during the day take them as a one huge operation when the data becomes persistent?
It seems there could be situations that would benefit from a mixture of prevalence and serialization to disk (along the lines of Jisp). Maybe swapping objects between ram and disk depending on the frequency of use and other factors. This would provide a cheaper alternative for those who can't afford huge amounts of RAM. Is there any plans to implement this in Prevayler
Yes, there are! Any contributions welcome, of course @:) -- CarlosVillela