简体   繁体   English

锁定Riak数据库中的记录(NoSql)

[英]Locking record in Riak database (NoSql)

Is this possible to lock the record in Riak database ? 这可以锁定Riak数据库中的记录吗?

Like, in oracle- if we are updating the record in oracle table row, We have an option to lock the record while updating. 就像在oracle中一样,如果我们要更新oracle表行中的记录,则可以选择在更新时锁定记录。

Is it possible to lock the record in riak database while updating record/object. 更新记录/对象时是否可以将记录锁定在riak数据库中。

Locking is not supported in Riak. Riak不支持锁定。 Instead, if two writers try to update the same value at the same time, both writes are kept as sibling values. 相反,如果两个编写器尝试同时更新相同的值,则两次写操作都将保留为同级值。 Your application can then select the "correct" value. 然后,您的应用程序可以选择“正确”的值。

If you would prefer to just keep the most recently written value and discard the other, explicitly set allow_mult to false on the bucket and Riak will automatically pick the newest time stamp when sibling values are encountered. 如果您只想保留最近写入的值而舍弃另一个值,则在存储桶上将allow_mult显式设置为false,当遇到同级值时,Riak将自动选择最新的时间戳。

However, I don't think this setting works with strong consistency or data types. 但是,我认为此设置不适用于强一致性或数据类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM