4 ms·
I am always wondering why no-sql has better performance than SQL if we have same simple use case (no join etc.). If the data is well structured and no join is
by guilloche 14y ago
I am always wondering why no-sql has better performance than SQL if we have same simple use case (no join etc.).
If the data is well structured and no join is needed, can I assume that relational database should have better performance than no-SQL?
- lucian1900 14y agoDepends what you mean by "NoSQL". MongoDB is pretty terrible overall, so don't even bother. Systems like Dynamo/Riak/Cassandra sacrifice consistency (most of the time) for performance, largely because a distributed setup (sharding in particular) is easier when you don't guarantee consistency. Note that none of them sacrifice durability. It is possible to have a distributed and consistent database, but you either have a bottleneck (master nodes in BigTable/HBase), require significant infrastructure (Google Spanner) or make schema changes very hard (Hyperdex). It's a hard problem.
- guilloche 14y agoThanks for your reply. But I have one more question, if I need to manage bank account, then the database must be consistent. Lets say that I just need to keep balance and social security number for the account, and only need to query the balance. Can No-SQL like redis have better performance than relational database? (assume same on logs and transactions).
- lucian1900 14y agoRedis is consistent, it's just less durable than Postgres. A query cache is a very good usage for it. It's also likely to be faster than Postgres for the simple operations it is capable of. The only downside is that (for now at least) it is single node, with optional replica slave(s).