發⽣生了什麼事?!
• Failover Strategy: MongoDB.
• When Primary down, the secondary will
become new Primary. When old Primary is
back online, it will replay the op-log on old
Primary.
But it won’t most of time !!!
Slide 26
Slide 26 text
發⽣生了什麼事?!
• Failover Strategy: Riak.
• 由下 N 個結點接收 Write. 如果 N 個寫⼊入成功,
就會回傳成功,但是回傳失敗,即使只有⼀一個
成功,最終,這⼀一個 Write 會被寫到 N 份去。
• Conflict Resolution: 如果對同⼀一個 Key 的寫⼊入有
衝突,Riak會回傳多個值,由 Client 來判斷怎麼
取捨
http://blog.monitis.com/20123/14/an-overview-of-riak-an-open-source-nosql-database/
Schema-less
• Dynamic Language ⽤用起來很爽
• var tweets = db.find(….)
for tweet in tweets:
print tweet.text
Slide 38
Slide 38 text
Schema-less
• Dynamic Language ⽤用起來很爽
• var tweets = db.find(….)
for tweet in tweets:
print tweet.text
• 可是我們是寫 Java 的
Slide 39
Slide 39 text
Model class is Schema
@Entity("employees")
class Employee {
// auto-generated, if not set (see ObjectId)
@Id ObjectId id;
// value types are automatically persisted
String firstName, lastName;
// only non-null values are stored
Long salary = null;
// by default fields are @Embedded
Address address;