Advanced Sharding & Replication
VortexDB is designed for horizontal scalability. This document explains how to use sharding and replication to distribute your data across multiple nodes for high availability and performance.
Sharding
VortexDB supports automatic sharding, which partitions your data across multiple servers. This allows you to scale your database horizontally as your data grows.
Sharding Strategies
Strategy | Best For | Example |
---|---|---|
Range | Sequential data | Time-series |
Hash | Even distribution | User data |
List | Discrete values | Geographic |
- Range Sharding: Data is distributed based on a range of values in a sharding key.
- Hash Sharding: Data is distributed based on a hash of the sharding key, ensuring even distribution.
- List Sharding: Data is distributed based on a predefined list of values in the sharding key.
Benefits of Sharding
- Horizontal Scalability: Distribute data and workload across multiple servers.
- Improved Performance: Parallel processing of queries across shards.
- Increased Storage Capacity: Store larger datasets than a single server can handle.
Replication
VortexDB uses a primary-replica replication model to ensure high availability. If the primary node fails, one of the replicas is automatically promoted to primary, ensuring that your application remains available.
Replication Modes
- Synchronous Replication: Ensures that data is written to all replicas before a transaction is committed, providing strong consistency.
- Asynchronous Replication: Data is replicated with a slight delay, offering lower latency but eventual consistency.
Disaster Recovery
Replication is a critical component of disaster recovery. By maintaining multiple copies of your data across different nodes or data centers, you can ensure business continuity in case of a failure.
Read Scalability
Replicas can also be used to offload read traffic from the primary node, improving read performance and overall system throughput.