the consistency analysis of secondary index on
play

The Consistency Analysis of Secondary Index on Distributed - PowerPoint PPT Presentation

The Consistency Analysis of Secondary Index on Distributed Ordered Tables Houliang Qi, Xu Chang, Xingwu Liu, Li Zha Agenda Background MoEvaEon


  1. The ¡Consistency ¡Analysis ¡of ¡ Secondary ¡Index ¡on ¡Distributed ¡ Ordered ¡Tables ¡ ¡ Houliang ¡Qi, ¡Xu ¡Chang, ¡Xingwu ¡Liu, ¡Li ¡Zha

  2. Agenda • Background ¡ • MoEvaEon ¡ • SoluEons ¡ – Consistency ¡ ¡ • Consistency ¡Window ¡ • Consistency ¡Model ¡ – Secondary ¡Index ¡ • EvaluaEon ¡ • Conclusion ¡& ¡Future ¡Work ¡ • Related ¡Work ¡

  3. Background • NoSQL ¡is ¡widely ¡used ¡ – The ¡digital ¡universe ¡is ¡huge ¡, ¡and ¡growing ¡exponenEally ¡ ¡ – Google ¡BigTable, ¡Yahoo! ¡PNUTS, ¡Apache ¡HBase, ¡ Cassandra, ¡etc ¡ – high ¡performance, ¡low ¡space ¡overhead, ¡and ¡high ¡reliability ¡ • MulE-­‑dimensional ¡Range ¡Queries ¡ – MDRQ ¡is ¡common ¡ • laEtude ¡ > ¡ 41 . 5 ¡and ¡laEtude ¡ < ¡ 44 . 6 ¡and ¡longitude ¡ > ¡ 142 . 5 ¡and ¡ longitude ¡ < ¡ 143 . 8 ¡and ¡type ¡= ¡‘shop’ ¡ ¡ – NoSQL ¡only ¡support ¡row-­‑key ¡query ¡ • Indexing ¡techniques ¡ – HIndex, ¡Apache ¡Phoenix, ¡Diff-­‑Index ¡etc. ¡

  4. Motivation • Only ¡concerned ¡about ¡performance, ¡do ¡not ¡care ¡ about ¡consistency ¡ • Data ¡inconsistency ¡problem ¡ ¡ – https://issues.apache.org/jira/browse/PHOENIX-3336 ¡ • Some ¡quesEons ¡can’t ¡answer ¡ – How ¡to ¡measure ¡the ¡consistency ¡between ¡the ¡base ¡ table ¡and ¡index ¡table? ¡ – What ¡is ¡the ¡difference ¡between ¡indexing ¡techniques ¡ with ¡eventual ¡consistency ¡models? ¡ – What ¡can ¡we ¡learn ¡form ¡the ¡above ¡analysis ¡? ¡

  5. Contribution of our work • Introduce ¡the ¡inconsistency ¡window ¡to ¡ measure ¡the ¡consistency ¡degree ¡ • Present ¡the ¡definiEon ¡of ¡strong, ¡RYW ¡and ¡ eventual ¡consistency ¡between ¡the ¡index ¡table ¡ and ¡base ¡table ¡ • Classify ¡the ¡typical ¡secondary ¡indexing ¡ techniques ¡and ¡implement ¡them ¡by ¡ourselves ¡ • Experimental ¡evaluaEon ¡

  6. Question1 ¡ ¡ ¡ How ¡to ¡measure ¡the ¡consistency ¡between ¡ the ¡base ¡table ¡and ¡index ¡table? ¡

  7. Index model • Two ¡operaEons ¡ – C(v) :reading ¡ key ¡from ¡index ¡table ¡by ¡the ¡value ¡ v ¡ and ¡reading ¡the ¡record ¡ < ¡k, ¡v’ ¡> ¡ from ¡base ¡table ¡by ¡ the ¡ key , ¡then ¡comparing ¡ v’ ¡with ¡ v ¡. ¡ – S(k, ¡v) : ¡ wriEng ¡the ¡record < ¡k, ¡v ¡> ¡ into ¡the ¡base ¡ table ¡and ¡updaEng ¡the ¡index ¡table ¡ • ExecuEon ¡DAG ¡ C(v 1 ) C(v 2 ) C(v 3 ) ¡ S(k,v 1 ) S(k,v 2 ) S(k,v 3 ) C(v 1 ) C(v 2 ) C(v 3 )

  8. Inconsistency Window ES: ¡ExecuEon ¡ • Concurrent ¡execuEon ¡serializaEon ¡ Sequence Concurrent O O � O � O → → → → → Server P 1 : O O � O � O → → → → → 11 12 1 i 1 n 1 1' 2' i ' n ' O O � O � O → → → → → Client P 2 : 21 22 2 i 2 n 2 � Server O O � O � O → → → → → O O � O � O 1'' 2'' i '' n '' P m : → → → → → m 1 m 2 mi mn m SequenEal RS: ¡Result ¡ Sequence • Inconsistency ¡Window ¡:Given ¡any ¡operaEon ¡ O , ¡consider ¡the ¡set ¡ of ¡operaEons ¡ O’ ¡ preceding ¡ O ¡ in ¡ ES ¡and ¡afer ¡ O ¡ in ¡ RS , ¡denoted ¡by ¡ Lag(O) . ¡Define ¡inconsistency ¡window ¡of ¡the ¡ RS ¡ as ¡ max O ∈ RS ¡| Lag ( O ) | . ¡ ¡ ¡

  9. Inconsistency Window Calculate O 6 O 3 Execu&on ¡DAG : ¡ from ¡client ¡perspecEve O 1 O 2 O 5 O 7 O 4 Execu&on ¡Sequence: ¡ ¡ Inconsistency ¡Window : ¡ ¡ Result ¡Sequence: ¡ ¡ Sort ¡according ¡to ¡the ¡ For ¡each ¡operaEon, ¡ Sort ¡by ¡Eme ¡according ¡ Eme ¡at ¡which ¡the ¡ calculate ¡its ¡distance ¡ to ¡the ¡compleEon ¡of ¡ operaEon ¡begin ¡to ¡ between ¡the ¡ES ¡and ¡RS ¡ the ¡operaEon ¡ execute ¡ ES RS ICW O 1 O 1 0=|1-1| O 2 O 3 1=|3-2| O 3 O 5 2=|5-3| time O 4 O 7 3=|7-4| O 5 O 2 3=|2-5| O 6 O 6 0=|6-6| O 7 O 4 3=|4-7|

  10. Consistency Model: Index table & Base Table • Strong ¡Consistency ¡ For ¡any ¡execuEon ¡ ES , ¡there ¡is ¡a ¡linearizaEon ¡ RS ¡ preserving ¡ the ¡order ¡in ¡ ES , ¡which ¡means ¡that ¡if ¡an ¡operaEon ¡ O 1 ¡ precedes ¡ O 2 ¡in ¡ ES , ¡then ¡operaEon ¡ O 1 ¡precedes ¡ O 2 ¡in ¡ RS . ¡ success success success C(v 1 ) C(v 2 ) C(v 3 ) success success success S(k,v 1 ) S(k,v 2 ) S(k,v 3 ) C(v 1 ) C(v 2 ) C(v 3 ) success success success

  11. Consistency Model: Index table & Base Table • Strong ¡Consistency ¡ For ¡any ¡execuEon ¡ ES , ¡there ¡is ¡a ¡linearizaEon ¡ RS ¡ preserving ¡the ¡order ¡in ¡ ES , ¡which ¡means ¡that ¡if ¡an ¡operaEon ¡ O 1 ¡precedes ¡ O 2 ¡in ¡ ES , ¡then ¡ operaEon ¡ O 1 ¡precedes ¡ O 2 ¡in ¡ RS . ¡ • Read-­‑Your-­‑Writes(RYW) ¡Consistency . ¡ There ¡is ¡a ¡number ¡Δ ¡ > ¡ 0. ¡For ¡any ¡execuEon ¡ ES , ¡there ¡is ¡a ¡linearizaEon ¡ whose ¡inconsistency ¡window ¡is ¡less ¡than ¡Δ ¡and ¡preserving ¡the ¡ordering ¡of ¡ operaEons ¡launched ¡by ¡any ¡client. ¡ • Eventual ¡Consistency . ¡ There ¡is ¡a ¡number ¡Δ ¡ > ¡ 0 ¡such ¡that ¡for ¡any ¡execuEon ¡ ES , ¡there ¡is ¡a ¡ linearizaEon ¡whose ¡inconsistency ¡window ¡is ¡less ¡than ¡Δ ¡ ¡ success success success C(v 1 ) C(v 2 ) C(v 3 ) success success success S(k,v 1 ) S(k,v 2 ) S(k,v 3 ) C(v 1 ) C(v 2 ) C(v 3 ) C(v 3 ) failure failure failure success

  12. Question 2 ¡ ¡ ¡ What ¡is ¡the ¡difference ¡between ¡indexing ¡ techniques ¡with ¡eventual ¡consistency ¡ models? ¡

  13. Update operation in DOT • Distributed ¡Ordered ¡Tables ¡ – introduced ¡by ¡Yahoo! ¡ ¡ – parEEons ¡conEnuous ¡keys ¡to ¡regions, ¡replicates ¡regions, ¡distributes ¡ regions ¡to ¡shared-­‑nothing ¡servers. ¡ – serves ¡as ¡tables ¡and ¡columns, ¡supports ¡range ¡queries ¡on ¡primary ¡keys. ¡ • Update ¡operaEon ¡in ¡DOT ¡ ¡ ¡

  14. Secondary Indexes • Indexing ¡techniques ¡classificaEon ¡ No. Indexing ¡ DescripGon Techniques ¡ 1 Sync Step1+Step2+Step3+Step4 2 Async-insert Step1+Step2+async maintain ¡ 3 Async-compact Step1+Step2+compact maintain 4 Async-simple Step1+async maintain • Here ¡we ¡only ¡focus ¡on ¡the ¡eventual ¡consistency ¡ ¡ ¡ Indexing ¡ Global Local Strong ¡ RYW Eventual Techniques ¡ Sync CMIndex, Apache Google Spanner, Diff-Index CMIndex, SLIK , Diff-Index Phoenix XiaoMi Themis, Diff-Index, DELI , Apache Phoenix HIndex , IHBase , Async-insert Diff-Index, SLIK - Apache Phoenix Async-compact DELI HIndex Async-simple Diff-Index IHBase

  15. Evaluation • Experimental ¡setup ¡ – 7 ¡nodes: ¡3 ¡client, ¡1 ¡master, ¡3 ¡slaves ¡ – Client: ¡generate ¡workload ¡by ¡YCSB ¡ ¡ – Servers: ¡HBase/HDFS ¡default ¡configuraEon ¡ • Workload ¡scenario ¡ – Scenario ¡A: ¡100% ¡update ¡ – Scenario ¡B: ¡50%scan, ¡50%update ¡

  16. Evaluation- ¡Scenario ¡A Sync: ¡higher ¡ Async: ¡lower Sync: ¡lower Async: ¡higher ¡

  17. Evaluation- ¡Scenario ¡A – ¡Global ¡and ¡local ¡have ¡the ¡similar ¡consistency ¡ for ¡the ¡same ¡indexing ¡techniques. ¡ – ¡Sync ¡has ¡the ¡highest ¡degree ¡of ¡consistency ¡ – ¡Async-­‑insert ¡and ¡async-­‑simple ¡indexing ¡ technique ¡both ¡show ¡worse ¡consistency ¡ ¡ percenEle ¡ ¡ global local ¡ 0.90 0.95 0.97 0.99 0.90 0.95 0.97 0.99 inconsistency ¡ indexing ¡ ¡ ¡ window ¡ techniques ¡ Async-­‑insert 65922 70429 72243 74056 86015 90893 92846 94798 Async-­‑simple 89010 93973 95959 97944 88854 93816 95801 97786

  18. Evaluation- ¡Scenario ¡B – ¡Compared ¡with ¡update ¡latency, ¡scan ¡latency ¡is ¡ lower. ¡ – ¡The ¡trend ¡of ¡performance ¡of ¡the ¡indexing ¡ techniques ¡is ¡the ¡same ¡as ¡scenario ¡A ¡ ¡ – ¡The ¡total ¡performance ¡of ¡scenario ¡B ¡is ¡beoer ¡ than ¡scenario ¡A ¡ ¡ ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend