What are the factors which make RavenDb (as an example of NoSQL document database) more efficient in comparison to relational databases?
I know two factors:
- All queries are executed on indexes. But you can do it in RDBMS
- Indexes are updated on background threads (causing
missynchronization). Yep, it is a good point but I doubt it is very
significant.
Actually I thought the biggest performance boost is absense of joins but looks like Multi Maps / Reduce Index is pretty similar to join.
So what factors do make RavenDb more efficient?
Idsa,
There are several reasons why you would typically see a RavenDB application much faster than a Relational DB application.
a) As Daniel mentioned, the difference in data modeling is significant. It means that you can load the data in a much cheaper way.
b) You always query on indexes. That is important, because it means that the query plan for RavenDB is always an INDEX_SEEK. Sure, you can try doing that using RDBMS, but in many cases, you don’t always hit an index. In particular, you usually have to do a lot more work to get there, and then you have to use joins and other stuff to get the data out, which again complicates the query plan.
c) RavenDB will work behind the scenes to optimize itself on your behalf. The more you use it, the more it will optimize itself to your usage pattern.
d) You never do any computation whatsoever during the queries. That is critical, because it means that things like aggregation queries, for example, are already precomputed, so they are really cheap.