Code Monkey home page Code Monkey logo

flockd's Introduction

flockd 0.3.1

Build Status Coverage Status GoDoc License

flockd provides a simple file system-based key/value database that uses file locking for concurrency safety. Keys correspond to files, values to their contents, and tables to directories. Files are share-locked on read (Get and ForEach) and exclusive-locked on write (Set, Create, Update, and Delete).

This may be overkill if you have only one application using a set of files in a directory. But if you need to sync files between multiple systems, like a distributed database, assuming your sync software respects file system locks, flockd might be a great way to go. This is especially true for modestly-sized databases and databases with a single primary instance and multiple read-only secondary instances.

In any event, your file system must support proper file locking for this to work. If your file system does not, it might still work if file renaming and unlinking is atomic and flockd is used exclusively to access files. If not, then all bets are off, and you can expect occasional bad reads.

All of this may turn out to be a bad idea. YMMV. Warranty not included.

Inspirations

  • diskv: Similar use of one file per key/value pair. Uses a sync.RWMutex for concurrency protection. Lots of features, including path transformation, caching, and compression.

  • fskv: Use of buckets similar to Tables here (I stole the idea, really). Relies on temporary files for locking. Depends on afero for file management.

  • Scribble: Uses a single JSON file for the database. Relies on sync.Mutex for concurrency control.

flockd's People

Contributors

theory avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.