Choosing Right Database for Application

This article give brief intro to different type of databases that that are available in Market with Sample Use cases. Choosing right database for application is one of the most important decision to make. This comparison can help to chose the right database for the job.
Following different types of databases are evaluated in this post.
Database Types
- Key Value
- Wide Column
- Document
- Relational
- Graph
- Search Engine
1. Key Value Database

- What is key values database?
- Simplest of NoSQL databases
- No SQL type queries and Joins are available for these databases
- key value databases utilize a single main identifier “Key” and associate that with a data point, array of data, or blob—a “value”
- Data can only be queried by passing Key using “Get” command e.g. Get user:24:bio
- Key names can be URI, hashes, filenames, or anything else that is entirely unique from other keys
- These databases are Simple and lightweight
- Built for speed as data is kept in-memory
- Data type-agnostic
(Data Agnostic: if the method or format of data transmission is irrelevant to the device or program’s function. This means that the device or program can receive data in multiple formats or from multiple sources but still process that data effectively)
- Popular Database
- Why use key values database?
- When your application needs to handle lots of small continuous reads and writes, that may be volatile. Key-value databases offer fast in-memory access.
- Optimal for situations requiring low latency and lower operational demand than a relational database
- For applications that don’t require frequent updates or need to support complex queries
- Sample Use Case
- E-commerce shopping carts — work best for temporary, lightweight listings, which makes them perfect for storing customer shopping carts while they order products online.
- Online session information — Key value databases make it simple to track and store activity information, including which pages were accessed, on-page actions a user took, and more.
- Use as Cache – Good option for the information that is access very frequently but updated less often. These databases can be used on top of other persistent data layer as a cache.
2. Wide Column Database
- What is Wide Column Database?
- NoSQL database that organizes data storage into flexible columns that can be spread across multiple servers or database nodes.
- NoSQL database in which the names and format of the columns can vary across rows, even within the same table.
- Also known as column family databases. Because data is stored in columns, queries for a particular value in a column are very fast, as the entire column can be loaded and searched quickly. Related columns can be modeled as part of the same column family.
- CQL is used as Query Language. Joins are not available.
- Decentralized and Scale Horizontally
- In Wide Column DB, Outer Layer is Key Space, which hold one or more Column Families. Each Column Family holds set of ordered rows, due to which related data is grouped together.
- Popular Database
- Why Use Wide Column Database?
- High volume of data
- Extreme write speeds with relatively less velocity reads
- Data extraction by columns using row keys
- Sample Use Case
- Log data
- IoT (Internet of Things) sensor data
- Time-series data, such as temperature monitoring or financial trading data
- Attribute-based data, such as user preferences or equipment features
- Real-time analytics
- Geographic data
3. Document Database
- What is Document Database?
- In this type of Database we have Documents
- Document is a container for Key Value Pairs
- Documents are Unstructured and Don’t require Schema
- Document are grouped together in Collections
- Fields in a Collection Can be indexed and Collections can be organized in logic hierarchies
- Don’t Support join. This type of DB encourage to embed related data together in same document in de-normalized format
- Reads from front end application are faster but write/update operations are complex due to embedded data
- Popular Database
- Mongo DB
- Dynamo DB
- Firestore
- Why Use Document Database?
- Your data schema is subject to frequent changes
- When we don’t know how schema is going to evolve in future
- When the amount of data in many applications cannot be served affordably by a SQL database
- Sample Use Case
- Mobile Games
- IOT
- Web Application Data
4. Relational Database

- What is Relational Database?
- Data is stored in Structures called Tables. Table stores data in Rows and Columns
- Tables Required Pre Defined Schema in these databases
- ACID (Atomicity, Consistency, Isolation and Durability) compliant. Data validity is guaranteed.
- Support SQL (Structured Query Language) Language
- Support Joins between Different Tables
- Popular Database
- My SQL
- Microsoft SQL Server
- Oracle
- Sample Use Case
- Online transaction processing (Well suited for OLTP apps because they support the ability to insert, update or delete small amounts of data; they accommodate a large number of users; and they support frequent queries)
- IoT solutions (Relational databases can offer the small footprint that is needed for an IoT workload, with the ability to be embedded into gateway devices and to manage time series data generated by IoT devices)
- Data warehouses (Relational databases can be optimized for OLAP (online analytical processing) where historical data is analyzed for business intelligence)
5. Graph Database

- What is Graph Database?
- Database designed to treat the relationships between data as equally important to the data itself. Relationships are stored alongside data in model
- Use Cypher Query Language that is very similar to SQL language. As Joins are already stored with Data, due to this cypher queries are very precise
- Natively handles Many to Many Relations between data
- Can Traverse millions of connections per second per core
- Popular Database
- Neo4j (see Neo4j Desktop free to get started)
- Dgraph
- Sample Use Case
- Fraud Detection
- Recommendation Engine
- Network and Database Infrastructure Monitoring
- Master Data Management
- Social Media and Network Graph
6. Search Engine Database

- What is Search Engine Database?
- Nonrelational database that is dedicated to the search of data content
- Work very similar to Document oriented database. These database under the hood analyze the data and create index of searchable terms
- Index Terms are automatically ranked and can handle typos while search is performed on data
- Popular Database
- Elastic Search
- Solr
- Algolia
- Meilisearch
- Sample Use Case
- Text search
- Logging and analysis
3 thoughts on “Databases”