Database Management System (DBMS) / No SQL Databases

Document based stores

A Document Store is a type of NoSQL database that stores data in documents, usually in JSON, BSON, or XML format.

  • Each document represents a record.

  • Documents are self-contained, meaning they contain both the data and its structure.

  • Ideal for applications that deal with semi-structured or hierarchical data.


🧱 Structure Example (JSON Format):

{
  "_id": "user123",
  "name": "Swastika Kumari",
  "age": 21,
  "email": "swastika@example.com",
  "orders": [
    { "id": 101, "item": "Book", "price": 250 },
    { "id": 102, "item": "Bag", "price": 900 }
  ]
}

✅ No need for foreign keys or table joins — all relevant data can be embedded in one document.


📚 Popular Document Databases

Database

Key Features

MongoDB

Most popular, JSON/BSON-based, powerful query language

CouchDB

Uses JSON and HTTP for access; supports revision control

Firestore

Google’s NoSQL document store, great for real-time apps

RavenDB

ACID-compliant document DB with indexing and full-text search

Amazon DocumentDB

Managed MongoDB-compatible service


✅ Key Features

Feature

Description

📄 Schema-less

Each document can have a different structure

🧩 Embedded Data

No need for joins; related data stored together

🔄 Flexible Structure

Easy to change fields and types as app evolves

🧠 Rich Queries

Can query deeply nested fields using expressive syntax

🚀 High Performance

Optimized for reading and writing entire documents


🔍 Use Cases

Scenario

Reason

🛍️ E-commerce platforms

Products with varying attributes

📰 CMS / Blogging platforms

Posts, authors, tags, etc. in nested format

📱 Mobile/web apps

JSON-based APIs fit naturally

🎮 Game development

Player profiles, inventories, achievements

📊 IoT data

Semi-structured sensor data


📊 Advantages

Advantage

Description

📦 Natural data format

JSON aligns well with modern app development

📈 Horizontal scaling

Can shard data across servers

🧱 Denormalized structure

Faster read performance (no joins)

🚀 Rapid development

Easily evolve data without altering schemas

🔄 Nested data support

Allows complex, hierarchical structures


❌ Limitations

Limitation

Description

❌ Data redundancy

Duplicated data if not normalized

❌ Large document size

Can be inefficient if documents grow too big

❌ Limited joins

Some DBs don’t support joins or only allow simple ones

❌ Schema enforcement

Left to the application, not the DB


🆚 Relational vs Document Store (Quick Comparison)

Feature

RDBMS

Document Store

Schema

Fixed

Flexible / schema-less

Relationships

Foreign keys, joins

Embedded or referenced

Read performance

Joins needed

Single document read

Storage unit

Row

Document

Scaling

Vertical

Horizontal (sharding)


💡 Summary

Feature

Document Store

Format

JSON / BSON / XML

Schema

Schema-less or flexible

Ideal For

Nested, semi-structured data

Querying

Rich queries with deep nesting

Popular DBs

MongoDB, CouchDB, Firestore

Best Use Cases

CMS, e-commerce, APIs, IoT