A small, sane btree library, derived from the old berkeley db 1.85 code base.

- as fast and simple as a sequential text file for sequential writes
- easy to use, difficult to abuse
- large data values and large key values that actually work
- a cache management that tries to avoid any btree corruption:
- if a page is evicted, all dirty pages are flushed to the underlying fd
- signals are blocked in the critical section.
- low space conditions are checked before entry to the critical section.
- a limited form of concurrency implemented with fcntl(F_SETLKW)
- readers are not blocked while dirty pages accumulate in a writers cache
- writer waits for readers to call bt_detach() before any write to the file.
- bt_attach() in a reader succeeds when the writer leaves its critical section.
- no starvation in a scenario with ten writers and ten readers.

- tested with musl libc, less than 40K for a statically linked test program.

Project Activity

See All Activity >

Follow A better btree library

A better btree library Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of A better btree library!

Additional Project Details

Registered

2014-07-11