top | item 1378663

What is NoSQL?

13 points| qq66 | 16 years ago

I've tried to read up on NoSQL because I hear so much about it, but I can't really seem to find a synthesis that uses terminology I can understand. What is a relational data store as opposed to a non-relational data store? What advantages does NoSQL confer and how does it achieve those?

8 comments

order
[+] jwegan|16 years ago|reply
NoSQL is basically a hash table. They are much faster than relational databases since hash table lookups are quick O(1). However they don't provide the ability to query the database like you can in SQL. For example, you cannot select all the items whose price is > $20 unless you iterate through every item in the NoSQL store yourself and check if the price is > $20.

So why would you use NoSQL rather than just our own hashtable? NoSQL allows you to keep a hash table separate from the application server so you can devote an entire servers RAM to the table to increase performance. It also allows you to distribute the table across multiple machines to in essence create a big distributed hashtable. NoSQL is great replacement for any type of data that you would have previously accessed by doing a "SELECT * FROM table WHERE primary_key = ?". Furthermore since NoSQL doesn't have to do indexing, or any of the other overhead associated with a normal relational database it can be much faster.

[+] cubes|16 years ago|reply
This is not really accurate. Some NoSQL solutions, such as Memcached, MemcacheDB, and REDIS are key-value stores, i.e. hash tables.

Other solutions, such as Cassandra, MongoDB, and CouchDB provide richer semantics that make it possible to perform efficient range queries and map-reduce queries. Cassandra and MongoDB both use indices to improve query performance.

One of the primary advantages of the various NoSQL solutions is that they make it easy to scale horizontally, i.e. to add capacity by simply adding another host machine. This is in contrast to traditional relational databases, which are typically hard to scale horizontally.

[+] qq66|16 years ago|reply
Thanks. So when they say Facebook messages use NoSQL, how do they show you all messages WHERE recipient=you if these queries are expensive?
[+] maxdemarzi|16 years ago|reply
NOSQL stands for Not Only SQL. It is a label that is being applied to data stores that provide alternatives to the standard SQL based relational databases.

These alternative data stores can be a better match for the domain model, volume, and usability of the application data.

[+] dstainer|16 years ago|reply
Just to repeat what others have already said. NoSQL is basically any data store that is not relational. So it describes data stores that are key/value pair, document, object, graph and column store just to name a few.

Basically a number of these solutions were created to address the scalability issues that companies faced when trying to scale at extreme levels, think Facebook and Twitter. Anyway, it's a really interesting topic, at least to me.

Derek

http://nosqldatabases.com

[+] KERMIT|16 years ago|reply
Well, "Cloud Computing" became pretty widely know. After some people tried to actually use it seriously, they found out that it's actually quite shitty, and nothing but marketing blabber. This forced the marketing and hype folks to find something new to drivel on about. Behold, NoSQL.