Repository navigation
feat: cache raw per-scope bags in front of database layers (phase 3) - #9
Merged
Merged
Conversation
Add CachingDriver and SettingsCache: each scope's rows are cached under a hashed key of connection, database, tenant, store, table and scope, and invalidated by replacing ULID generation tokens (scope, store, epoch) after every write commits, so a Cache::flexible() refresh can never restore an invalidated value. Misses are cached as empty bags; reads inside a transaction or while bootstrap skips the layer go to the database; a failing cache falls back and is logged. Add laranail::settings.warm and .clear-cache, clearCache()/warmCache() on a handle (manage_stores, audited), the cache.* config keys, a phpbench read benchmark (composer bench), and docs. Mutation testing now runs weekly and on dispatch only, not on pull requests.
phpbench requires doctrine/annotations, which Packagist marks abandoned, so composer audit failed. phpbench now installs into tools/phpbench/ on the first composer bench, and the package's own dependency tree and audit stay clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3 of the settings design: caching.
CachingDriver+SettingsCachecache each scope's raw rows under a hashed key of connection, database, tenant, store, table and scope. ULID generation tokens (scope, store, global epoch) are replaced after every write commits, so aCache::flexible()stale-while-revalidate refresh can never restore an invalidated value. Misses are cached as empty bags.laranail::settings.warmandlaranail::settings.clear-cache, pluswarmCache()/clearCache()on a handle (gated bymanage_stores, audited).cache.*config (enabledtrue, app default store,ttl3600,stale300).composer bench): ten keys through owner → team → global per request — uncached 3.81 ms / 10 queries, cold 2.22 ms / 1 query, warm 2.08 ms / 0 queries (array store).Checks run locally
memory_limit=2Glocally to write the report); mutation of the changed files 75.12 %