DEV Community

Cover image for Building a Log-Structured Merge Tree in Go

Building a Log-Structured Merge Tree in Go

Justin Ethier on December 15, 2022

Introduction Last year I read more challenging projects every programmer should try and decided to take a deep dive into researching sol...
Collapse
 
yoyo_programming profile image
yoyo

Why did you use a skip list for the memtable instead of the built-in map in Go?

Collapse
 
justinethier profile image
Justin Ethier • Edited

Go's built-in map is not thread-safe, so mutexes must be used for concurrent access. For high performance it is better to use a data structure that is better suited for concurrent access, such as a skip list.

Collapse
 
zhiquan profile image
hu • Edited

from your GetFunction on search disk,you check index files range all levels especially higher level. since files in same level whose level bigger than 0 in sorted order, why need check one by one?