Xintong Bian
Xintong Bian

Reputation: 55

Why the Bin type in Aerospike java client doesn't implement java.util.Map

I'm migrating our database from MongoDB to Aerospike, so I'm expecting the Bin type in Aerospike's Java client to implement java.util.Map<String, Object>, but discovered that the Bin is defined as:

public final class Bin {

yet from what I understand, the Bin is like a map (name->value).

So why is that?

Upvotes: 2

Views: 94

Answers (1)

sunil
sunil

Reputation: 3567

This is a flexible design and future proof. As of today it has only name and value. So, map is enough. In the future, if you want to set/get additional properties like bin-level ttl, or persistence etc, this design will allow that.

Upvotes: 3

Related Questions