Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Dec 2000 07:20:55 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        Mike <mike@fdhosting.com>
Cc:        questions@freebsd.org
Subject:   Re: OT: gdbm
Message-ID:  <14895.36535.631257.947294@guru.mired.org>
In-Reply-To: <4.3.2.7.2.20001207023235.00ba6978@mail.futuredesigns.net>
References:  <122557536@toto.iv> <4.3.2.7.2.20001207023235.00ba6978@mail.futuredesigns.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Mike <mike@fdhosting.com> types:
> Using MySQL was my original plan, till I started reading more. It would 
> have done everything I needed perfectly.  But with the amount of concurrent 
> accesses, I am worried that it would become the bottleneck in my program.
> I'm not storing a lot of data.. Reason I've been trying for GDBM as opposed 
> to text files, is I've heard the programs run faster when the data is in 
> binary format...

The first time I heard that one, they were referring to the difference
in speed between binary and packed decimal data formats. That's not
likely to be relevant today. Storing data on disk in binary format is
faster than storing it in ASCII because you have to convert it from
ASCII to binary at some point, so you do it once instead of once per
access. However, unless the conversion process is very convoluted,
that difference will be small compared to the time to do the actual
disk I/O. If you are going to use all the data every time the program
runs, gdbm will require more disk access than a simple text file. What
gdbm is good at is keyed access, where you want one record from among
many. It provides an efficient way to go from an arbitrary key to a
disk block.

Of course, a keyed table in an SQL server does the same thing - and
good SQL servers are designed for dealing with the problems of
simultaneous access and update. If you need to update the data while
it's in use, a good SQL server will will do all the hard work for
you. That said, MySQL could still turn into a bottleneck.

	<mike

> At 07:24 AM 12/6/2000 -0600, Mike Meyer wrote:
> >Mike <mike@fdhosting.com> types:
> > > Quick off topic question:
> > > Would it be better/faster to pull configuration for a C or PHP cgi from a
> > > text file, or GDBM db? The program will be accessed over 200,000/day, so
> > > speed and reliability is a concern.
> >
> >If speed and reliability are a real concern, I wouldn't use either one
> >of those; I'd put it in an SQL db. On the other hand, this may not be
> >appropriate for what you're doing.
> >
> >The two methods have different speed tradeoffs, so it's hard to say
> >even if I had an accurate description of the problem. On the other
> >hand, measuring it yourself shouldn't be hard.
> >
> >As for reliability - assuming you're putting preparsed data in the
> >GDBM db, then not having to worry about errors during the parse makes
> >that a bit easier. But that's just a minor benefit.
> >
> >         <mike
> >--
> >Mike Meyer <mwm@mired.org>                      http://www.mired.org/home/mwm/
> >Independent WWW/Unix/FreeBSD consultant,        email for more information.
> 
> 
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Unix/FreeBSD consultant,	email for more information.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14895.36535.631257.947294>