[Tutor] ways to sync databases with Python and SQLite?
Che M
pine508 at hotmail.com
Wed Sep 10 18:02:06 CEST 2008
> One way to work around this and still use SQLight is to put the database on a shared drive. SQLight does table locking, or is it file locking.
> Anyways conflicts will be very minimal to non-existant with only two clients as most operations will complete in microseconds. The SQLight
> website even says this is a fine practice.
I could have the database on a flash drive. I'd like to avoid that, though, because inevitably the user
(mostly me) will forget to bring the drive back and forth from computer to computer.
> However synchronizing two separeatly running databases is a very hard task, and is very very easy to get wrong.
Well, when you say "seperately running"... In my case, it would be rare (or maybe never) that one would be writing
to one computer's copy of the database at the same time as the other computer was doing it on its own. The app
would be logging things in real time on one computer. Later, the other computer needs to get the update so it knows
what happened. But the two copies of the database are accessed in a usually mutually exclusive way (although, yes,
I guess you could run both apps on both computers at the same time and then make things difficult).
I get the sense that Alan's idea of a log file to tell each DB how to change to keep current would work. What
are the "very hard" aspects of that? (I don't doubt there are some real difficulties).
> However if all that one does is read and does no updates or deletes then you could just copy the database over to the 'client' user.
No, both DBs are going to be writing and updating.
Thanks, Chad.
Che
On Tue, Sep 9, 2008 at 6:56 PM, Che M <pine508 at hotmail.com> wrote:
Hi list,
I have been trying to create a small desktop application with Python
that uses a small SQLite database. Recently I've got use of a 2nd computer
(for my job) and have thought now about using the app on that one as well.
I'd like to get ideas about how I could extend the application so that the
databases on each computer could be kept "synchronized" (not sure that is
the right term here); that is, each new change on either computer would
be updated on the other computer(s), given a bit of help from the user.
I know that, for example, the Chandler PIM has a "hub" that allows sync'ing across
multiple computers (though I was surprised to see it is a 8 step process for the user:
http://chandlerproject.org/Projects/GetStarted#Sync%20Chandler%20Desktop%20across%20Mul )
(I realize a good way to do all of this is entirely as a web service, but that is beyond
my abilities, and I am trying to just complete a desktop app before learning much of that)
So, if anyone has ideas on ways to do this with Python and Sqlite that are:
- fairly simple (I'm not a real programmer)
- not laborious for the user to do (so that they actually keep the two dbs in sync)
I'd love to hear about it.
Thanks,
Che
Stay up to date on your PC, the Web, and your mobile phone with Windows Live. See Now
_______________________________________________
Tutor maillist - Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor
_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080910/979b0504/attachment.htm>
More information about the Tutor
mailing list