basis-company / sharding
Sharding framework
0.1.1
2025-05-23 12:05 UTC
Requires
- php: >=8.3
- doctrine/dbal: ^4.2
- nesbot/carbon: ^3.9
- psr/cache: ^2.0
- ramsey/uuid: ^4.7
- symfony/cache: ^7.2
- tarantool/mapper: ^6.4.5
Requires (Dev)
- phpunit/phpunit: ^12
This package is auto-updated.
Last update: 2025-05-23 12:06:07 UTC
README
Overview
Sharding is a php library designed to handle domain data that is split into segments, where each segment represents a collection of entities. The library provides mechanisms for persisting these segments across distributed storage systems using a bucket-based approach.
Check out the documentation or tests
folder.
Key Concepts
Domain Segmentation
- The domain is divided into logical segments, each containing a collection of entities
- Segments allow for horizontal partitioning of data
Persistence Model
- Segment persistence is achieved through buckets
- Buckets are distributed across multiple storage backends
- Provides fault tolerance and scalability
- We assume that each storage node (or database instance) contains at most one logical bucket (shard). This means:
- No need to store a
bucket_id
(or shard key) in the data records—since the storage location itself implies the bucket. - Sharding is storage-aware: The system routes requests based on the physical/logical storage, not an attribute in the data.
- No need to store a
Features
- Shard management: Easily create and manage data shards
- Bucket distribution: Automatic distribution of buckets across storage systems
- Entity operations: CRUD operations for entities within segments
- Storage abstraction: Support for multiple storage backends
- Scalability: Designed to handle large-scale data distribution
Installation
composer require basis-company/sharding