Dab tsi yog token range hauv Cassandra?
Dab tsi yog token range hauv Cassandra?

Video: Dab tsi yog token range hauv Cassandra?

Video: Dab tsi yog token range hauv Cassandra?
Video: Yog ntuj tsis pab ntshe kuv tuag lawm 8/6/2018 2024, Hlis ntuj nqeg
Anonim

A token hauv Cassandra yog tus nqi Hash. Thaum koj sim ntxig cov ntaub ntawv rau hauv Cassandra , nws yuav siv ib qho algorithm los hash tus yuam sij tseem ceeb (uas yog kev sib xyaw ntawm qhov tseem ceeb thiab pawg pawg ntawm lub rooj). Cov token ntau yam rau cov ntaub ntawv yog 0 - 2^127. Txhua node hauv a Cassandra pawg, lossis "ntiv nplhaib", yog muab thawj zaug token.

Tsis tas li ntawd, Vnode yog dab tsi hauv Cassandra?

Virtual nodes hauv a Cassandra pawg tseem hu ua vnodes . Vnodes tuaj yeem txhais tau rau txhua qhov ntawm lub cev hauv pawg. Txhua qhov ntawm lub nplhaib tuaj yeem tuav ntau lub pob virtual. Thaum ntxiv cov node tshiab rau pawg, cov nodes virtual ntawm nws tau txais qhov sib npaug ntawm cov ntaub ntawv uas twb muaj lawm.

Ib tug kuj yuav nug, qhov kev vam meej txhais li cas rau Cassandra sau ntawv? Kev vam meej txhais tau tias cov ntaub ntawv tau muab sau rau hauv daim ntawv cog lus thiab memtable. Tus coordinator node forwards rau sau rau replicas ntawm kab ntawd.

Kuj paub yog, Cassandra DB ua haujlwm li cas?

Cassandra yog ib tug peer-to-peer faib system ua los ntawm ib pawg ntawm cov node nyob rau hauv uas ib tug node txais tau ib tug nyeem los yog sau ntawv thov. Zoo ib yam li Amazon's Dynamo DB , txhua qhov ntawm cov pawg sib txuas lus hauv lub xeev cov ntaub ntawv hais txog nws tus kheej thiab lwm cov nodes siv cov kev sib txuas lus ntawm cov phooj ywg rau cov phooj ywg.

Cassandra sau cov ntaub ntawv li cas?

Cov Sau Txoj Kev Thaum a sau tshwm sim, Cassandra khaws cov cov ntaub ntawv nyob rau hauv ib tug qauv nyob rau hauv nco, lub memtable, thiab kuj appends sau mus rau qhov kev txiav txim log ntawm disk. Memtable yog a sau - rov qab cache ntawm cov ntaub ntawv partitions uas Cassandra ntsia ntawm qhov tseem ceeb. Qhov ntau lub rooj siv, qhov loj dua nws cov memtable yuav tsum yog.

Pom zoo: