Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/692e1a61-9f08-800b-89a7-b2d4c506df31
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== 2. Key benefits vs traditional SQL/relational DB ==== ===== A. Horizontal scalability and high throughput ===== Relational DBs (PostgreSQL, MySQL, SQL Server) can scale vertically (bigger box) reasonably well, and can do some read scaling with replicas. But at very high scale, sharding relational data is complex. Many NoSQL systems are designed from the ground up to: * Distribute data across many nodes (“sharding”) automatically * Add capacity by adding more servers (scale-out, not just scale-up) * Handle very high write and read throughput with predictable latency Example: A high-traffic web app with millions of users and huge write rates (logging, clickstream, IoT signals) may find it much easier to meet throughput/latency requirements with a distributed NoSQL store than with a single relational instance. ===== B. Flexible schema (schema-less or schema-light) ===== Relational DBs: * Require a predefined schema: tables, columns, constraints * Schema changes (ALTER TABLE) can be painful in large production systems * Encourage normalized data, which is great for consistency and analytics but can be awkward for constantly changing, nested structures NoSQL (especially document and key-value stores): * Store data as JSON-like documents or arbitrary blobs * Different records can have different fields * You can evolve your data model without a migration that locks a table This is valuable when: * The product/domain is changing rapidly * You have semi-structured data or many “optional” fields * You’re ingesting data from varied external sources with different shapes ===== C. Data models closer to the application domain ===== Relational: * Typically normalize into multiple tables and join them * Application often has to assemble domain objects from rows across tables NoSQL: * Document stores: one document can represent an entire aggregate/object with nested sub-documents and arrays (e.g., a User with addresses, preferences, sessions) * Wide-column: optimized for specific query patterns (e.g., time-series by user) * Graph: optimized for entities and relationships, traversals, shortest paths, etc. This can: * Simplify application code (fewer joins) * Improve performance (data for one request is often in one document/partition) * Make some queries far more natural (graph traversals vs multi-join SQL) ===== D. Availability and partition tolerance (CAP trade-offs) ===== Many NoSQL databases are designed around AP or tunable consistency models in the CAP theorem sense: * Highly available even during network partitions * Often accept eventual consistency or tunable consistency (read-your-writes, quorum reads/writes, etc.) * Automatic replication and fault tolerance are core design features Relational DBs can be highly available too (HA clusters, replication, etc.), but NoSQL systems often: * Make cross-region distribution, replication, and failover more “built in” * Offer stronger guarantees about durability and availability in massive distributed deployments ===== E. High write and read performance for certain workloads ===== Because NoSQL DBs are often optimized for specific access patterns and may relax some constraints (e.g., ACID transactions across arbitrary tables), they can: * Handle huge write loads (log ingestion, metrics, telemetry) * Serve large volumes of simple reads with low latency * Optimize storage layout (append-only, LSM trees, columnar layouts, etc.) for those workloads Relational DBs can also be very fast and are often more than enough, but at extreme scale or with specific workloads, NoSQL can deliver better performance per dollar.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)