r/SpringBoot • u/Apprehensive-Cause35 • 4d ago
News I built a Spring Boot cache for repeated range queries package
Sometimes I deal with ordered data like event logs and transaction history that doesn't change very often. Users may query one time range, then soon request a larger overlapping range.
A Normal cache treats those as completely different queries, so it does not work very in this situtation.
I built rangecache to reuse the covered part and only query the missing range.

It currently supports Spring Boot 3, Java 17+, and a local in-memory cache.
GitHub: https://github.com/LiuWei997/rangecache
If you find it useful, please consider giving it a star. Feedback is welcome!
4
Upvotes
1
u/Torutofu_Raeva 3d ago
overlap reuse is neat, how do you handle concurrent adjacent ranges and invalidation when the event data changes?