Copid从马尔科的评论 -
Basically the write performance will not be affected but the read performance will suffer if you have very
very long rows and always read stuff from the back of it.
Over time when you insert the data cassandra will also have to read more sstables to satisfy your read requests,
so with time read performance will degrade if you are not careful
我只是想避免删除。如果我们可以设计上面的用例来避免删除。
create table groups(
groupid int,
userid int,
groupName text static,
attributes Map(text , text),
primary key (groupid,userid)
);
查询 -
insert into groups (groupid,userid,groupName,attributes) values (100,200,'friends',{'admin':'false','moderator':'true','user-member':'true'});
update groups set attributes['admin'] = 'true' where groupid=100 and userid = 200;
这样,我们就不必删除表中的任何值。同样在将来,如果我们想要添加新的属性,我们不必改变表格定义。
假设你在一个组中有1000个成员。当组名更改时,您必须更新1000行。这不坏吗? –
我们可以保持组名静态 – Gunwant
基本上写性能不会受到影响,但如果行数非常长,并且始终从后面读取数据,读取性能将会受损。 随着时间的推移,当您插入数据时,cassandra也必须读取更多sstables以满足您的读取请求,因此如果您不小心,读取性能会随着时间的推移而降低。 –