如何在Cassandra中创建自动增量ID [英] How to create auto increment IDs in Cassandra
本文介绍了如何在Cassandra中创建自动增量ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们知道在SQL数据库中创建自动增量ID很容易,在Cassandra中有一个很好的解决方案吗? ID应该是键或列名。
We know that it is easy to create auto increment IDs in SQL databases, is there a good solution for it in Cassandra? The IDs should be for key or column name.
推荐答案
创建一个全局顺序序列号在一个分布式系统。使用UUID。
(因为您必须让所有参与者同意并接受序列的演变 - 在天真的实现下)
Creating a global sequential sequence of number does not really make any sense in a distributed system. Use UUIDs.
(Because you would have to make all participants agree and accept the evolution of the sequence -- under a naive implementation)
这篇关于如何在Cassandra中创建自动增量ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文