Different Types of Databases
A. Caching Solutions
Requirements:
- Fast
- Key-Value Pairing
- Data persistence is not required (data loss is acceptable)
Best to use: Redis, MemCache, etcd
B. File Storage (Images, Videos)
Requirements:
- Ability to store large binary objects (Blob storage)
- No need for relational queries or joins on stored data
Best to use: Amazon S3
Note: Pair File-Storage with CDN for faster ascess
C. Text Searching
Requirements:
- Keyword-based search
- Autocomplete / prefix matching (e.g., ap → apple)
- Fuzzy search (handling typos like apjle → apple)
Best to use: Search-Engines like Elastic Search or Solr (Apache Lucene)
D. Metrics/ Time series data
Requirements:
- Optimized for time-based data
- Data written sequentially (append-only pattern)
- Queries typically involve time ranges and aggregations
- High write throughput & Time-based partitioning
Best to use: InfluxDb, TimeScaleDb
E. Big Data Analysis (Data Warehouse)
Requirements:
- Ability to store and process very large datasets (TBs–PBs), Fast Read Throughput.
- Optimized for analytical queries and aggregations
- Used mainly for offline reporting and business intelligence
- Supports
OLAP-style queriesover large datasets
Typical OLAP Questions
Examples companies ask:
"What was total revenue per country last year?"
"Which product category grew fastest?"
"What is average user session duration?"
"How many orders per hour?"
Best to use: Hadoop, Redshift, BigQuery, Snowflake
F. Sql
- Data is structured and follows a predefined schema.
- Requires strong transaction guarantees (ACID).
- Suitable for systems where
data consistency is critical. - Example: Banking Payment Systems
Best to use: Postgres, mySql
G. Document Db (NoSql)
- Data is
semi-structured (JSON-like documents). - Schema is flexible and can evolve easily.
- Documents may contain many attributes/fields that vary between records.
- Applications need to query and index these attributes efficiently.
- Example: User profiles, Product catalogs
Best to use: MonogoDb (Supports ACID), CouchBase
H. Columar Database (NoSql)
- Designed for very large datasets distributed across many machines.
- Data is typically append-heavy and continuously growing.
- Optimized for high write throughput and horizontal scaling.
- Queries often
access specific columnsacross large datasets.
Best to use: CassandraDb, Hbase
Summary
| Type | Best For | Read Throughput | Write Throughput | ACID / BASE | Examples |
|---|---|---|---|---|---|
| Cache | Fast temporary data, frequently accessed items | Very High | High | BASE | Redis, Memcached |
| Object Storage | Large files (images, videos, backups) | High | Medium | BASE | Amazon S3, Google Cloud Storage |
| Search Engine | Full-text search, autocomplete, fuzzy search | High | Medium | BASE | Elasticsearch, Solr |
| Time Series DB | Metrics, monitoring data, IoT telemetry | High | Very High (append-heavy) | BASE | InfluxDB, Prometheus |
| SQL (Relational DB) | Structured data with strong consistency and transactions | High | Medium | ACID | PostgreSQL, MySQL |
| Document DB | Flexible schema, JSON-like data, evolving structures | High | High | Mostly BASE (some ACID support) | MongoDB, Couchbase |
| Wide Column DB | Massive distributed datasets, high write scalability | Medium | Very High | BASE | Cassandra, HBase |
| Data Warehouse | Large-scale analytics and reporting (OLAP) | Very High (large scans) | Low–Medium | BASE | BigQuery, Redshift, Snowflake |