0
0
HLDsystem_design~12 mins

NoSQL database types (document, key-value, column, graph) in HLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - NoSQL database types (document, key-value, column, graph)

This system explains the four main types of NoSQL databases: document, key-value, column, and graph. Each type stores and manages data differently to suit various application needs like flexibility, speed, or complex relationships.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  +-------------------------------+-------------------------------+-------------------------------+-------------------------------+
  |                               |                               |                               |                               |
Document DB Service          Key-Value DB Service            Column DB Service              Graph DB Service
  |                               |                               |                               |
  v                               v                               v                               v
Document DB                  Key-Value DB                  Column DB                      Graph DB
  |                               |                               |                               |
Cache (optional)             Cache (optional)             Cache (optional)             Cache (optional)
Components
Load Balancer
load_balancer
Distributes incoming requests evenly to API Gateway for reliability and scalability.
API Gateway
api_gateway
Routes requests to the correct NoSQL database service based on request type.
Document DB Service
service
Handles requests for document-oriented NoSQL database operations.
Key-Value DB Service
service
Handles requests for key-value store NoSQL database operations.
Column DB Service
service
Handles requests for column-family NoSQL database operations.
Graph DB Service
service
Handles requests for graph NoSQL database operations.
Document DB
database
Stores data as JSON-like documents for flexible schema.
Key-Value DB
database
Stores data as simple key-value pairs for fast lookups.
Column DB
database
Stores data in columns for efficient queries on large datasets.
Graph DB
database
Stores data as nodes and edges to represent relationships.
Cache (optional)
cache
Speeds up read operations by storing frequently accessed data.
Request Flow - 9 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayAppropriate DB Service (Document/Key-Value/Column/Graph)
DB ServiceCache (optional)
Cache (optional)DB Service
DB ServiceCache (optional)
DB ServiceAPI Gateway
API GatewayLoad Balancer
Load BalancerUser
Failure Scenario
Component Fails:Cache
Impact:Cache misses increase, causing more direct database queries and higher latency.
Mitigation:System continues to operate by querying the database directly; cache can be rebuilt over time.
Architecture Quiz - 3 Questions
Test your understanding
Which component decides which NoSQL database type to use for a request?
ALoad Balancer
BAPI Gateway
CCache
DDatabase
Design Principle
This architecture shows how different NoSQL database types can be integrated behind a unified API Gateway. It uses a Load Balancer for scalability and optional caching to improve read performance. Each database type serves a specific data model need, enabling flexible and efficient data storage.