1

I want to add a cache layer at the rest API endpoint to reduce the latency and increase the throughput.

Steve Hu
  • 358
  • 2
  • 10

1 Answers1

1

If you are using Kafka Streams, then the local in-memory key/value store or RocksDB key/value store is pretty fast to cache any event sourcing aggregates/projections. RocksDB also gives us an option to cache a huge amount of data on the local drive for the service. If you are looking for the local in-memory cache for the traditional database, then https://github.com/ben-manes/caffeine is very good. For the distributed cache, we are using Hazelcast community edition which is free. It is a little bit tricky to set it up with Kubernetes though.

Steve Hu
  • 358
  • 2
  • 10
  • Also Redis is a great key/value store. Its a #1 in its segment: https://db-engines.com/en/ranking/key-value+store (while RocksDB is #16 in ratings). See comparison: https://db-engines.com/en/system/Redis%3BRocksDB – user1697575 Mar 28 '19 at 02:35
  • 1
    Yes. I forgot to mention Redis. We support Redis for distributed session management in light-session-4j. https://github.com/networknt/light-session-4j – Steve Hu Mar 28 '19 at 13:57