ebmDevMag.com home
ebm Developer's Magazine
links

developer's mag
main page

article
part 1
part 2
part 3
part 4
part 5
part 6
part 7
part 8


2 - db Size vs. db Speed

Many databases are termed flat-file - that is, the file is flat, without relations or connections to other databases. In contrast, relational databases have multiple tables connected together, saving space but increasing complexity.

If you've worked with databases on other operating systems, the ebm version should have few surprises. The ebm database is a flat file; although you can do the equivalent of relational databases, you will have to program it in software yourself. A typical flat file is a series of records of fixed length, as well as each field in the record. With a fixed field and record size, reaching any point in the database is a simple calculation. However, while access is quick, the penalty is in the database size. Since you need to set aside the maximum size for each field, more often than not there is wasted space. A classic example is with personal surnames, which have a lot of variance.

This space/speed compromise is also apparent on the ebm. However, since space is so important, the database is designed to be efficient in space, at the (potential) loss of some access speed. (I say potential, because there are ways to speed up access; as well we are dealing with a RAM database, which is orders of magnitude faster than any disk-based database). The ebm uses variable-length field and records. You still have to specify the maximum size of a field, but now you know you're not wasting space if it's not completely filled - for that reason, you can have a surname field size of 80 characters if you want, and guarantee all but the most bizarre surname will fit. The compromise is that now fields have to be found by searching through the record, but even then there are techniques to speed up access, resulting in the ebm database being a good all-around way of storing data compactly and efficiently.

Previous Section
Next Section

Copyright © 2001-2006 ebmDevMag.com - Legal Notice