Re: Transaction Cache vs. DB Cache Questions


Boxuan Li
 

Hi Joe,

Vertex properties are indeed cached both in DB cache and transaction cache. If you check out https://docs.janusgraph.org/advanced-topics/data-model/, you will find that the doc says,

JanusGraph stores graphs in adjacency list format which means that a graph is stored as a collection of vertices with their adjacency list. The adjacency list of a vertex contains all of the vertex’s incident edges (and properties).

Thus, I believe the “adjacency lists” wording used in https://docs.janusgraph.org/basics/cache/ actually refers to vertices together with vertex properties (and of course, meta-properties), and edges (and of course, edge properties).

If you refactor your code and use multiple threads sharing a common transaction, then yes, the properties will be stored in transaction cache. That cache is not based on thread-local objects, so using multi-threading does not harm the cache here.

Regarding the performance, you may need to tune your configs, e.g. try increasing cache.db-cache-size, to reduce the chance of frequent cache eviction.

Best regards,
Boxuan

On Apr 29, 2021, at 2:02 PM, hadoopmarc@... wrote:

Hi Joe,

Good question and I do not know the answer. Indeed, the documentation suggests that the DB cache stores less information than the transaction cache, but it is not explicit about vertex properties. It is not explicit about vertex properties in the transaction cache either, but I cannot remember users having problems with missing vertex properties there.

TinkerPop/JanusGraph support multi-threaded transactions. When using these (maybe, you already suggested this in your final line), you are sure that vertices are available from the transaction cache, provided its configs match your traversal.

Best wishes,   Marc

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.