Sign up ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

I am wondering if anyone has used NoSQL (mongodb, cassandra, etc.) to store and analyze data. I tried searching the web but was not able to see if the financial firms had gotten in to using nosql storage.

So far even on this site i have only seen talks of using SQL DBs. I would imagine that NoSQL would be much faster.

Would someone shed light on the subject of NoSQL solutions in the finance world. have you seen/heard anyone use it? if so why are they using. if not using then why not.

share|improve this question

5 Answers 5

Specialised NoSQL database systems are used a lot for time series storage, particularly for tick data:

  • Kx / Kdb is one prominent solution; from Arthur Whitney et al who did A+ at Morgan Stanley
  • Onetick is another, newer entrant, which has traces back to Goldman Sachs
  • Voltdb is something by serial database inventer Michael Stonebreaker
  • SciDB is another recent Stonebreaker project, trying 'commercial open source' but more for science apps (at least for now?)

The commercial offerings tend to be rather expensive and I have not heard of use of standard Web 2.0 NoSQL databases in trading environments. Some may of course do rather than talk ...

share|improve this answer
thank you this is very helpful. i have used nosql and love it (used to only serve data for search engines for enterprises). the data is still stored in DB in the backend. –  user697697 Jul 1 '11 at 20:35
Kdb+ and OneTick are column-oriented stores, which is a frequent topic here. Stonebreaker's own column-oriented DB is Vertica, which was recently bought by HP. (VoltDB is row-oriented and intended for OLTP applications, whereas the column-oriented products here are intended for OLAP.) –  chrisaycock Jul 2 '11 at 3:26
Chris, thanks for expanding the answer.. Besides Vertica, one could also mentions Sybase's offering in the area. I do think SciDB is column-oriented too, though, and could become a dark horse. They talk R support right from the start. –  Dirk Eddelbuettel Jul 2 '11 at 7:40
@Dirk Yes, Sybase IQ (now part of SAP) is also in this space. There's Vhayu (part of Thomson Reuters) too, though I haven't heard much from them in a while. I'm still confused as to what SciDB actually does. –  chrisaycock Jul 2 '11 at 15:21
Note that the link for SciDB should be, not .com. –  joshayers Dec 13 '11 at 21:20

The reason that "traditional" NoSql databases will not get much up take in finance is that they are designed to solve a different problem. Most NoSql databases from the web world are designed with two central design parameters. First key lookups should be very fast. Second is that operations should be atomic at the row level and should not span records. This allows the database to be sharded very effectively since no operation should span multiple machines and in turn this allows them to build scale out architectures. These databases are built for very write heavy workloads and to be able to have fast key lookups to render webpages. While it is possible to use them to store tick data its not really what they are good at.

Financial data tends to be small relative to large web companies data. So scale out in finance is less important. Also financial data tends to partition well (at the day, symbol, or almost any other key) so replica placement tends to be more explicit.

Map reduce is the typical way to build analytical applications for these data stores either using hadoop (Cassandra) or internal map reduce (MongoDB has a java script MR API). This is typically not the ideal paradigm for analyzing time series data.

Traditional column oriented stores with integrated time series analytics tools or custom built platforms will continue to be the preferred way to store and process time series data. I don't think that there will (or should) be much convergence between the databases built for running very high scale websites and the databases built to store and analyze time series information.

All that being said we use mongodb extensively for metadata storage and as a sort of very large cache. But we don't use it to store or analyze financial data.

share|improve this answer
"Financial data tends to be small relative to large web companies data"... yeah tell that to the 60 nasdaq TAQ dvds sitting on my desk right now (2010 data only). All compressed about 95%.Tick data and even 1 minute data on a large number of firms can be quite data expensive. Also if you are doing various calculations on various periods, the standardized columns of mysql might be overbearing, when you can simply add any fields you need to a NoSql document (Mongodb specifically). –  NoviceCoding Jan 31 '12 at 3:37
ITCH, and OpenBook ULTRA, PITCH, etc... would not be considered big by web company standards. OPRA is a big feed. 60 DVDs is just under 300 GB compressed which is tiny. There are plenty of reasons to use NoSQL for the reason you mention which is no schema. However it is unlikely that we will see (or should see) large scale (thousands of machines in an instance) NoSql deployments in finance because the data simply isn't that big. –  Steve Jan 31 '12 at 17:50
But would you say thats because of the fact that support/employees for NoSql are small? Or is it a NoSql infrastructural issue? For example mongodb has one of the easiest (from what I've read) sharding and replication mechanisms which make it very easy useful for multi machine expansion (one of the most mentioned resions to switch away from SQL to MongoDb). But I am saying this with only experience of starting a project I am working on in mongo (college student, no legit experience). –  NoviceCoding Jan 31 '12 at 18:50
What I am saying is that many of the problems that the NoSQL data bases from the web world (Mongo, BigTable, Dynamo, their clones, etc...) are trying to solve are not necessarily the same as you would find in the financial world. There are another set of stores mentioned in Dirk's answer that are probably a better fit for quant problems. Multi machine expansion is not free and is easier in a NoSQL database because most make less strict guarantees. Mongo is very fast at key lookup. It does not have the type of time series operators that it would need to be truly useful. –  Steve Jan 31 '12 at 19:40
Schema-less store is useful for storing client data. I've seen some tables with 148 columns, many of them null. For tick data, column oriented is the best model I've seen, and kdb+ the best product (primarily because of the language). –  Yike Lu Sep 19 '13 at 13:26

In the finance world, most data (especially given this forum is for Quant monkeys) is transactional and subject to regulatory reporting.

NoSQL isn't generally transactional and given the shape of, say, risk data, there is no overpowering reason to throw away ACID and RDBMS.

There are more mundane reasons: there are 1000s of IT guys who know RDBMS. When your NoSQL folk leave, where is your continuity and support?

I'm biased here: I'm an RDBMS database specialist who manages risk/pricing/trading systems

share|improve this answer
what about the times when you simply want to store and perform analysis on data. i'd argue that in this case going to RDBMS is slower. by the way i am not biased towards one or another. –  user697697 Jul 1 '11 at 19:28
In the finance world, most quants use column-oriented storage. This is particularly true for time-series data, like tick history. –  chrisaycock Jul 2 '11 at 3:38
@chrisaycock: based on my experience of Derivatives IT, they're all on conventional RDBMS. Or Excel. –  user1041 Jul 2 '11 at 9:09
based on my experience, the difference seems to be within people who make money with data, who uses advanced systems, and people who use client for data, who use good'ol technology.. –  nicolas Jul 9 '11 at 17:31
For those who advocate RDBMS for finance data, i wonder if we might consider what i believe to be a common calculation in backtesting. Can someone please explain me how to efficiently calculate, for example, a moving 24 hour standard deviation? Even if we calculate it at each minute end, it's my understanding that this turns out to be very expensive in RDBMS. Is NoSQL better for this? –  Yugmorf Aug 21 '13 at 3:09

mongodb seems to be a good opensource solution to store historical tick-by-tick. I am using it here and it seems to be very simple to use.

share|improve this answer
How about the analytics side of things? Any successes or gotchas you can report? –  chrisaycock Dec 13 '11 at 17:04
what can I say ! its well developed using boost and a modern c++ approach and yes ! It does what they said on they site. it is scalable and high-performance. even the transport protocol is fast and it is JSON based so the maintenance of the database is quite simple. And I am not doing merchandise but the guys did a good work. And even better you can use it to implement the publish–subscribe pattern +.+ –  Clebson Derivan Feb 27 '13 at 21:51
Am I the only one whose gut feeling is storing tick data in a document database is insane? How well does MongoDB compress taq data? Is there any implicit ordering you can rely on for time series queries? –  Chuu Feb 6 '14 at 14:29
I love mongoDB for a lot of things, use it daily. Tick data, at least any sizable dataset, wouldn't be something I'd throw at it. –  Zeb Dec 7 '14 at 19:17
MongoDB is a poor choice for tick data. You will have to index by ticker name and then retrieving large amounts (anything > 10-20000 ticks) will have to query the index for all the atomized bits of your data. Cassandra, which is a column store, is infinitely better suited. It stores data in a column family so all the ticks for a ticker on sequentially stored on disk. I have moved from Mongo to Cassandra for precisely this reason and have seen my range queries on tick data (usually 500k ticks approximately) increase in speed by 20x. –  Thomas Browne Aug 24 at 19:16

Cassandra is the obvious choice. With MongoDB or any RDBMS, you will hold all ticks in a table (collection in Mongo-speak) and index by ticker. This means that when you want to retrieve data for a ticker, the data will not be contiguously stored, and you will have a massive usage of index and random reads. Even with SSDs this is slow. For 500k ticks into Python from Mongo it takes me well over 200 seconds on a single 16GB SSD-equipped I7. Yes you can cluster, but the starting point is poor. Imagine if you need to bring in 100 tickers?

With Cassandra, everything is stored in column families. Big dicts of dicts, basically. You get entirely sequential storage of each ticker, meaning you can go back to spinning HDs if you want, but with SSDs it positively screams for data retrieval. I'm talking under 15 seconds for the same as the above. I'm not even going to go into the ease with which adding nodes to Cassandra speeds this up. The 15-second average is on a single computer. Lots of the "reasons for Cassandra" on the web talk about its easy scale-out using multiple nodes, and it's true this will make it even faster / safer, but for me this sequential columnar storage is what makes it perfect for finance. It starts out geared for timeseries, wherease Mongo does not. The design gives you at least an order of magnitude out-of-the-box before you even start messing with clusters and/or optimization. If you know Python, the analogy is simple. Cassandra is to Mongo (or an RDBMS) as Python lists are to Numpy. Chained pointers to scattered datapoints as opposed to a big chunk of contiguous data.

The converse of course is also true. If your use case is single (few) record(s) amongst millions (typical in web applications), Mongo makes this much easier than Cassandra. Cassandra is for big data, whereas Mongo/RDBMS map better to website-userID style workloads. Parodoxically, while SQL for example is considered quite rigid compared with "NoSQL", in my opinion, Cassandra is even more rigid than relational databases. But boy do you get performance if you accept its structures.

BTW Hbase is another columnar choice but I have no experience with it. The main message is, forget about RDBMS or "traditional" NoSQL. These are bad choices for multiple time series. What you want is a column database, of which Cassandra is an excellent example.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.