16

We're designing an OLTP financial system. it should be able to support 10.000 transactions per second and have reporting features.

So we have come to the idea of using:

  • a NoSQL DB as our main storage
  • a MySQL DB (Percona server actually) making some ETLs from the NoSQL DB for store reporting data

We're considering MongoDB and Riak for the NoSQL job. we have read that Riak scales more smoothly than MongoDB. And we would like to listen your opinion.

  • Which NoSQL DB would you use for a OLTP financial system?
  • How has been your experience scaling MongoDB/Riak?
Community
  • 1
  • 1
SDReyes
  • 9,798
  • 16
  • 53
  • 92

9 Answers9

18

There is no conceivable circumstance where I would use a NOSQl database for anything to do with finance. You simply don't have the data integrity needed or the internal controls. Dow Jones uses SQL Server to do its transactions and if they can properly design a high performance, high transaction Relational datbase so can you. You will have to invest in some people who know what they are doing though.

HLGEM
  • 94,695
  • 15
  • 113
  • 186
  • 15
    +1 Anyone who seeks to use an "eventually consistent" database for financials is not qualified to implement financial software, full stop. – Bill Karwin Jun 02 '11 at 21:33
  • 11
    Not all NoSQL databases are eventually consistent and many have the necessary integrity and internal controls. Finally, not everything that has to do with finance requires absolute integrity and control. – Elad Jun 03 '11 at 07:14
  • 2
    @elad, you clearly have never worked with auditors if you think that. I did work for an audit agency and it is foolish to even consider a noSQL database for financial apps. – HLGEM Jun 03 '11 at 13:49
  • 5
    it's a matter of defining "financial". If I build my home-grown algotrading app I don't care about auditors. That doesn't make it "not financial"... – Elad Jun 03 '11 at 14:41
  • At the end we considered VoltDB. ACID compliant, In-Memory storage and SQL. – SDReyes Jun 08 '11 at 21:54
  • +1 We have a mature, functioning, SQL Server-based financial application. i was trying to find *real-world* NoSQL examples, and how it can be used to solve real-world problems. i thought maybe we could convert the system to NoSQL because we have a lot of data (details of transactions, audit logging, etc) and NoSQL can magically make queries run instantly, and it would eliminate the need to archive data after 90 days, and again after 7 years, because with NoSQL you can attach another server to the network and it will just grow. i guess i was mistaken. – Ian Boyd Aug 26 '11 at 19:18
  • 2
    What is this answer and "eventually consistent" comment is all about - it's like believing that when you withdraw money from an ATM which belongs say to some french bank, operation is performend inside a single db transaction on the US bank server. If you have atomic modification and compare and set you can build whatever locking mechanism you like. – Boris Treukhov Jan 23 '14 at 21:55
  • 1
    Financial can mean many different things, we all understand that if you have to manage account money you need good security, however if you just want to store tickdata at home for personal use this is a different matter. – BlueTrin Jun 25 '14 at 14:40
  • @BlueTrin, whatever you want to do at home is fine, I was referring to business programming. – HLGEM Jun 25 '14 at 16:31
  • 1
    @HLGEM: the point is that Finance is not only accounting and slow data, there are usages in high-frequency data for example: See this thread http://quant.stackexchange.com/questions/1392/usage-of-nosql-storage-in-finance. In high-frequency Finance, KDB is almost standard for the big players. – BlueTrin Jun 25 '14 at 17:54
7

One has to think about the problem differently. The notion of transaction consistency stems from the UD (update) in CRUD (Create, Read, Update, Delete). noSQL DBs are CRAP (Create, Replicate, Append, Process) oriented, working by accretion of time-stamped data. With the right domain model, there is no reason that auditability and the equivalent of referential integrity can't be achieved.

Truenum
  • 71
  • 1
  • 1
6

The global-storage based NoSQL databases - Cache from InterSystems and GT.M from FIS - are used extensively in financial services and have been for many years. Cache in particular is used for both the core database and for OLTP.

Rob Tweed
  • 79
  • 1
3

I can answer regarding my experience with scaling Riak.

Riak scales smoothly to the extreme. Scaling is as easy as adding nodes to the cluster, which is a very simple operation in itself. You can achieve near linear scalability by simply adding nodes. Our experience with Riak as far as scaling is concerned has been amazing.

The flip side is that it is lacking in many respects. Some examples:

  • You can't do something like count(*) or list keys on a production cluster. That would require a work around if you want to do ETL from Riak into MySQL - or how would you know what to (E)xtract? (One possible work around would be to maintain a bucket with a known key sequence that map to values that contain the keys you inserted into your other buckets).
  • The free version of Riak comes with no management console that lets you know what's going on, and the one that's included in the Enterprise version isn't much of an improvement.
  • You'll need the Enterprise version of you're looking to replicate your data over WAN (e.g. for DR / high availability). That's alright if you don't mind paying, but keep in mind that Basho pricing is very high.
Elad
  • 3,145
  • 2
  • 20
  • 17
  • 1
    Thank you for sharing your experience with Riak, Elad. I was thinking, it's not possible doing things like 'count' and 'list keys' using mapReduce? +1 – SDReyes Jun 02 '11 at 19:04
1

You can use some NoSQL databases (Cassandra, EventStore) as a storage for financial service if you implement your app using event sourcing and concepts from DDD. I recommend you to read this minibook http://www.oreilly.com/programming/free/reactive-microservices-architecture.html

Denis Mikhaylov
  • 2,035
  • 21
  • 24
1

OLTP can be achieved using NoSQL with a custom implementation,

there are two things, 1. How are you going to achieve ACID properties that an RDBMS gives. 2. Provide a custom blocking or non blocking concurrency and transaction handling mechanism.

To take you closer to solution, Apache Phoenix,apache trafodion or Splice machine.

Yash K
  • 41
  • 2
1

I work with the Starcounter (so I’m biased), but I think I can safely say that for a system processing financial transactions you have to worry about transaction consistency. Unfortunately, this is what the engines used for Facebook and Twitter had to give up allow their scale-out strategy to offer performance. This is not because engines such as MongoDb or Cassandra are poorly designed; rather, it follows naturally from the CAP theorem (http://en.wikipedia.org/wiki/CAP_theorem). Simply put, changes you make in your database will overwrite other changes if they occur close in time. Ok for status updates and new tweets, but disastrous if you deal with money or other quantities. The amounts will simply end up wrong when many reads and writes are being done in parallel. So for the throughput you need, a memory centric NoSQL database with ACID support is probably the way to go.

0

Trafodion has full ACID support over HBase, you should take a look.

Ming_Liu
  • 16
  • 1
-4

Cassandra can be used for both OLTP and OLAP. Good replication and eventual data consistency gives you the choice in your hand. Need to design the system properly. And after all it's free of cost but not free of developer, give it a try

Anupam
  • 1