Skip to content

Commit

Permalink
[WUP] Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
exAspArk committed Feb 3, 2024
1 parent 274d8ea commit cd7401d
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 10 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ core-install:
core-test:
@devbox run "cd core && pnpm test"

worker-install:
@devbox run "cd worker && pnpm install" && \
cd worker && \
worker-setup:
@cd worker && \
([ ! -d debezium-server ] && \
curl -O https://repo1.maven.org/maven2/io/debezium/debezium-server-dist/2.5.0.Final/debezium-server-dist-2.5.0.Final.tar.gz && \
tar -xvf debezium-server-dist-2.5.0.Final.tar.gz && \
rm debezium-server-dist-2.5.0.Final.tar.gz) || true
worker-install: worker-setup
@devbox run "cd worker && pnpm install"
worker-up:
@devbox run "cd worker && pnpm concurrently -- \"pnpm:up:*\""

Expand Down
70 changes: 65 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,86 @@

# Bemi

## Running locally
Bemi automatically tracks database changes ensuring 100% reliability and a comprehensive understanding of every change. It does it by connecting PostgreSQL's [Write-Ahead Log](https://www.postgresql.org/docs/current/wal-intro.html) (WAL) and implementing [Change Data Capture](https://en.wikipedia.org/wiki/Change_data_capture) (CDC) data pattern. Designed with simplicity and non-invasiveness in mind, Bemi operates in the background and doesn't require any alterations to your existing database tables.

## Contents

- [Highlights](#highlights)
- [Use cases](#use-cases)
- [Quickstart](#quickstart)
- [Architecture](#architecture)
- [Testing](#testing)
- [License](#license)

## Highlights

- Automatic and 100% reliable database change tracking
- High performance without affecting runtime execution
- Easy-to-use without changing table structures
- Time travel querying and ability to easily filter changes
- Optional application-specific context by using [ORM packages](https://docs.bemi.io/#supported-nodejs-orms)

## Use cases

There's a wide range of use cases that Bemi is built for! The tech was initially built as a compliance engineering system for fintech that supported $15B worth of assets under management, but has since been extracted into a general-purpose utility. Some use cases include:

- **Audit Trails:** Use logs for compliance purposes or surface them to customer support and external customers.
- **Time Travel:** Retrieve historical data without implementing event sourcing.
- **Troubleshooting:** Identify the root cause of application issues.
- **Change Reversion:** Revert changes made by a user or rollback all data changes within an API request.
- **Distributed Tracing:** Track changes across distributed systems.
- **Testing:** Rollback or roll-forward to different application test states.
- **Analyzing Trends:** Gain insights into historical trends and changes for informed decision-making.

## Quickstart

### System dependencies

* [Node.js](https://github.com/nodejs/node)
* [NATS server](https://github.com/nats-io/nats-server)

You can install these system dependencies manually or use [Devbox](https://github.com/jetpack-io/devbox) which uses [Nix Packages](https://github.com/NixOS/nixpkgs) providing isolated shells without containerization.

### Installation

With directly installed Node.js:

```sh
make worker-setup && cd worker && npm install
```

Alternatively, with Devbox:

```sh
make worker-install
```

### Data change tracking

Set environment variables specifying PostgreSQL database connection settings:

```sh
export DB_HOST=127.0.0.1 DB_PORT=5432 DB_NAME=postgres DB_USER=postgres DB_PASSWORD=postgres
make worker-up
```

## Testing
Run all processes with directly installed Node.js:

```sh
make core-install
make core-test
cd worker && npm concurrently -- "npm:up:*"
```

Alternatively, with Devbox:

```sh
make worker-up
```

## Architecture

![Bemi Worker Architecture](docs/static/img/worker.png)



## License

Distributed under the terms of the [SSPL-1.0 License](/LICENSE). If you need to modify and distribute the code, please release it to contribute back to the open-source community.
5 changes: 3 additions & 2 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"packages": {
"nodejs": "latest",
"nats-server": "latest"
"nodejs": "latest",
"nats-server": "latest",
"nodePackages.pnpm": "latest"
}
}
20 changes: 20 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@
}
}
},
"nodePackages.pnpm@latest": {
"last_modified": "2024-01-23T02:13:08Z",
"resolved": "github:NixOS/nixpkgs/4d3d04cfd372a0511f12b885c9822e406b00fe8e#nodePackages.pnpm",
"source": "devbox-search",
"version": "8.14.0",
"systems": {
"aarch64-darwin": {
"store_path": "/nix/store/rw37gcc3m93kh2hq3pi8891g41p54518-pnpm-8.14.0"
},
"aarch64-linux": {
"store_path": "/nix/store/ab961l4fcs1n5ldfy4463kqr4pln1cxc-pnpm-8.14.0"
},
"x86_64-darwin": {
"store_path": "/nix/store/06qmz8k1gi9s68mcynlyis35w2pj6fl6-pnpm-8.14.0"
},
"x86_64-linux": {
"store_path": "/nix/store/pgzxiapcydn1mmqh1w4jkl9pcw7ybbj4-pnpm-8.14.0"
}
}
},
"nodejs@latest": {
"last_modified": "2023-11-19T17:46:56Z",
"resolved": "github:NixOS/nixpkgs/0bf3f5cf6a98b5d077cdcdb00a6d4b3d92bc78b5#nodejs_21",
Expand Down
5 changes: 5 additions & 0 deletions docs/docs/open-source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Open Source

<a class="github-button" href="https://github.com/BemiHQ/bemi" data-size="large" data-show-count="true" aria-label="Star BemiHQ/bemi on GitHub">BemiHQ/bemi</a>
<br />
<br />
1 change: 1 addition & 0 deletions docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const sidebars: SidebarsConfig = {
'orms/typeorm',
],
},
'open-source',
],
};

Expand Down

0 comments on commit cd7401d

Please sign in to comment.