Building a bitcoin exchange - what database technologies to evaluate?

6 points by wildbunny ↗ HN
Hi guys,

I'm considering R&Ding the technology to run a scalable bitcoin exchange. I'd like to start by evaluating existing NewSQL and NoSql databases for suitability, but there are now so many choices this process is rather difficult.

Scalability is a big concern, but consistency is more important since an exchange deals directly with financial transactions and will almost certainly require cross-table atomicity.

Does anyone have any suggestions on where to start, other than google?

Cheers, Paul.

6 comments

[ 3.0 ms ] story [ 21.0 ms ] thread
Database scalability isn't likely to be a major issue, pretty much any major database can handle the volume of data you're likely to need.

Security, reliability, consistency and integrity are likely to be much more important. How will your system handle encryption and ACLs, how will it recover from partial system failures, when there's an inconsistency how will you resolve the authoritative truth, how are you going to store transaction logs (i.e. read-only media), etc ?

I am a layman with this stuff, so do your own due diligence.

You can look into the buttercoin project on github. Current exchange technology is not scalable past something like 50 operations per second, because of blocking issues. Using something like LMAX (which is used by betfair), you're probably able to get something like 1,000 operations per second. It's still in beta, but it can be out of beta if you can dig into coffeescript.

LMAX seems ideal because if something goes wrong, you can switch machines, load up the transaction history, and get going again in minutes.

Current stock exchanges may not be a great place to look, as they track thousands of individual stocks. A bitcoin exchange is different, as it's more akin to a stock exchange where there's only 1 stock and multiple currencies.

http://buttercoin.net/

http://martinfowler.com/articles/lmax.html

if you have to ask this, then you are not qualified to handle other people's money over the internet. not to be an ass about it... just the harsh reality.
Using PostgreSQL in our testing, we're simulating a little over 40,000 matched orders per second.

Source: We're in the final testing stages of a UK based exchange.