gpt4 book ai didi

Couchbase buckets vs Ephemeral buckets(沙发桶VS短暂桶)

转载 作者:bug小助手 更新时间:2023-10-24 20:32:45 25 4
gpt4 key购买 nike



Is Couchbase buckets store data in memory too?
I want to create live leaderboard system using Couchbase buckets and I run four different queries :

Couchbase存储桶是否也将数据存储在内存中?我想使用Couchbase存储桶创建实时排行榜系统,并运行四个不同的查询:


1- select existed rank

2- update rank if existed (rank + 1)

3- insert rank and more data if not existed (rank = 1)

1-选择现有排名2-如果存在更新排名(排名+1)3-插入排名和更多数据,如果不存在(排名=1)


4- select from collection using limit 10 and order by rank desc.

4-使用LIMIT 10从集合中选择,并按等级说明排序。


I will be happy to listen to your suggestions to get best performance from Couchbase.
In this situation is there any difference using Normal Couchbase bucket or using Ephemeral buckets ?

我很乐意听取您的建议,让Couchbase发挥出最好的性能。在这种情况下,使用普通的沙发基桶和使用短暂的桶有什么不同吗?


I try to read Couchbase document Couchbase Docs
it's very good but I want to know more and use people experiences.

我试着阅读Couchbase文档,这是非常好的,但我想了解更多,并利用人们的经验。


更多回答
优秀答案推荐

To answer the question "Does Couchbase buckets store data in memory too?" the answer is yes. Couchbase buckets are memory-first, mutations are queued up asynchronously to be written to disk.

回答“Couchbase存储桶是否也在内存中存储数据?”答案是肯定的。Couchbase存储桶是内存优先的,突变被异步排队以写入磁盘。


Ephemeral buckets are memory-only. Meaning there is no queue to write mutations to the disk.

临时存储桶是仅限内存的。这意味着没有队列可以将突变写入磁盘。


As for "best performance", that's really not a great question for Stack Overflow. You might consider the Couchbase forums or the Couchbase Discord to get some more opinions.

至于“最佳性能”,对于Stack Overflow来说,这确实不是一个很好的问题。你可以考虑一下Couchbase论坛或Couchbase分歧来获得更多的意见。


In general, Ephemeral will almost always be (at least slightly) faster than Couchbase buckets, and for the most part they have the same capabilities.

一般来说,临时性的存储桶几乎总是比Couchbase存储桶快(至少稍微快一点),而且在很大程度上它们具有相同的功能。


However, Ephemeral durability is only provided via memory on other nodes. If a whole cluster goes offline, and the data is not backed up or replicated elsewhere, that data might be lost forever (hence the name). So, I personally would only recommend Ephemeral if you want to optimize for pure performance and having memory-only durability is an acceptable trade-off.

然而,短暂的持久性仅通过其他节点上的内存提供。如果整个群集离线,并且数据未备份或复制到其他位置,则该数据可能会永远丢失(因此得名)。因此,我个人建议只有在您想要优化纯性能并且仅具有内存持久性是可接受的折衷方案的情况下,才推荐使用临时性内存。


更多回答

I appreciate your help. I will ask it in Couchbase forums.

我很感谢你的帮助。我会在Couchbase论坛上问这个问题。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com