logo       

Re: [sqlite] Multi-master replication with updated Versioning extension: msg#00853

sqlite-users

Subject: Re: [sqlite] Multi-master replication with updated Versioning extension

On Thu, Jul 30, 2009 at 06:11:42PM +0400, Alexey Pechnikov scratched on the
wall:
> Hello!
>
> On Thursday 30 July 2009 17:25:15 P Kishor wrote:
> > > I haven't looked at your work in depth, but I am interested in this. I
> > > have implemented a very simple versioning system with TRIGGERs whereby
> > > every change (INSERT, UPDATE, DELETE) in a column in a table is stored
> > > in a versions table along with its primary key, allowing me to go back
> > > and examine any version and roll back to it, if desired.
>
> Yes, the primary key field is good enough for master-slave replication
> but not for multi-master because each master has self sequence counter.

You're saying primary key when I think you more specifically mean
ROWID. Assuming you could override and force AUTOINCREMENT behavior
on all tables (that might make an interesting PRAGMA), this could
help with that:

http://www.sqlite.org/cvstrac/tktview?tn=3563

As long as the "BY" is greater than the number of masters and each
master has a "FROM" that is sequenced, they'll leap-frog over each
other.

Then again, given that ROWID values are signed 64 bit values, you
could just start each master at some offset (like +0x00FFFFFFFFFFFFFF)
and not worry about it. It would still be a good idea to force all
the tables into an AUTOINCREMENT mode somehow.

PRAGMA request: http://www.sqlite.org/cvstrac/tktview?tn=4002

-j

--
Jay A. Kreibich < J A Y @ K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs. We have
a protractor." "I'll go home and see if I can scrounge up a ruler
and a piece of string." --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@xxxxxxxxxx
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Google Custom Search

News | Mail Home | sitemap | FAQ | advertise