Traditional Culture Encyclopedia - Traditional stories - What are the forms of database storage structure?
What are the forms of database storage structure?
From the aspects of workload balance, consistency requirements, delay and access mode, the application is different. If we can make a clear decision on the architecture of the database and storage facilities, it will help us understand the reasons for the system behavior pattern, and once the problem is solved, we can tune the database according to the workload.
One of the main structural differences between B-tree and LSM-tree lies in the purpose and significance of optimization.
Let's compare B-tree and LSM-tree. In a word, B-tree has the following characteristics:
B-tree is variable, which supports in-place update by introducing some space overhead and more related write paths. B-tree does not need complete file rewriting or multi-source merging.
B-tree is read optimized. That is, there is no need to read B-trees from multiple sources (so there is no need for subsequent merging operations), which simplifies the reading path.
Writing may trigger cascading splitting of nodes, which will make some writing operations more expensive.
B-tree is optimized for paging (block storage) environment, where there are no byte addresses. They are optimizedforgedenvironments (block storage), which is impossible.
Although it needs rewriting, B-tree storage usually requires less maintenance than LSM-tree storage.
Concurrent access requires read/write isolation with a series of locks and latches.
LSM tree has the following characteristics:
LSM tree is not writable. SSTable is written to disk only once and never updated. Compact operations achieve spatial integration by removing entries from multiple data files and merging data with the same key. During compression, the merged table will be discarded and deleted after successful merging. Another useful feature provided by non-writeability is the concurrent access to refreshed tables.
LSM is write optimized. This means that writes will be cached and flushed to disk in order, which may support spatial locality on disk.
A read operation may require accessing data from multiple data sources. Because data with the same key written at different times may fall in different data files. Records must be merged before being returned to customers.
LSM trees need to be maintained and reduced, because cached writes will be flushed to disk.
- Previous article:How to unify China?
- Next article:Ask for a paper about the popularity of Korean clothing in China.
- Related articles
- Is there beef in Lanzhou Lamian Noodles cold noodles?
- Correct use of brass rice jar
- How to find the reason? English composition
- Cars. Under normal circumstances, how many degrees does the engine work?
- What are the schools of martial arts in China?
- Wuhan Hobeixiang Snack Street Food Tips
- Why is China chess a symbol of China traditional culture?
- Which model of Panda Radio is cost-effective?
- Dragon Boat Festival Creative Poster Picture -202 1 Dragon Boat Festival Theme Innovation Scheme 5
- What's that strange stone like?