JanusGraph / JanusGraph/janusgraph

Centralized Redis cache

Open
#3,018 3 comments 2 reactions 0 assignees View on GitHub
area/core kind/enhancement kind/performance
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

**Describe the feature:**
In a multi node Janusgraph cluster, data modification done from one instance does not sync with others until it reaches the given expiry time (cache.db-cache-time)

As per the documentation[1] it does not recommends to enable database level cache in a distributed setup as cached data does not share amoung instances.

Once we enable the db.cache, what ever the modification done for particular vertex only visible for that JG instance untill the cache expires. So if we have multiple JG instances, the modifications done from one instance does not reflect on other immediately.

If we can have centralized cache which syncs up with all JG instances this can be avoided.

**Describe a specific use case for the feature:**

We were able to overcome sync issue on multiple JG instance after doing modifications on void invalidate(StaticBuffer key, List entries) as suggested on here [2]

I have replaced existing guava cache implementation to connect with remote Redis db. So that Redis DB will be act as centralized cache which can connects with all other JG instances.

I would like to contribute my implementation to community. Please guide.

**NOTE -** Although cache sync between JG instances happens on real time, it can expect slight delays due to network latencies and redis performance. So this implemented Redis cache approach will **compromise the DB consistancy**.

[1] https://docs.janusgraph.org/operations/cache/#cache-expiration-time
[2] https://lists.lfaidata.foundation/g/janusgraph-users/topic/88877425

Contributor guide

Open the contributing guide

Research direction

Start with the existing Guava cache and the `void invalidate(StaticBuffer key, List entries)` path described in the issue, then review the cache-expiration documentation and linked discussion. Before implementation, define how Redis coordination and consistency trade-offs should work across JanusGraph nodes; done requires an agreed feature scope and validation plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.