Code Monkey home page Code Monkey logo

fifodb's Introduction

FifoDB - persistent fifo disk-based queue Build Status Coverage Status Go Report Card

Thread-safe FIFO-queue backend by a filesystem and acknowledgement opportunity.

Motivation

  • LSM based storage (like Badger, RocksDB, LevelDB, etc) are very nice and powerful, but much strong and has overhead for LSM mechanics
  • LSM based storage need more resources for each instance (arena size, io/compaction loops). So we can't get new instance for every queue, only for every virtual host and need to implement bucket system on keys like 'vhost-name.queue-name.'
  • need simple embedded native FIFO disk storage
  • have fun and learn a lot :)

Basic idea

Basic ideas of storage is

  • stores data in 64MB segments for compaction performance (configurable)
  • stores data strongly in FIFO order
  • retrieves data strongly in FIFO order
  • supports 4 main methods - Push, Pop, Ack

Usage

Internals

We need 2 additional and strange methods 'Ack' and 'Nack' to handle 'At least once' delivery guarantees after server crash or restart. User can simply 'Push' data into queue tail and 'Pop' data from queue head. 'Pop' always returns NEXT message from queue after 'Open' and ignores Nack-ed messages. 'Ack' and 'Nack' are only for compaction and rebuilding queue after server crash or restart.

fifodb's People

Contributors

valinurovam avatar

Stargazers

 avatar

Watchers

 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.