Overview

Brock is a simple proxy and response cache using Apache Geode. When interacting with an API, it's easy to get rate-limited if you don't cache your responses. Many APIs have static data that doesn't change much over time. However, it doesn't make sense to store that data in ephemeral application memory, and it also doesn't make sense to store it in a database as the data is always in flux.

This is where a read-through cache for can be very handy. Requests to the API can be routed through this cache, and the cache, using the path as a key, can manage when the data should be fetched again, preventing rate limiting.

How it works

This is where Geode comes in. Geode can serve as the backend for such a cache for many reasons including:

  • clustered -- it is able to scale linearly)
  • a key-value store -- keys are simply URLs
  • persistent -- this feature which memcached does not have allows loading old but relevant data from disk
  • concurrent -- much higher performance than Redis for high-throughput usage
  • redundant and atomic -- data is much harder to corrupt than a typical cache

What's next for Brock

  • Open-source for sure (after some code cleanup)
  • Maybe a hosted version on a SaaS model.... we'll see
  • Ports to other languages (definitely on the roadmap)

Built With

Share this project:
×

Updates