in-memory SQL database system In an application, I am using mysql's TEMPORARY TABLE. Since this application does not need permanent tables, I wonder if I can find an alternative RDMS designed for memory tables. I hope to find an in-memory database system, which is


Lightweight
Faster than mysql temporary table
Having an API for C (my programming language)


and no special features is needed, just creating table and performing SQL queries. FK or other advanced features are not needed.
You have two options
OPTION #1 : Create a RAM Disk
RAMDISK_SIZE=32g
service mysql stop
mkdir /var/tmpfs
echo &quot;none   /var/tmpfs  tmpfs  defaults,size=${RAMDISK_SIZE} 1 2&quot; &gt;&gt; /etc/fstab
mount -t tmpfs -o size=${RAMDISK_SIZE} none /var/tmpfs
cp -R /var/lib/mysql/* /var/tmpfs
mv /var/lib/mysql /var/lib/mysql_old
ln -s /var/tmpfs /var/lib/mysql
chown -R mysql:mysql /var/tmpfs
chown -R mysql:mysql /var/lib/mysql
service mysql start

If this does not work, you can reverse it out
service mysql stop
rm -f /var/lib/mysql
mv /var/lib/mysql_old /var/lib/mysql
service mysql start    

You can set the RAMDISK_SIZE to your liking
OPTION #2 : Use FUSION IO
Mount /var/lib/mysql on a FusionIO Disk (all memory, CPU aggressive).
Have fun clearing this with your CFO.
EPILOGUE
Both of these options allow you to use MyISAM and InnoDB as you normally would. The goal is simply to place the entire datdair in RAM.
Give it a Try !!!