GithubHelp home page GithubHelp logo

fern4lvarez / piladb Goto Github PK

View Code? Open in Web Editor NEW
200.0 14.0 21.0 1.27 MB

Lightweight RESTful database engine based on stack data structures

Home Page: https://www.piladb.org

License: MIT License

Go 98.70% Makefile 0.76% Shell 0.54%
stack database go linux macos rest-api

piladb's Introduction

piladb Build Status GoDoc Go Report Card codecov osw

Logo

[pee-lah-dee-bee]. pila means stack or battery in Spanish.

piladb is a lightweight RESTful database engine based on stack data structures. Create as many stacks as you need, PUSH or POP elements of any kind, and have access to the one on top always in constant time.

Features

  • Stacks are auto-scalable and are only limited by the capacity of the host or by configuration.
  • Available POP, PUSH, PEEK,SIZE, and FLUSH operations for each of the stacks.
  • Manage stacks and other resources by using a REST API, so you can use it with your favorite programming language.
  • Manage elements in JSON-compatible data types: strings, numbers, arrays, objects, etc.
  • Totally configurable using a REST API, or CLI parameters.
  • In-memory store.
  • Written in Go, i.e. binaries are self-contained and distributable.

Documentation

Install

You can download binaries for Linux and Mac in the Releases page.

From Source Code

You need Go installed. Version 1.6+ recommended.

go get github.com/fern4lvarez/piladb/...
cd $GOPATH/src/github.com/fern4lvarez/piladb
make pilad

Clients

Development

You need Go installed. Version 1.6+ is mandatory.

go get github.com/fern4lvarez/piladb/...
cd $GOPATH/src/github.com/fern4lvarez/piladb
make all

You can also use Docker to create piladb builds or development environment. Please see the dev directory.

Dependencies

piladb aims to minimize the amount of third party dependencies and to rely on the Go standard library as much as possible.

Even though, it uses dep to vendor its few dependencies.

piladb also provides a go.mod file, which turns this project into a Go module. To learn more about Go modules and the vgo prototype, please read the Go & Versioning series by Russ Cox.

Code Coverage

We aim for a universal 100% code coverage for all suppackages. If some piece of code is not testable, it probably needs to be changed.

Check current code coverage of the project: https://codecov.io/gh/fern4lvarez/piladb

Release

You need Docker installed.

It's possible to get pilad binary releases by executing make release. This will cross-compile pilad in all available OS's and architectures.

Alternatively, if you don't have docker installed, you can release pilad binary with the make gox command. For this, you need a configured Go environment and gox installed.

Credits

piladb is developed by Fernando Álvarez and ≅oscillatingworks on a Dell XPS 13 laptop, running Ubuntu, and using vim-go plugin within the vim editor, in Berlin and Madrid, with the support of Gali, Godín and other friends.

Logo was designed by GraphicLoads.

Typography Lily Script One designed by Julia Petretta.

License

MIT

piladb's People

Contributors

fern4lvarez avatar sprt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

piladb's Issues

New Stack operations

This is a proposal to extend the capabilities of a Stack by adding new operations, that will allow to fit piladb into a larger set of use cases. The following criteria are not definitive, and open to be changed.

The main idea is that all new operations have also O(1) complexity.

EMPTY

Returns true/false ifsize is 0 or not, respectively.

FULL

Returns true if size equals MAX_SIZE_STACK config value, false otherwise.

BLOCK

Blocks a Stack. When a Stack is blocked, it's not possible to modify its contents.

ROTATE

Moves the bottommost element up to the top, rotating each element one position down.

top ->           |3|     ->    |5| 
                 |4|     ->    |3|
                 |6|     ->    |4|
bottom ->        |5|     ->    |6|

BASE

Bases the stack on top of an element, which will result as the new bottommost one.

                             +   +
                             |   |
  +   +                      +---+
  |   |                      | Y |
  +---+           +------->  +---+
  | Y |                      | X |
  +---+    +---+             +---+
  | X |    | A |             | A |
  +---+    +---+             +---+
  stack   element            stack

CONCAT

Concatenates two stacks into one.

                           +   +
                           |   |
                           +---+
                           | Z |
                           +---+
                           | Y |
+   +   +   +              +---+   +   +
|   |   |   |              | X |   |   |
+---+   +---+              +---+   +---+
| Z |   | C |              | C |   | C |
+---+   +---+   +------->  +---+   +---+
| Y |   | B |              | B |   | B |
+---+   +---+              +---+   +---+
| X |   | A |              | A |   | A |
+---+   +---+              +---+   +---+

  S1      S2                 S1      S2

These operations would join the already existing ones: PUSH, POP, PEEK, SIZE, and FLUSH.

New logo

New custom logo that replaces the one used until now:

piladb-logo-readme

Introduce configuration

Configuration for piladb:

  • Configuration will be an embedded pila.Database into pilad.Conn that will contain a stack per config value.
  • A /_config endpoint and hanlders will be implemented, so configuration can be accessed and modifed dinamically via HTTP requests.
  • No env vars or config files.
  • pilad will provide cli arguments to initialize the config with custom values.

Implement version control

Version control will be the way piladb persists its contents: instead of writing data into disk, it will decode all atomic operations into a binary log, that will contain the history of the piladb server. This will make possible to recover the state of a piladb instance from a file in order to implement #14, and also to share the state with other instances in a distributed fashion, so we can achieve #13.

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.