Thursday, November 19, 2009

float/double fields

pick up a random obscenely big number. so far, I have no clue where this number is coming from...

Hidden primary key

All tables have a hidden primary key (if you dont create one).
This gave me a lot of grief as none of my inserts would go through. It kept complaining about a "missing key".
the options are to either define a primary key or provide a value for the hidden key.

I am now going to see how I can assign a unique value for the hidden key

Tables disappear

While playing around with the cluster i struggled with tables disappearing on me. Every time I shutdown and restarted the cluster, tables I created earlier were no longer there.
After some research I found the issue was the --initial flag that I was passing when starting the cluster. This needs to be done only the first time.

Tuesday, November 17, 2009

Configure/Start cluster

Source: http://www.ctrip.ufl.edu/mysql-cluster-in-debian-lenny-howto

Configure data & index memory in /var/lib/mysql-cluster/config.ini


ndb_mgmd --initial -f /var/lib/mysql-cluster/config.ini


/etc/init.d/mysql start


cd /usr/local/mysql/bin
./ndbd --initial --connect-string="nodeid=2;host=192.168.1.40:1186"

Tuesday, November 10, 2009

High frequency inserts

I am writing a feed-handler for financial market data. Peak data rate is upto 50k ticks/sec and averages around 10k ticks/sec. The requirement is also to store this data is a structured way in real-time. I have used Berkeley DB in the past which worked well but its a pain for others to directly connect to it.

I am now going to try and setup a MySQL cluster to achieve this. The NDB Storage engine stores all data in memory (i have 48 Gigs of RAM on this machine). It even has a C++ NDB API that lets you work with the database without using the slow SQL statements.