The Real Bitcoin / NoSQL Failure

The real bitcoin / NoSQL failure did not occur at Flexcoin or Poloniex. It was a failed attempt to associate their failures with NoSQL. I read it (link), and I agree with Alex (link).

“It's not every day when one's professional interests in NoSQL databases collide with one's interest in cryptocurrencies, especially in such a monumental train wreck.”

Did it?

Failure #2

A poor example of an application processing ATM withdrawals.

  1. Check the account balance.
  2. Update the account balance.
  3. Dispense cash.

Why is this is a poor example? The account balance is not updated. There is no account balance. There is a current balance, and there is an available balance. A withdrawal, a debit transaction, is inserted. This is a better example.

  1. Check the available balance.
  2. Insert a withdrawal / debit transaction.
  3. Dispense cash.

Failure #3

An inaccurate description of how ATM withdrawals might be processed with MongoDB.

  1. Our account balance is $1,000.
  2. I withdraw $100.
  3. My wife withdraws $100.
  4. Our account balance is $900.

No, our account balance is not $900. It’s $800. There are NoSQL databases that support optimistic and / or pessimistic locking. The application should leverage compare-and-swap (CAS) in the poor example. The application should leverage pessimistic locking in the better example.

  1. Lock the account.
  2. Check the available balance.
  3. Insert a debit transaction.
  4. Release the account lock.

Success #1

It’s not a complete failure. The author makes a valid point. There were first generation NoSQL databases relied on eventual consistentcy. However, that is no longer the case. They have evolved to support strong consistency. However, while some NoSQL databases enforce strong consistency, it's optional with others.

  • With MongoDB, it depends on the write concern (link).
  • With Cassandra, it depends on the consistency level (link).
  • With Couchbase Server, it is enforced (link).

What was the first failure?

The dots were not connected.

  • There were failures.
  • Here is a poor example.
  • Here is an inaccurate description.
  • The problem is MongoDB.

Did Flexcoin and Poloniex persist bitcoin transactions to a NoSQL database? I don’t know. There was no evidence provided. How were Flexcoin and Poloniex persisting data to the NoSQL database? I don’t know. There was no description provided.

That’s the first failure.

It's the failure.


I haven't integrated Discus yet. Feel free to comment on DZone, Reddit, or Hacker News.