Giter Site home page Giter Site logo

jamestiotio / tigerbeetle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tigerbeetle/tigerbeetle

0.0 1.0 0.0 35.52 MB

The distributed financial accounting database designed for mission critical safety and performance.

Home Page: https://tigerbeetle.com

License: Apache License 2.0

Shell 0.26% JavaScript 0.97% C 0.73% Java 9.41% Go 2.92% C# 3.92% PowerShell 0.02% TypeScript 1.31% Batchfile 0.15% Dockerfile 0.01% Zig 80.26% CSS 0.03% HTML 0.02%

tigerbeetle's Introduction

tigerbeetle

TigerBeetle is a financial accounting database designed for mission critical safety and performance to power the future of financial services.

TigerBeetle is not yet production-ready. In particular, the protocol and data file formats may change and might not be compatible across different commits, while we fine-tune the format ahead of release.

The production version of TigerBeetle is now under active development.

Quickstart

First, download a prebuilt copy of TigerBeetle.

On macOS/Linux:

git clone https://github.com/tigerbeetle/tigerbeetle; cd tigerbeetle; ./bootstrap.sh

On Windows:

git clone https://github.com/tigerbeetle/tigerbeetle; cd tigerbeetle; .\bootstrap.ps1

Want to build from source locally? Add -build as an argument to the bootstrap script.

Running TigerBeetle

Then create the TigerBeetle data file.

./tigerbeetle format --cluster=0 --replica=0 --replica-count=1 0_0.tigerbeetle
info(io): creating "0_0.tigerbeetle"...
info(io): allocating 660.140625MiB...

And start the replica.

./tigerbeetle start --addresses=3000 0_0.tigerbeetle
info(io): opening "0_0.tigerbeetle"...
info(main): 0: cluster=0: listening on 127.0.0.1:3000

Using the CLI Client

Now that you've got a cluster running, let's connect to it and do some accounting!

First let's create two accounts. (Don't worry about the details, you can read about them later.)

./tigerbeetle repl --cluster=0 --addresses=3000
TigerBeetle Client
  Hit enter after a semicolon to run a command.

Examples:
  create_accounts id=1 code=10 ledger=700,
                  id=2 code=10 ledger=700;
  create_transfers id=1 debit_account_id=1 credit_account_id=2 amount=10 ledger=700 code=10;
  lookup_accounts id=1;
  lookup_accounts id=1, id=2;
create_accounts id=1 code=10 ledger=700,
                id=2 code=10 ledger=700;
info(message_bus): connected to replica 0

Now create a transfer of 10 (of some amount/currency) between the two accounts.

create_transfers id=1 debit_account_id=1 credit_account_id=2 amount=10 ledger=700 code=10;

Now, the amount of 10 has been credited to account 2 and debited from account 1. Let's query TigerBeetle for these two accounts to verify!

lookup_accounts id=1, id=2;
{
  "id": "1",
  "user_data": "0",
  "ledger": "700",
  "code": "10",
  "flags": "",
  "debits_pending": "0",
  "debits_posted": "10",
  "credits_pending": "0",
  "credits_posted": "0"
}
{
  "id": "2",
  "user_data": "0",
  "ledger": "700",
  "code": "10",
  "flags": "",
  "debits_pending": "0",
  "debits_posted": "0",
  "credits_pending": "0",
  "credits_posted": "10"
}

And indeed you can see that account 1 has debits_posted as 10 and account 2 has credits_posted as 10. The 10 amount is fully accounted for!

For further reading:

Next Steps

Watch an introduction to TigerBeetle on Zig SHOWTIME for our design decisions regarding performance, safety, and financial accounting primitives:

A million financial transactions per second in Zig

Read more about the history of TigerBeetle, the problem of balance tracking at scale, and the solution of a purpose-built financial accounting database.

Check out our DESIGN doc to see an overview of TigerBeetle's data structures, take a look at our roadmap, and join one of our communities to stay in the loop about fixes and features!

Documentation

Check out docs.tigerbeetle.com.

Here are a few key pages you might be interested in:

Clients

Community

Benchmarks

First grab the sources and run the setup script:

git clone https://github.com/tigerbeetle/tigerbeetle.git
cd tigerbeetle
scripts/install.sh

With TigerBeetle installed, you are ready to benchmark!

./tigerbeetle benchmark

Contributing

Read docs/HACKING.md.

Roadmap

See tigerbeetle#259.

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

tigerbeetle's People

Contributors

sentientwaffle avatar jorangreef avatar matklad avatar batiati avatar ifreund avatar kprotty avatar cb22 avatar eatonphil avatar jamii avatar koekiebox avatar donchangfoot avatar bors[bot] avatar chaitanyabhandari avatar sm2n avatar brson avatar bermi avatar barnarddt avatar adrianhopebailie avatar v0idpwn avatar wilsonianb avatar sabineschaller avatar joblerstune avatar lewisdaly avatar threefx avatar matdehaast avatar github-merge-queue[bot] avatar yusufpapurcu avatar yohdeadfall avatar rbino avatar poorlydefinedbehaviour avatar

Watchers

 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.