One of the problems with metaserver.py is that each append/delete commit/rollback are applied globally which makes it slightly difficult to use in a client/server model.
To solve a portion of this problem, I have been working on a layered view. Here is the basic idea:
combined view ---------------- | server view | | -------------| ==> acts just like a metakit view | client view | ---------------- | deleted view | ----------------
New data gets appended to the client view. Mapping views check the client view first (for new updates) and then check the server view. For example, if there is a hash collision, it gets appended to the client view and subsequent hash lookups check the client view first then the server view.
Deletes are a little trickier since metakit allows rows with identical values (some would claim that this violates relational algebra, but I think it's useful). My current approach is that deletes (not appends) lock the view so other users will not be able to delete until the first user does a commit or rollback. This allows me to simply mark server rows that will not be accessible in the combined view. During a commit, these rows are deleted and then the client view is appended. I will probably need some help with the logic of this one.
The only new views that I have had to add is a row/column level locking table to control access.
All the combined view is written in python and manages the two views acting as a single view. The code is fairly trivial and doesn't seem to affect speed too much. I currently do have a problem with operations between combined views, but operations between normal views and combined views work like a champ.
I had a couple of thoughts based on this experiment.
1) Having a view level commit would be incredibly useful. storage.commit(viewname) or view.commit() would save a *lot* of headache. I have been slowly looking over the metakit code and speaking from a position of almost total ignorance I think this might be a little complicated.
2) The combined view is really a special form of a blocked view. I think (again) from a position of complete ignorance, that it would be fairly easy to generate one of these views using the blocked view code with a modicum of change. (i.e. appends go to the second view and lookups check the second view first then the first view) I've actually used Christian Tismer's code for inspiration for the combined view.
I've mentioned this before, but I can even create a combined view using views from different storages!
All in all, given the fact that I have been learning as I'm going, I think that metakit is really, really close to providing almost full ACID support. Am I kidding myself here?
Brian
_____________________________________________ Metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit
