Using Aerospike as a content store / Can I insert a large document using Java Client?


Can we use aerospike as a content store to store multiple documents ? If so then can you please point me to a sample Java implementation ?


This can definitely be done for smaller objects by storing each object in a different bin. Basically, you would store each document as a blob.

However, we have seen your other questions on the forum and since your objects are so large (perhaps larger than 100GB), this is not a practical solution for you.


Can you let me know the Java API that i can use for smaller objects to store in different bins.



A document is usually a List containing Lists and Maps or a Map containing Lists and Maps.

An Aerospike record can contain one or more Bins. A Bin can contain a string, a long, a blob, a List or a Map. A List or a Map is a complex object and you can store a document in it.

Use the factory method value1 = Value.get(...) and passing a Java List or Map. Put this value in a bin instance new Bin("doc1", value1).

Store the data using:

client.put(null, key, new Bin("doc1", value1), new Bin("doc2", value2)

I hope this helps