Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Key-Value Stores vs. RDBMs vs. "Cloud" DBs (SDB) [closed]

I'm comfortable in the MySQL space having designed several apps over the past few years, and then continuously refining performance and scalability aspects. I also have some experience working with memcached to provide application side speed-ups on frequently queried result sets. And recently I implemented the Amazon SDB as my primary "database" for an ecommerce experiment.

To oversimplify, a quick justification I went through in my mind for using the SDB service was that using a schema-less database structure would allow me to focus on the logical problem of my project and rapidly accumulate content in my data-store. That is, don't worry about setting up and normalize all possible permutations of a product's attributes before hand; simply start loading in the products and the SDB will simply remember everything that is available.

Now that I have managed to get through the first few iterations of my project and I need to setup simple interfaces to the data, I am running to issues that I had taken for granted working with MySQL. Ex: grouping in select statements and limit syntax to query "items 50 to 100". The ease advantage I gained using schema free architecture of SDB, I lost to a performance hit of querying/looping a resultset with just over 1800 items.

Now I'm reading about projects like Tokyo Cabinet that are extending the concept of in-memory key-value stores to provide pseudo-relational functionality at ridiculously faster speeds (14x i read somewhere).

My question: Are there some rudimentary guidelines or heuristics that I as an application designer/developer can go through to evaluate which DB tech is the most appropriate at each stage of my project.

Ex: At a prototyping stage where logical/technical unknowns of the application make data structure fluid: use SDB. At a more mature stage where user deliverables are a priority, use traditional tools where you don't have to spend dev time writing sorting, grouping or pagination logic.

Practical experience with these tools would be very much appreciated.

Thanks SO!

Shaheeb R.

like image 713
Shaheeb Roshan Avatar asked Mar 13 '09 16:03

Shaheeb Roshan


People also ask

Which two write operations are allowed on key-value store data?

There are three operations performed on a key-value store: put, get, and delete. put adds a new key-value pair to the table or updates a value if this key is already present. get returns the value for a given key if it exists. delete removes a key and its value from the table if it exists.

Is NoSQL a key-value store?

The key-value store is one of the least complex types of NoSQL databases. This is precisely what makes this model so attractive. It uses very simple functions to store, get and remove data. Apart from those main functions, key-value store databases do not have querying language.

What is the difference between a relational model and a key-value data model?

In contrast to relational databases, which define a data structure made up of tables of rows and columns with predefined data types, key-value databases store data as a single collection without any structure or relation.

Is InfluxDB a key-value database?

The key-value pair in an InfluxDB data structure that records metadata and the actual data value. Fields are required in InfluxDB data structures and they are not indexed - queries on field values scan all points that match the specified time range and, as a result, are not performant relative to tags.


1 Answers

The problems you are finding are why RDBMS specialists view some of the alternative systems with a jaundiced eye. Yes, the alternative systems handle certain specific requirements extremely fast, but as soon as you want to do something else with the same data, the fleetest suddenly becomes the laggard. By contrast, an RDBMS typically manages the variations with greater aplomb; it may not be quite as fast as the fleetest for the specialized workload which the fleetest is micro-optimized to handle, but it seldom deteriorates as fast when called upon to deal with other queries.

like image 184
Jonathan Leffler Avatar answered Sep 21 '22 11:09

Jonathan Leffler