MyGit

tigerbeetle/tigerbeetle

Fork: 520 Star: 10643 (更新于 2024-11-25 16:41:07)

license: Apache-2.0

Language: Zig .

The financial transactions database designed for mission critical safety and performance.

最后发布版本: 0.16.0 ( 2024-09-03 04:34:45)

官方网址 GitHub网址

tigerbeetle

TigerBeetle is a financial transactions database designed for mission critical safety and performance to power the next 30 years of OLTP.

Quickstart

First, download a prebuilt copy of TigerBeetle.

# macOS
curl -Lo tigerbeetle.zip https://mac.tigerbeetle.com && unzip tigerbeetle.zip && ./tigerbeetle version

# Linux
curl -Lo tigerbeetle.zip https://linux.tigerbeetle.com && unzip tigerbeetle.zip && ./tigerbeetle version

# Windows
powershell -command "curl.exe -Lo tigerbeetle.zip https://windows.tigerbeetle.com; Expand-Archive tigerbeetle.zip .; .\tigerbeetle version"

Want to build from source locally?

git clone https://github.com/tigerbeetle/tigerbeetle && cd tigerbeetle
./zig/download.sh # or .bat if you're on Windows.
./zig/zig build
./tigerbeetle version

Running TigerBeetle

Then create the TigerBeetle data file.

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

And start the replica.

./tigerbeetle start --addresses=3000 --development 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 flags=linked|history,
                  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;
  get_account_transfers account_id=1 flags=debits|credits;
  get_account_balances account_id=1 flags=debits|credits;
create_accounts id=1 code=10 ledger=700,
                id=2 code=10 ledger=700;

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 The Primeagen for our design decisions regarding performance, safety, and financial accounting debit/credit primitives:

The FASTEST and SAFEST Database

Read more about the history of TigerBeetle, the problem of balance tracking at scale, and the solution of a purpose-built financial transactions 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

Contributing

Read docs/HACKING.md.

Roadmap

See https://github.com/tigerbeetle/tigerbeetle/issues/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.

最近版本更新:(数据更新于 2024-09-09 08:50:48)

2024-09-03 04:34:45 0.16.0

2024-08-19 23:31:21 0.15.6

2024-08-12 22:54:29 0.15.5

2024-07-29 21:14:22 0.15.4

2024-03-19 17:51:08 0.15.3

2024-03-19 08:54:12 0.15.2

2024-03-19 06:31:29 0.15.0

2024-03-12 06:21:13 0.14.184

2024-03-05 05:10:28 0.14.183

2024-02-26 19:46:16 0.14.181

tigerbeetle/tigerbeetle同语言 Zig最近更新仓库

2024-11-29 19:55:48 oven-sh/bun

2024-09-07 03:02:03 andrewrk/poop

2024-06-07 14:02:54 ziglang/zig

1970-01-01 00:00:00 zigcc/zig-cookbook

1970-01-01 00:00:00 kubkon/zig-wasi-tutorial