gettingstarted
[Top] [All Lists]

Re: Multiple users writing to the same file

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Multiple users writing to the same file
From: Will Leshner <leshner at ljug dot com>
Date: Tue, 26 Oct 2004 21:55:05 -0700
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <000001c4bbdf$b80d7f90$bca3acac at mikesxp>

On Oct 26, 2004, at 9:44 PM, RBNUBE wrote:

I'm not totally sure I understand even the basics of how databases work. I view a database as a file that is accessed by programs (be it a server
or a client).  The server or client accesses the database and performs
operations on the data.  This is essentially how one would use a text
file except that the file can be opened and edited by more than one
person at a time.



Deep down at some level, a database is just a binary file (or it could even be a text file, but then perhaps there really isn't any difference between a text file and a binary file except how you interpret the bytes). If you write to the file and then I write to the file, there's a pretty good chance I'm going to overwrite what you wrote or that I'm going to change the state of the file out from under you. The job of a database server is to make sure that kind of thing doesn't happen. You can play around with lock files and such and in many cases that may be just fine. But it isn't going to work as well as a server and it won't be as fast. You also have to worry about stuff like what to do if the process inside the lock dies before it can delete the lock. Who will delete the lock and let other processes in? Servers are more than just a fancy lock. They keep the clients from starving for data, for example, something that's hard to control when you've just got a simple lock that everybody has to cooperate with.

--
REALbasic database options: http://sqlabs.net
REALbasic news and tips: http://rbgazette.com
KidzMail & KidzLog: http://haranbanjo.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>