Re: Using a Database
- Posted by ronaustin at alltel.net Oct 13, 2003
- 510 views
--------------Boundary-00=_FNZPQL80000000000000 charset="iso-8859-1" =0D =0D -------Original Message-------=0D =0D From: EUforum at topica.com=0D Subject: Re: Using a Database=0D =0D =0D =0D ronaustin at alltel.net wrote:=0D > I need to write out a file that has a six byte key (an account =0D > number) and a 500 byte record. The first two fields in the record =0D > contain the last name and the first name of a person. I need to be able= =0D > to recall the person's record either by the account number or the first= =0D > and last name. =0D =0D EDS only supports one key (in your case the account number).=0D You could search all the records for a matching first and last name.=0D For a few thousand names that would take a fraction of a second.=0D You might want to do a kind of "fuzzy" match on the name, since=0D people don't always provide their names in exactly the same way=0D each time.=0D =0D For greater speed, you could also set up a secondary index=0D fairly easily, but you would have to maintain it yourself.=0D You would create a second table with {first name, last name}=0D as the key. The data would be a sequence of account numbers=0D of people with that name. EDS would then do a fast binary search=0D to find a name. The corresponding account number(s) could then=0D be looked up in the main table using a fast binary search.=0D You'd have to update this table whenever you added or=0D deleted an account from the main table.=0D =0D > There can be several people on a network adding new=0D > records and updating existing records. It might be possible that two =0D > people try to change the same record at the same time. The system I am = =0D > currently using has recording locking to keep this from happening. I =0D > understand the EDS database has file locking which I assume would only = =0D > allow one person to read and write while the other six or seven compute= r =0D > operators drank coffee.=0D > =0D > 1. Am I correct in assuming that this is the way the EDS database works= ?=0D =0D Yes, it currently has only file locking. For many applications that's=0D all you need. i.e. if the process that is writing the database=0D only needs access for a few seconds or less at a time.=0D The other processes can poll until the database is free.=0D One good thing about EDS, especially on the Web, is that=0D it is very lightweight - a database can be opened, read or written,=0D and closed very quickly.=0D =0D > 2. If so, is it going to be changed. When?=0D =0D Probably some day.=0D There hasn't been a huge demand for it yet.=0D =0D > 3. If not, how does it work?=0D > =0D > 4. Should I skip the EDS and use MySQL with a ODBC wrapper?=0D =0D Matthew Lewis could probably answer that.=0D =0D Regards,=0D Rob Craig=0D Rapid Deployment Software=0D http://www.RapidEuphoria.com=0D =0D Thanks for the info. Typically someone would pull up a record and then verify the information was correct before writing it back out. Then ther= e might be further delays because they had to answer the phone, etc., so I couldn't use a file lock. In the past I have built my own locking table which worked ok and I have also used multiple indexes which I had to maintain.=0D =0D I think I will start with EDS and then change to SQL if I have to. Many = of the files I will be using are look-up files that will work okay without being locked.=0D =0D =0D =0D =0D TOPICA - Start your own email discussion group. FREE!=0D =0D =0D =0D =0D =2E=20 --------------Boundary-00=_FNZPQL80000000000000 Content-Type: Text/HTML; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-= 1"> <META content=3D"IncrediMail 1.0" name=3DGENERATOR> <!--IncrdiXMLRemarkStart> <IncrdiX-Info> <X-FID>FLAVOR00-NONE-0000-0000-000000000000</X-FID> <X-FVER></X-FVER> <X-CNT>;</X-CNT> </IncrdiX-Info> <IncrdiXMLRemarkEnd--> </HEAD> <BODY style=3D"BACKGROUND-POSITION: 0px 0px; FONT-SIZE: 12pt; MARGIN: 5px= 10px 10px; FONT-FAMILY: Arial" bgColor=3D#ffffff background=3D"" scroll=3D= yes ORGYPOS=3D"0" X-FVER=3D"3.0"> <TABLE id=3DINCREDIMAINTABLE cellSpacing=3D0 cellPadding=3D2 width=3D"100= %" border=3D0> <TBODY> <TR> <TD id=3DINCREDITEXTREGION style=3D"FONT-SIZE: 12pt; CURSOR: auto; FONT-F= AMILY: Arial" width=3D"100%"> <DIV><BR> </DIV> <DIV id=3DIncrediOriginalMessage><I>-------Original Message-------</I></D= IV> <DIV> </DIV> <DIV id=3Dreceivestrings> <DIV dir=3Dltr style=3D"FONT-SIZE: 11pt" <i><B>From:</B></I> <A href=3D"m= ailto:EUforum at topica.com">EUforum at topica.com</A></DIV> <DIV dir=3Dltr style=3D"FONT-SIZE: 11pt" <i><B>Date:</B></I> Monday, Octo= ber 13, 2003 7:28:12 PM</DIV> <DIV dir=3Dltr style=3D"FONT-SIZE: 11pt" <i><B>To:</B></I> <A href=3D"mai= lto:EUforum at topica.com">EUforum</A></DIV> <DIV dir=3Dltr style=3D"FONT-SIZE: 11pt" <i><B>Subject:</B></I> Re: Using= a Database</DIV></DIV> <DIV> </DIV> <DIV>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The Euphoria Mailing List =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D <BR><BR><BR><A href=3D"mailto:ronaustin@al= ltel.net">ronaustin at alltel.net</A> wrote:<BR>> I need to write out a f= ile that has a six byte key (an account <BR>> number) and a 500 byte r= ecord. The first two fields in the record <BR>> contain the last name = and the first name of a person. I need to be able <BR>> to recall the = person's record either by the account number or the first <BR>> and la= st name. <BR><BR>EDS only supports one key (in your case the account numb= er).<BR>You could search all the records for a matching first and last na= me.<BR>For a few thousand names that would take a fraction of a second.<B= R>You might want to do a kind of "fuzzy" match on the name, since<BR>peop= le don't always provide their names in exactly the same way<BR>each time.= <BR><BR>For greater speed, you could also set up a secondary index<BR>fai= rly easily, but you would have to maintain it yourself.<BR>You would crea= te a second table with {first name, last name}<BR>as the key. The data wo= uld be a sequence of account numbers<BR>of people with that name. EDS wou= ld then do a fast binary search<BR>to find a name. The corresponding acco= unt number(s) could then<BR>be looked up in the main table using a fast b= inary search.<BR>You'd have to update this table whenever you added or<BR= >deleted an account from the main table.<BR><BR>> There can be several= people on a network adding new<BR>> records and updating existing rec= ords. It might be possible that two <BR>> people try to change the sam= e record at the same time. The system I am <BR>> currently using has r= ecording locking to keep this from happening. I <BR>> understand the E= DS database has file locking which I assume would only <BR>> allow one= person to read and write while the other six or seven computer <BR>> = operators drank coffee.<BR>> <BR>> 1. Am I correct in assuming that= this is the way the EDS database works?<BR><BR>Yes, it currently has onl= y file locking. For many applications that's<BR>all you need. i.e. if the= process that is writing the database<BR>only needs access for a few seco= nds or less at a time.<BR>The other processes can poll until the database= is free.<BR>One good thing about EDS, especially on the Web, is that<BR>= it is very lightweight - a database can be opened, read or written,<BR>an= d closed very quickly.<BR><BR>> 2. If so, is it going to be changed. W= hen?<BR><BR>Probably some day.<BR>There hasn't been a huge demand for it = yet.<BR><BR>> 3. If not, how does it work?<BR>> <BR>> 4. Should = I skip the EDS and use MySQL with a ODBC wrapper?<BR><BR>Matthew Lewis co= uld probably answer that.<BR><BR>Regards,<BR>Rob Craig<BR>Rapid Deploymen= t Software<BR><A href=3D"http://www.RapidEuphoria.com">http://www.RapidEu= phoria.com</A></DIV> <DIV> </DIV> <DIV><STRONG><FONT color=3D#ff8000>Thanks for the info. Typically s= omeone would pull up a record and then verify the information was correct= before writing it back out. Then there might be further delays bec= ause they had to answer the phone, etc., so I couldn't use a file lock. &= nbsp; In the past I have built my own locking table which worked ok and I= have also used multiple indexes which I had to maintain.</FONT></STRONG>= </DIV> <DIV><STRONG><FONT color=3D#ff8000></FONT></STRONG> </DIV> <DIV><STRONG><FONT color=3D#ff8000>I think I will start with EDS and then= change to SQL if I have to. Many of the files I will be using are = look-up files that will work okay without being locked.</FONT></STRONG></= DIV> <DIV><BR><BR>--^---------------------------------------------------------= -------<BR>This email was sent to: <A href=3D"mailto:ronaustin at alltel.net= ">ronaustin at alltel.net</A><BR><BR>EASY UNSUBSCRIBE click here: <A href=3D= "http://topica.com/u/?b1dd66.b6KEgr.cm9uYXVz">http://topica.com/u/?b1dd66= =2Eb6KEgr.cm9uYXVz</A><BR>Or send an email to: <A href=3D"mailto:EUforum-= unsubscribe at topica.com">EUforum-unsubscribe at topica.com</A><BR><BR>TOPICA = - Start your own email discussion group. FREE!<BR><A href=3D"http://www.t= opica.com/partner/tag02/create/index2.html">http://www.topica.com/partner= /tag02/create/index2.html</A><BR>--^-------------------------------------= ---------------------------<BR><BR><BR><BR><BR>. </DIV></TD></TR> <TR> <TD id=3DINCREDIFOOTER width=3D"100%"> <TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"100%"> <TBODY> <TR> <TD width=3D"100%"></TD> <TD id=3DINCREDISOUND vAlign=3Dbottom align=3Dmiddle></TD> <TD id=3DINCREDIANIM vAlign=3Dbottom align=3Dmiddle></TD></TR></TBODY></T= --------------Boundary-00=_FNZPQL80000000000000--