views:

498

answers:

8

I'm an embedded guy, not a database guy. I've been asked to redesign an existing system which has bottlenecks in several places.

The embedded device is based around an ARM 9 processor running at 220mHz.

There should be a database of 50k entries (may increase to 250k) each with 1k of data (max 8 filed). That's approximate - I can try to get more precise figures if necessary.

They are currently using SqlLite 2 and planning to move to SqlLite 3.

Without starting a flame war - I am a complete d/b newbie just seeking advice - is that the "best" decision? I realize that this might be a "how long is a piece of string?" question, but any pointers woudl be greatly welcomed. I don't mind doing a lot of reading & research, but just hoped that you could get me off to a flying start. Thanks.

p.s Again, a total rewrite, might not even stick with embedded Linux, but switch to eCos, don't worry too much about one time conversion between d/b formats. Oh, and accesses should be infrequent, at most one every few seconds.


edit: ok, it seems they have 30k entries (may reach 100k or more) of only 5 or 6 fields each, but at least 3 of them can be a search key for a record. They are toying with "having no d/b at all, since the data are so simple", but it seems to me that with multiple keys, we couldn't use fancy stuff like a quicksort() type search (recursive, binary search). Any thoughts on "no d/b", just data-structures?

Btw, one key is 800k - not sure how well SqlLite handles that (maybe with "no d/b" I have to hash that 800k to something smaller?)

+10  A: 

I would stick with SQLite, it's widely supported and pretty rich in features.

Techpriester
+1  A: 

i am not familiar with embed system, but iphone use arm9, and sqlite as DB

joetsuihk
+2  A: 
  • Firebird (previously Interbase) claims to work well embedded.

  • HypersonicQL (HQL) is small and fast and also claims to be suitable for embedded use.

Alas, I have no personal experience to back up either claim.

Carl Smotricz
+2  A: 

I will suggest sqlite3 too. It is used by many famous application.

sagasw
+9  A: 

Also SQLite is the Database chosen by virtually all mobile operating systems. Android, Iphone OS and Symbian ship with SQLite which makes me think that manpower was spent to optimize it for the processor in those phones (nearly always ARM).

Valentin
+3  A: 

SQLite is probably a pretty safe bet. However, if performance is really important for your application and you do not need a relational database, I would suggest you take a look at Berkeley DB link text . Berkeley DB is not a relational database though. In other words, if your data is grouped in different tables and you constantly need to query result sets that require relating data from more than one table, you probably need a relational database. Berkeley DB is better suited for something like look up tables (i.e., the data is organized in a few tables and you don't need to query data from more than one of them in order to produce the result sets you want). Berkeley DB is very fast but it will require more work on your end in order to get the most out of it.

figurassa
Just a single table, 5 or 6 fields, but three of them can be used as a unique key... and there are a lot of records - 30k, might become 100k, possibly even 256k
Mawg
In this case, I'd say Berkeley DB is absolutely perfect for your application. If performance is of utmost importance for your application, I think you should look into Berkeley DB.
figurassa
Here's a performance comparison of sqlite and Berkeley DB: http://www.sqlite.org/cvstrac/wiki?p=KeyValueDatabase for key-value data storing
Igor Brejc
+1  A: 

The 01-11-10 Embedded.com Newsletter does a nice job of covering this topic. The newsletter can be found at Embedded.com.

tkyle
A: 

if you want an alternative, then berkeleydb is worth looking at. it used to be owned by sleepycat software, but is now available from oracle. it's a barebones database engine; is directly programmable (rather than a sql) frontend. it's used as part of the core engine in many major databases, and as the database in many embedded devices - it used to be particularly popular for managing routing tables in routers. it tends to get overlooked these days for more fashionable setups, but i've found it to be decent, solid and for the numbers you are talking about it can be lightning fast.