aerospike删除数据_前往:在30分钟内达到Aerospike数据库的7000万套

2022-06-21 00:00:00 用户 数据库 调用 作业 工人

aerospike删除数据

In continuation of my previous article where I’ve detailed on the limitations of goroutines, in this article, I would like to share how we achieved 70 million sets to Aerospike Database in 30 minutes by leveraging the entire system Cores with the help of Go Worker Pool Pattern.

在上一篇文章继续详细介绍goroutine的局限性时,我想在本文的后续内容中,分享在Go Worker的帮助下,如何利用整个系统内核在30分钟内达到Aerospike数据库7000万套的方法。游泳池模式。

Usecase Insights

用例见解

  • Currently, at GoIbibo we had close to 70 million users and we had a set of categories that each user belongs to. The categories describe if the user is new | fraud |regular transacting user | user who didn’t transact in last year etc and so on …

    目前,在GoIbibo,我们有近7000万用户,并且每个用户都拥有一组类别。 类别描述用户是否是新用户| 欺诈|常规交易用户| 去年未进行交易等的用户...
  • User Categories change dynamically based on their behaviour and we have a generation task where we gather the data from multiple sources and save to our Database with Key as UserID and Value as List of Categories and the generation has to happen for all 70 million users every day.

    用户类别根据其行为动态变化,我们有一个生成任务,我们从多个来源收集数据,并以键作为UserID和值作为类别列表保存到我们的数据库中,并且每天必须为所有7000万用户进行生成。

Database Insights

数据库见解

  • For those who are not aware of Aerospike, it’s a multi-threaded and distributed Key-Value store with storage based out of SSD.

    对于那些不了解Aerospike的人来说,这是一个多线程和分布式键值存储,其存储基于SSD。
  • We have 3 instances of Aerospike where keys get split and stored across instances with the desired replication factor.

    我们有3个Aerospike实例,其中密钥被拆分并以所需的复制因子跨实例存储。

Advantages over Redis

与Redis相比的优势

  • This being a multi-threaded Key-Value Store doesn’t block all the requests in case if there is any slow query unlike Redis, that blocks all the requests if 1 request gets slowed down

    这是一个多线程的键值存储,不会阻止所有请求,以防万一发生与Redis不同的慢查询,如果1个请求变慢则阻止所有请求
  • SSD being cheaper than RAM and being a distributed database we always have a chance to horizontally scale, unlike Redis where we need to scale vertically with growing data.

    SSD比RAM便宜,而且作为分布式数据库,我们总是有机会进行水平扩展,与Redis不同,我们需要随着数据的增长而垂直扩展。

Drawbacks

缺点

  • This doesn’t support batch set which means if we need to insert 70 million key-value, we need to make 1 call to DB per key which equals 70 million DB Calls.

    这不支持批处理集,这意味着如果我们需要插入7,000万个键值,则需要每个键对DB进行一次调用,这等于7,000万次DB调用。

相关文章