The reason that I suggested a look at
C-ISAM is that it is the guts of
Informix Standard Engine (SE) and will operate efficiently in a limited RAM environment.
I'm not shilling for IBM, but here's the IBM blurb:
Code:
IBM® Informix® C-ISAM® is a library of C-language functions that manages indexed sequential access method (ISAM) files.
It bypasses the overhead of a relational database management system (RDBMS) and provides fast, efficient access to database records.
* Provides quick data retrieval using B+ tree-index architecture.
* Passes X/Open XPG test suite for ISAM and is X/Open standards-compliant.
* Supports multiple languages through global language support (GLS).
* Offers flexible indexing options that let you build indexes on multiple fields, a single field or parts of a field.
* Includes efficient mechanisms for preserving data integrity.
From your description (and given the limited RAM available) it doesn't look like you need a full-blown RDBMS but you do need a way to get stuff in and out quickly and efficiently;
C-ISAM gives you the ability to strip down to only what you need to get the job done without all the bells and whistles that you don't need getting in the way (and, importantly, using resources you just don't have available). Essentially,
C-ISAM is the data base; it's the storage and retrieval engine.
Now,
C-ISAM is a commercial product and there may be one or more free products that accomplish the same function (I dunno, haven't looked) but it may be worth your time to take a look, given the limits you have, at something other than an RDBMS all of which require (and use) shared memory and some mix of semaphores or queues (or one or both) and you don't have a whole lot of memory available to allocate for those (they use the IPC facilities to prevent deadlock and other problems that can occur in multi-user systems).
If you're thinking about
PHP, it does support pretty much every RDBMS out there;
MySQL,
PostgreSQL,
Informix,
Oracle,
DB-2 and others -- you would probably need to recompile it with the option to include functions for the DBMS you've chosen (other than MySQL, which is the default). And you can use
PHP from the command line (it kicks out HTML than can be redirected to a browser if needed).
Be it
C-ISAM or some other B+ tree ISAM library, it may be worth your time to take a look at one or more to accomplish what you need to do -- it doesn't seem like you're doing a general-purpose system and an ISAM might be the tool you need.
Hope this helps some.