Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharding adapter #20

Merged
merged 5 commits into from
Sep 26, 2022
Merged

Sharding adapter #20

merged 5 commits into from
Sep 26, 2022

Conversation

eldadfux
Copy link
Member

@eldadfux eldadfux commented Sep 25, 2022

The Sharding adapter allows to shard cache across multiple adapters in a consistent way. Using sharding we can increase cache size and balance the read and write load between multiple adapters.

Each cache key will be hashed and the hash will be used to determine which adapter to use for fetching or storing this key. Only one adapter will always match a specific key unless a new adapter is added to the pool.

When adding a new adapter to the pool, cached will gradually get re-distributed to fill the new adapter, this might cause a significant drop in hit-rate for a short period of time.

@eldadfux eldadfux marked this pull request as ready for review September 25, 2022 19:57
.travis.yml Outdated Show resolved Hide resolved
src/Cache/Adapter/Sharding.php Outdated Show resolved Hide resolved
src/Cache/Adapter/Sharding.php Outdated Show resolved Hide resolved
src/Cache/Adapter/Sharding.php Outdated Show resolved Hide resolved
src/Cache/Adapter/Sharding.php Outdated Show resolved Hide resolved
src/Cache/Adapter/Sharding.php Outdated Show resolved Hide resolved
@eldadfux
Copy link
Member Author

@TorstenDittmann great review! Addressed all comments!

@eldadfux eldadfux merged commit 47fbc4e into master Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants