在具有 1 亿条记录的 Nosql 中按值或条件值搜索记录
Search records by value or conditional value in Nosql with 100 millions records
我们正在寻找 NoSQL 数据库,我们可以在其中存储超过 1 亿条记录,其中包含许多值字段,就像 Redis 中的集合一样。
而且数据库应该可以用值进行搜索。我们检查了 Redis,但它不支持任何按值搜索的选项。因为我们有数百万条记录,我们更新了一些记录字段,然后获取了一堆在特定时间未更新的记录。
因此,运行 查询所有记录然后检查哪些记录未从特定时间更新需要更多时间。因为在这个解决方案中,我们每分钟更新 100-200 条记录,然后根据值获取一堆记录。
所以,Redis 在这里是行不通的。我们可以选择存储到 MongoDB,但我们正在寻找支持按值搜索功能的键值数据库。
{
"_id" : ObjectId("5ac72e522188c962d024d0cd"),
"itemId" : 11.0,
"url" : "http://www.testurl.com",
"failed" : 0.0,
"proxyProvider" : "Test",
"isLocked" : false,
"syncDurationInMinute" : 60.0,
"lastUpdatedTimeUTC" : "",
"nextUpdateTimeUTC" : "",
"targetCountry" : "US",
"requestContentType" : "JSON",
"group" : "US"
}
在 Aerospike 中,您可以在 Java 客户端的存储库中使用 predicate filtering to find records that have not been updated since a point in time, and return only the metadata of that record, which includes the record digest (its unique identifier). You can process the matched digests and do whatever update you need to do. This type of predicate filter is very fast because it only has to look at the primary index entry, which is kept in memory. See the examples。
您不需要在此处使用二级索引,因为您想要扫描命名空间(或该命名空间的集合)中的所有记录,并且只需检查每条记录的 'last-update-time' 元数据。由于您将只返回记录的摘要(唯一 ID)而不是其任何实际数据,因此此扫描永远不需要从 SSD 读取任何内容。结果将非常快速且轻量级(同样,仅发回元数据)。在客户端中,您将迭代结果集,构建 ID 列表,然后通过后续写入操作这些 ID。
我们正在寻找 NoSQL 数据库,我们可以在其中存储超过 1 亿条记录,其中包含许多值字段,就像 Redis 中的集合一样。
而且数据库应该可以用值进行搜索。我们检查了 Redis,但它不支持任何按值搜索的选项。因为我们有数百万条记录,我们更新了一些记录字段,然后获取了一堆在特定时间未更新的记录。
因此,运行 查询所有记录然后检查哪些记录未从特定时间更新需要更多时间。因为在这个解决方案中,我们每分钟更新 100-200 条记录,然后根据值获取一堆记录。
所以,Redis 在这里是行不通的。我们可以选择存储到 MongoDB,但我们正在寻找支持按值搜索功能的键值数据库。
{
"_id" : ObjectId("5ac72e522188c962d024d0cd"),
"itemId" : 11.0,
"url" : "http://www.testurl.com",
"failed" : 0.0,
"proxyProvider" : "Test",
"isLocked" : false,
"syncDurationInMinute" : 60.0,
"lastUpdatedTimeUTC" : "",
"nextUpdateTimeUTC" : "",
"targetCountry" : "US",
"requestContentType" : "JSON",
"group" : "US"
}
在 Aerospike 中,您可以在 Java 客户端的存储库中使用 predicate filtering to find records that have not been updated since a point in time, and return only the metadata of that record, which includes the record digest (its unique identifier). You can process the matched digests and do whatever update you need to do. This type of predicate filter is very fast because it only has to look at the primary index entry, which is kept in memory. See the examples。
您不需要在此处使用二级索引,因为您想要扫描命名空间(或该命名空间的集合)中的所有记录,并且只需检查每条记录的 'last-update-time' 元数据。由于您将只返回记录的摘要(唯一 ID)而不是其任何实际数据,因此此扫描永远不需要从 SSD 读取任何内容。结果将非常快速且轻量级(同样,仅发回元数据)。在客户端中,您将迭代结果集,构建 ID 列表,然后通过后续写入操作这些 ID。