Database Reference
In-Depth Information
Cassandra
HBase
BerkeleyDB
Persistit
Support for multiple NoSQL data stores allows adopting the right one based on ap-
plication requirements. In other words, you can select specific technology for specific
needs. Based on the CAP theorem we may opt for any one of the supported databases.
With Titan we can configure backend storage on the fly using the stor-
age.backend option. Examples in this chapter will cover how to use this option
with Cassandra.
Transaction Handling
Titan is a transactional graph database; hence every read/write operation would happen
in a transaction boundary.
The following code snippet shows Titan wrap the vertex mevivs in a transaction
boundary and commit it:
TitanGraph g = TitanFactory.open("/home/vivek/Titan");
Vertex mevivs = g.addVertex(null); //Implicitly wraps
within transaction
mevivs.setProperty("fname", "vivek");
g.commit(); //Commits transaction
In cases with very large volume and a polyglot nature, permanent or temporary fail-
ures may happen. Here temporary failures are situations such as network failure, nodes
not responding, and similar scenarios. In such scenarios we can configure the retry
delay property with Titan like this:
Configuration conf = new BaseConfiguration();
conf.setProperty("storage.attempt-wait ",250); // time in
milliseconds
Such temporary failure can be handled with retries, but permanent failure, like
hardware failure, would require the user to explicitly handle TitanException :
Search WWH ::




Custom Search