I'm looking into how to replicate the Titan 1.0.0 database backed by DynamoDB. Normal cross-region replication for DynamoDB can be done through DynamoDB Streams and Lambda, so I wanted to do the same for the Titan tables that are generated on start up.
Step by step process of what I did:
- Started up a Gremlin server on a NA stack
- Replicated all the dynamoDB tables that were generated from Titan and its data to a EU region dynamoDB.
- Tried starting up a Gremlin server on a EU stack after all the tables/data has been replicated from NA to EU.
This error came up when I tried starting up a new Gremlin server on a EU region:
java.lang.ArrayIndexOutOfBoundsException: Required size [1] exceeds actual remaining size [0]
at com.thinkaurelius.titan.diskstorage.util.StaticArrayBuffer.require(StaticArrayBuffer.java:80)
at com.thinkaurelius.titan.diskstorage.util.StaticArrayBuffer.getByte(StaticArrayBuffer.java:156)
at com.thinkaurelius.titan.diskstorage.util.ReadArrayBuffer.getByte(ReadArrayBuffer.java:67)
at com.thinkaurelius.titan.graphdb.database.idhandling.VariableLong.readUnsigned(VariableLong.java:34)
at com.thinkaurelius.titan.graphdb.database.idhandling.VariableLong.readPositive(VariableLong.java:80)
at com.thinkaurelius.titan.graphdb.database.serialize.StandardSerializer.readClassAndObject(StandardSerializer.java:265)
at com.thinkaurelius.titan.diskstorage.configuration.backend.KCVSConfiguration.staticBuffer2Object(KCVSConfiguration.java:250)
at com.thinkaurelius.titan.diskstorage.configuration.backend.KCVSConfiguration.get(KCVSConfiguration.java:102)
at com.thinkaurelius.titan.diskstorage.configuration.BasicConfiguration.isFrozen(BasicConfiguration.java:93)
at com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1338)
Keep in that mind that the replication portion is fine. NA & EU DynamoDB are exact replicas of each other.
Questions
- Does Titan 1.0.0 store region specific information in its tables?
- Has anyone else tried cross-region replication for Titan?
It seems like the only way to perform cross-region replication for Titan is on the service code level rather than from the built-in functionality from dynamoDB Streams + Lambda.