JanusGraph

Thu, 04 Aug 2022 17:50:31 GMT

Properties
Name Value
Identifier janusgraph
Name JanusGraph
Type Topic
Creation timestamp Thu, 04 Aug 2022 17:50:31 GMT
Modification timestamp Wed, 17 Aug 2022 08:02:33 GMT

Tags:  lpg

CAP Theorem

"Despite your best efforts, your system will experience enough faults that it will have to make a choice between reducing yield (i.e., stop answering requests) and reducing harvest (i.e., giving answers based on incomplete data). This decision should be based on business requirements." — Coda Hale

When using a database, the CAP theorem should be thoroughly considered (C=Consistency, A=Availability, P=Partition tolerance). JanusGraph is distributed with 3 supporting backends: Apache Cassandra, Apache HBase, and Oracle Berkeley DB Java Edition.

Apache HBase gives preference to consistency at the expense of yield, that is, the probability of completing a request. Cassandra gives preference to availability at the expense of harvest, that is, the completeness of the answer to the query (data available/complete data).

Using Python

from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from gremlin_python.process.anonymous_traversal_source import traversal

# The connection should be closed on shut down
# Close open connections with 'connection.close()'
connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')

# Reuse 'g' across the application
g = traversal().withRemote(connection)

hercules_age = g.V().has('name', 'hercules').values('age').next()
print(f"Hercules is {hercules_age} years old.")

Back to top

Current context