Sour.jpg

I have been following a fascinating story about Coinbase and bitcoins for a few of days. It is better than any other TV show at the moment.

There are Silicon Valley celebrities, VCs, drama, money, lies, and scandal involved. You will not hear about it in mainstream tech blogs, because too much money is at stake.

Instead, you see them singing Coinbase praises.

But if you watch closely, you will see outrage, confusion, and anger of the people on the internet, especially those who had purchased bitcoins recently through Coinbase.

Coinbase: a Bitcoin Wallet

“Coinbase is a cloud-based Bitcoin wallet that allows users to buy and sell bitcoins with a US bank account, send and receive bitcoins with an email address, and accept bitcoin payments as a merchant.”

– Quoted from Wikipedia

Coinbase, one of the latest Silicon Valley darlings that recently raised 25 million dollars from Andreessen Horowitz, is now caught in a PR crisis: their customers accused them of being liars and thieves, because money was taken from these customers’ bank accounts through ACH in exchange for bitcoins at market value. In one case, the amount withdrawn was US$35,104. In another, US$10,701.

However, in both cases, the money simply vanished from bank accounts, and no bitcoins were ever received in return.

Feeling uneasy about this delay, these people reached out to Coinbase’s customer service and heard either no reply or were treated with rudeness. They escalated the case to Hacker News and Reddit in order to be heard, and to seek justice.

Coinbase has explained that it was going through system upgrade, and there may have been data loss. They told people these problems “are only costing people theoretical profits, and not actual”.

The ACID Test

Upon closer examination, one will find that Coinbase chose MongoDB for their primary datastore, which might have caused these troubling transactional errors due to data loss.

MongoDB certainly has great advantages in certain scenarios, such as storing and processing massive amount of unstructured data, but the tradeoffs includes dropping ACID properties that you would find in SAP HANA, which is essential for financial transactions to be reliable.

Quora user Chris Schrader said, “…(not being ACID compliant) means that two people looking at the exact same key may see different values.  For example, if I update key 123 from ABC to DEF, and two people query MongoDB for key 123, 1 person might see ABC and one person might see DEF.

This is because MongoDB is distributed over many nodes and will eventually “sync” the data across those nodes (referred to as eventual consistency).  A traditional RDBMS will “lock” the updated data across all its nodes when performing the update in order to ensure that everyone sees the same thing.  That is pretty important if you’re storing something like financial transactions.”

What Does Being ACID Compliant Mean

In computer science, ACID is a set of properties that guarantee that database transactions are processed reliably. In the context of databases, a single logical operation on the data is called a transaction.”

(Quoted from Wikipedia)

In the world of financial transactions, ACID means:

  • A (Atomicity) – a transaction to transfer funds from one account to another involves making a withdrawal operation from the first account and a deposit operation on the second. If the deposit operation failed, you don’t want the withdrawal operation to happen either.
  • C (Consistency) – a database tracking a checking account may only allow unique check numbers to exist for each transaction
  • I (Isolation) – a teller looking up a balance must be isolated from a concurrent transaction involving a withdrawal from the same account. Only when the withdrawal transaction commits successfully and the teller looks at the balance again will the new balance be reported.
  • D (Durability) – A system crash or any other failure must not be allowed to lose the results of a transaction or the contents of the database. Durability is often achieved through separate transaction logs that can “re-create” all transactions from some picked point in time (like a backup).

(Quoted from Stackoverflow)

We do not know exactly why the above-mentioned transactions failed to be completed by Coinbase, but since ACID helps insure the reliability of financial transactions, people have been questioning the choice of using MongoDB as the main datastore since the early days of Coinbase.

Making the Right Choice

SAP HANA supports the ACID principles, which protects data integrity by making sure the updates will complete together or the database will roll back to pre-transactional state. The bitcoin fiasco we’re seeing now might have been avoided, by choosing a database such as SAP HANA.


(Photo credit: Flickr)

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Christopher Solomon

    Meh….I agree with Henrique. Also, you didn’t really go much into the Coinbase story. Two accounts that “might” have missing bitcoins is hardly “the sky is falling!” stuff.

    You said “The bitcoin fiasco we’re seeing now might have been avoided, by choosing a database such as SAP HANA.” That’s a bit of a stretch no? “Fiasco”? Really? There are other “wallet” options too. Likewise, there are other DB options besides SAP HANA. I think this is too much of a hammer looking for a nail.

    (0) 
    1. Florian Henninger

      There is nothing to add to your statement Christopher.

      SAP Hana is awesome, for sure. But HANA is not the one and only. Just take your time you need to research in all directions.

      Regards

      Florian

      (0) 
  2. Charlotte Han Post author

    Thanks for reading and for all the comments. There are lots of other DB choices; I merely wanted to point out the importance of choosing one that supports ACID in this particular case, and that one of the options is HANA. Part of the reason why I didn’t go much into the Coinbase story is that they hardly ever respond to customer inquiries. Will update the story if Coinbase makes any statement.

    (0) 
  3. Stefan Koehler

    Hi Mukund,

    it seems like you are reading too much shiny SAP marketing papers 😉

    Financial core systems are about running a lot of parallel, tiny and very fast transactions. HFT is a special area in which speed and reliability becomes even more important. However all of these systems have a few requirements in common: Rock solid, scalable and excellent HA / DR possibilities (not talking about cold standby). In such core scenarios there is no need for analytic or crazy reporting functionality.

    However back to Coinbase. I am totally scared about how a CIO or an IT architect can choose a non single server durability database for the financial transaction system. Even MongoDB states that their focus is different (e.g. web apps). I think i have to draw my money and put it under my pillow, if financial institutes are operating like that 😛

    Regards

    Stefan

    (0) 

Leave a Reply