[EVE-35] Caching aggregates to avoid repeated loads
See original GitHub issueProposal:
- Place the loaded aggregate instance in a cache
- When getting a command for that instance, get it from the cache instead of loading it from the stream
- Check the stream revision
- If it’s higher, read the stream tail
It can be done in a composable version of the AggregateStore
.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Issues · Eventuous/eventuous
Npgsql.PostgresException: 23505: duplicate key value violates unique ... [EVE-35] Caching aggregates to avoid repeated loads linear Sync the issue to Linear ...
Read more >Optimizing Aggregate Loading - Axon Reference Guide
For true optimization, caches should keep data in-memory (and preferably on-heap) for best performance. This prevents the need to (re)serialize aggregates when ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
#218 , #219 and #220 together add implicit support for IMemoryCache (if injected). I’ve only been able to run the basic tests, but the changes are also very basic… 😃
Tests in my own application indicate that more than 10 times as many (basic) commands can be processed in 1 second than without caching. With longer intervals, the difference should be exponentially better.
I’ve ignored composability, but I’ll look into it next - use of IMemoryCache must at least be optional.
As I am currently working on subscriptions (split of physical subscription and consumer pipeline), it is now up for grabs. It’s relatively straightforward, and I think the good first step would be to add it at the lowest level (read of stream in the event reader). Composition would work there nicely.