做rf = all&#x2b是hacky; Cl =两个经常使用的Cassandra桌子?
我计划增强对我们的零售服务的搜索,该服务由DataStax管理。我们的车轮和轮胎中有大约500kb的RAW数据数据,并且可以压缩并加密至约20KB。该表经常使用,每天都会改变。我们将数据发送到前端,该数据将在后来进行处理。现在,我们想将此数据存储在单行表中,在一个单独的键空间中,其一致性级别为两个,而RF等于所有节点,将表复制到所有节点。 现在的问题:该解决方案是骇客还是异常?在这种情况下,是否有什么解决方案?
I plan to enhance the search for our retail service, which is managed by DataStax. We have data of about 500KB in raw from our wheels and tires and could be compressed and encrypted to about 20KB. This table is frequently used and changes about every day. We send the data to the frontend, which will be processed with Next.js later. Now we want to store this data in a single row table in a separate keyspace with a consistency level of TWO and RF equal to all nodes, replicating the table to all of the nodes.
Now the question: Is this solution hacky or abnormal? Is any solution rather this that fits best in this situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对您的问题的快速答案是,这是做
rf = all
的骇客解决方案。该表非常小,因此将其复制到集群中的所有节点没有好处。实际上,表如此之小,以至于数据将被缓存。
由于您正在使用 dataStax entherprise (dse),您可能还可以利用优势这使您可以将数据保存在RAM中,从而从磁盘寻求中保存。由于您的桌子很容易适合RAM,因此它是DSE内存中的完美用例。
要配置表以运行内存中的表,请将表的压实策略设置为
memoryOnlyStrategy
:要更改现有表的配置:
请注意,使用DSE In-Memory配置的表仍然持续到磁盘上如果停电或服务中断,不会丢失任何数据。内存表的操作与常规表相同,因此相同的备份和还原过程仍然适用,唯一的区别是将数据的副本保留在内存中以获得更快的读取性能。
有关详细信息,请参见。干杯!
The quick answer to your question is yes, it is a hacky solution to do
RF=ALL
.The table is very small so there is no benefit to replicating it to all nodes in the cluster. In practice, the tables are so small that the data will be cached anyway.
Since you are running with DataStax Enterprise (DSE), you might as well take advantage of the DSE In-Memory feature which allows you to keep data in RAM to save from disk seeks. Since your table can easily fit in RAM, it is a perfect use case for DSE In-Memory.
To configure the table to run In-Memory, set the table's compaction strategy to
MemoryOnlyStrategy
:To alter the configuration of an existing table:
Note that tables configured with DSE In-Memory are still persisted to disk so you won't lose any data in the event of a power outage or service disruption. In-Memory tables operate the same as regular tables so the same backup and restore processes still apply with the only difference being that a copy of the data is kept in memory for faster read performance.
For details, see DataStax Enterprise In-Memory. Cheers!