【正文】
致性與高可用性之間選擇了高可用性 ? 動(dòng)態(tài)可伸縮 ? 樂觀復(fù)制 ? 可以動(dòng)態(tài)調(diào)整一致性 /持久性與延時(shí) ? 節(jié)點(diǎn)管理要保持低開銷 ? 最小化管理開銷 Scalability ? 當(dāng)我們增加一個(gè)系統(tǒng)中的資源,并能獲取與增加的資源保持適當(dāng)?shù)谋壤P(guān)系的性能提升,我們就認(rèn)為這個(gè)服務(wù)具備了伸縮性。Cassandra簡介 Jametongb2bdba 童家旺 A highly scalable, eventually consistent, distributed, structured keyvalue store. 議題介紹 ? 背景 ? 基本前提 – Scalability – 基本的 Storage Model – CAP 公理簡介 ? Cassandra使用案例 ? Cassandra設(shè)計(jì) – 它山之石 – Consistency Models(Eventual Consistency) – Consistent Hashing – Data Models – Storage Model (SSTable amp。 MemTable) – 故障檢測 amp。 – 資源投入與輸出保持線性關(guān)系 – 為促進(jìn)冗余投入的資源不會帶來性能損失 – 能夠處理異構(gòu)資源 – 能做到運(yùn)維高效 – 具備自修復(fù)能力 ? scalability is a function that represents the relationship between workload and throughput Scalability[2] ? Scale Out Vs Scale Up – Scale Up在同一個(gè)邏輯單元內(nèi)增加資源 ,例如增加 CPU/內(nèi)存 /網(wǎng)卡數(shù)量等 . – Scale Out增加多個(gè)邏輯單元的資源 ,并使它們?nèi)缤粋€(gè)集中的資源那樣提供服務(wù) (集群 /分布式 /負(fù)載均衡等 ) – Scale Up較為簡單 ,但是規(guī)模有限 ,代價(jià)越來越大 – Scale Out需要從架構(gòu)層面設(shè)計(jì) ,規(guī)模沒有限制 ,代價(jià)由架構(gòu)決定 . 基本的存儲模型 ? 行存儲 Vs 列存儲 Vs 混合存儲 –行存儲適合查找整行的存儲 ,不過需要配合索引 –列存儲適合查找少量列 ,適合做基于列的統(tǒng)計(jì) /查詢 –混合列存儲 . ? 將需要經(jīng)常組合查詢的列組合在一起 . ? 將其他列 (列的組合 )單獨(dú)存儲 . 基本的存儲模型 [2] CAP Theorem ? Consistency – the system provides a view of the distributed state which is consistent between observers – 所有的用戶都可以看到一致的系統(tǒng)狀態(tài) ? Availability – The system as a whole should continue functioning , even if servers should fail or be unreachable due to work failures – 無論何時(shí) ,哪怕出現(xiàn)硬件故障 ,數(shù)據(jù)中心故障 ,系統(tǒng)也可提供服務(wù) ,哪怕是降級的服務(wù) ? Partition Tolerance – The system as a whole should continue to function, potentially with degradations in service, even if the work can fail in arbitrary ways. – 哪怕在網(wǎng)絡(luò)出現(xiàn)分割的情況下 ,各個(gè)獨(dú)立的子系統(tǒng)都可以繼續(xù)提供服務(wù) ? Can Only Choose Two From Above Three CAP Theorem[2] ? BASE – Basic Availability – Soft state – Eventual Consistency ? ACID – Atomic – Consistency – Isolat