I’m versed enough in SQL and RDBMS that I can put things in the third normal form with relative ease. But the meta seems to be NoSQL. Backends often don’t even provide a SQL interface.
So, as far as I know, NoSQL is essentially a collection of files, usually JSON, paired with some querying capacity.
- What problem is it trying to solve?
- What advantages over traditional RDBMS?
- Where are its weaknesses?
- Can I make queries with complex WHERE clauses?
Let me see if I got it. It would be like a denormalized table with a flexible number of columns? So instead of multiple rows for a single primary key, you have one row (the file), whose structure is variable, so you don’t need to traverse other tables or rows to gather/change/delete the data.
The downsides are the usual downsides of a denormalized DB.
Am I close?
Pretty much. The advantage is not really the unstructeredness per se, but simply the speed at which you can get a single record and the throughput in how much you can write. It’s essentially sacrificing some of the guarantees of ACID in return for parallelization/speed.
Like when you have a million devices who each send you their GPS position once a second. Possible with RDBS but the larger your table gets, the harder it’ll be to get good insertion/retrieval speeds, you’d need to do a lot of tuning and would essentially end up at something like a NoSQL database effectively.
Yes. You can also have fields that weren’t defined when you created the “table”.
With something like Elasticsearch you also have tokenisation of text which obviously compresses it. If it’s logs (or similar) then you also only have a limited number of unique tokens which is nice. And you can do very fast text search. And everything is set up for other things like tf-idf.
Rather than try to relate it to an rdbms, think of it as a distributed hash map/associative array.
What I’m hearing is that they’re very different beasts for very different applications. A typical web app would likely need both.
Yup. And this right here is where I dismiss people that generally say you only need one or the other. Each has a specific advantage and use case and you’ll have the best performance when you choose the “right tool for the job” and don’t just attempt to shoehorn everything into a single solution
Hold a sec. Rolling your own RDBMS out of a NoSQL database is insane. But is the opposite feasible? Wouldn’t it be a simple table with two columns: a key and a JSON blob?
Could you do it? Yes, but it’s not something that it’s optimized to do. NoSQL engines are designed to deal with key value pairs much better than an RDBMS. Again, best tool for the job.
Got it, thanks.