我的应用程序是这样工作的。
一个数据库(Mysql),其中有一个命令。该命令是一个对象(由许多字段组成,如整数和字符串)。有一个Web服务与数据库交互,并从DB获取命令并执行一些操作。
我将命令存储到数据库中的方式是剥离所有字段,并将它们插入到数据库中。
我能否使用Cassandra替换Mysql并存储命令对象?
Commands = { // this is a ColumnFamily (CF)
commandObject1: { // this is the key to this Row inside the CF
// now we have an infinite # of columns in this row
field1: "value1",
field2: "value2",
field3: "value3"
}, // end row
commandObject2: { // this is the key to another row in the CF
// now we have another infinite # of columns in this row
field1: "value1",
field2: "value2",
field3: "value3"
field4: "value4",
field5: "value5"
},
}