Through the above 2 sections, we have learned about the problems encountered by RDBMS and have a basic understanding of Cassandra. The following is an introduction to the Cassandra internal simple structure.
Through this chapter, you should understand:
Cassandra Write Process
What is sstable
Cassandra Read Process
Writes can be written to any node in the cluster
Writes is written to the commit log and written to Memtable
Each write consists of a timestamp
Memtable regular flush to hard drive (sstable)
When the content of memtable exceeds its configured limit, the data it contains is placed in a queue and flushed to disk. You can change the length of the queue by modifying the value of Memtable_flush_queue_size in Cassandra.yaml
The new memtable is created in memory
Delete is a special write called "Tombstone" (Tombstone)
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/82/7A/wKioL1dWfYWS986iAAB9v7Fk5YE723.png "style=" float: none; "title=" 1.png "alt=" Wkiol1dwfyws986iaab9v7fk5ye723.png "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/82/7B/wKiom1dWfH6RgmDsAACklsVSMaA321.png "style=" float: none; "title=" 2.png "alt=" Wkiom1dwfh6rgmdsaacklsvsmaa321.png "/>
Sstable ordered string tables (Sorted string table) are the concepts borrowed from Google's bigtable. Once the memtable is written to disk and becomes a sstable, it is immutable.
Features are as follows:
Data files: Storing records, not mutable
Each write consists of a timestamp
Partition is split into multiple sstable
The new memtable is created in memory
Merge with compaction to save only the latest timestamp
Delete is marked as Tombstone
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/82/7A/wKioL1dWft_xHBdVAAE8z8vtlA8483.png "title=" 1.png " alt= "Wkiol1dwft_xhbdvaae8z8vtla8483.png"/>
Any server can be queried as coordinator
Locate the interactive nodes by querying key
On each node, the data is pulled from Sstable and merged
Consistency < All, the read Repaire (read_repaire_chance) will be executed in the background
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/82/7B/wKiom1dWgKnSHRvTAAFspihkQPs096.png-wh_500x0-wm_3 -wmp_4-s_1660290563.png "style=" Float:none; "title=" 1.png "alt=" Wkiom1dwgknshrvtaafspihkqps096.png-wh_50 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/82/7A/wKioL1dWgbHDoTIGAACMp7OCMQg792.jpg-wh_500x0-wm_3 -wmp_4-s_2053602060.jpg "style=" Float:none; "title=" 2.jpg "alt=" Wkiol1dwgbhdotigaacmp7ocmqg792.jpg-wh_50 "/>
This article is from the Java Architect's Road blog, so be sure to keep this source http://eric100.blog.51cto.com/2535573/1786998
Cassandra Basic Introduction (3)-Architecture Introduction