我正在调试我的代码,我发现这个设置名称为“null”的 Aerospike java 客户端代码可以正常工作并将数据插入到 aerospike 中:
AerospikeClient client = new AerospikeClient("localhost", 3000);
Key key = new Key("test", null, inputPayload.getUuid());//Note that the set name is given as "null"
Bin bin1 = new Bin("segments", inputPayload.getSegments());
client.put(null, key, bin1);
我能够插入和检索数据,但show sets
没有透露任何集合名称。经过一些调试,我发现数据使用select * from <namespace>
我的问题是
- 如果数据没有存储在集合中,那么它存储在哪里?
- 我们知道 aerospike 与关系数据库相比:namespace == database 和 set == table。但是在关系型数据库中,我们是不允许直接往数据库中插入数据的,我们需要先创建一个表。这是有道理的。那么,为什么 aerospike 允许我们使用空集来做到这一点?