4 Type of NoSQL databases: document-oriented, key-value store, column-based store, and graph-based store. They are optimized for heavy write workload and heavy read workload on a large scale with built-in capabilities, key features as Performance, horizontal Scalability, replication, clustering.
1. Types of NoSQL databases
The NoSQL (not only SQL) databases are primarily categorized on the basis of how the data is stored.
There are 4 basic types of NOSQL databases as:
- Key-Value Store: It has a Big Hash Table of keys & values e.g. Redis, Riak, Amazon S3. It is straight forward key value pair , used for fully baked content primarily for caching mechanism. you can query on key , not on value in order to get the value extremely faster.
- Document-based Store: It stores documents made up of tagged elements. e.g mongoDB, CouchDB,
- Column-based Store: Each storage block contains data from only one column e.g. HBase, Cassandra
- Graph-based: A network database that uses edges and nodes to represent and store data e.g. Neo4J
2. Key Value Store NoSQL Database
There is no complexity around the Key Value Store database model. The key value type store, uses a hash table in which there exists a unique key and a pointer to a particular item of data. A bucket is a logical group of keys – but they don’t physically group the data. There can be identical keys in different buckets.
Performance enhanced to a great degree because of the cache mechanisms. To read a value you need to know both the key and the bucket because the real key is a hash.
If you referring CAP theorem, it is quite clear, key-value stores are around the Availability and Partition but definitely lack of Consistency.
Query (to pull the data for the key) can be on the only key, not on value, this is the disadvantage of key-value store.
3. Few examples of Key Value store NoSQL
Although there are a number of key-value store but few famous as: Amazon’s DynamoDB , Redis, Riak , memcacheDB
Redis: Key-value store database
– written in C with approx 13 k+ lines of code
– socket API: redis-cli, a client library for all major languages
– In memory based key-value database.
Features of Redis:
– high read & write throughput e.g. 50 K to 1 Lac ops/second
– interesting data structure: list, hashes, sorted set, atomic operation.
– strong consistency
– in-memory database: appended-only log on disk with virtual memory.
– support master-slave replication.
– “Memory is the new , disk is the new tape” – Jim Gray