Re: Using a Database
- Posted by Robert Craig <rds at RapidEuphoria.com> Oct 13, 2003
- 513 views
ronaustin at alltel.net wrote: > I need to write out a file that has a six byte key (an account > number) and a 500 byte record. The first two fields in the record > contain the last name and the first name of a person. I need to be able > to recall the person's record either by the account number or the first > and last name. EDS only supports one key (in your case the account number). You could search all the records for a matching first and last name. For a few thousand names that would take a fraction of a second. You might want to do a kind of "fuzzy" match on the name, since people don't always provide their names in exactly the same way each time. For greater speed, you could also set up a secondary index fairly easily, but you would have to maintain it yourself. You would create a second table with {first name, last name} as the key. The data would be a sequence of account numbers of people with that name. EDS would then do a fast binary search to find a name. The corresponding account number(s) could then be looked up in the main table using a fast binary search. You'd have to update this table whenever you added or deleted an account from the main table. > There can be several people on a network adding new > records and updating existing records. It might be possible that two > people try to change the same record at the same time. The system I am > currently using has recording locking to keep this from happening. I > understand the EDS database has file locking which I assume would only > allow one person to read and write while the other six or seven computer > operators drank coffee. > > 1. Am I correct in assuming that this is the way the EDS database works? Yes, it currently has only file locking. For many applications that's all you need. i.e. if the process that is writing the database only needs access for a few seconds or less at a time. The other processes can poll until the database is free. One good thing about EDS, especially on the Web, is that it is very lightweight - a database can be opened, read or written, and closed very quickly. > 2. If so, is it going to be changed. When? Probably some day. There hasn't been a huge demand for it yet. > 3. If not, how does it work? > > 4. Should I skip the EDS and use MySQL with a ODBC wrapper? Matthew Lewis could probably answer that. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com