Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
thevilledev committed Oct 27, 2024
1 parent e09d58e commit a601d76
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![test](https://github.com/thevilledev/gonsensus/actions/workflows/test.yml/badge.svg)](https://github.com/thevilledev/gonsensus/actions/workflows/test.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/thevilledev/gonsensus)](https://goreportcard.com/report/github.com/thevilledev/gonsensus)

"Gonsensus" is a distributed consensus implementation, written in Go, using S3 conditional operations for leader election. It provides a simple, reliable way to coordinate distributed systems using *any* S3 compatible object storage as the backing store. Conditional writes are required. See [RFC 7232](https://datatracker.ietf.org/doc/html/rfc7232) for more details about conditional requests in general.
**Gonsensus** is a distributed consensus implementation, written in Go, using S3 conditional operations for leader election. It provides a simple, reliable way to coordinate distributed systems using *any* S3 compatible object storage as the backing store. Conditional writes are required. See [RFC 7232](https://datatracker.ietf.org/doc/html/rfc7232) for more details about conditional requests in general.

See [example_test.go](example_test.go) for a fully fledged example use case.

Expand All @@ -18,6 +18,28 @@ See [example_test.go](example_test.go) for a fully fledged example use case.
- Thread-safe operations
- No external dependencies beyond AWS SDK

## How it works

Gonsensus uses atomic operations to implement a distributed lock mechanism:

### Lock Acquisition

- Nodes attempt to create a lock file in S3
- Only one node can hold the lock at a time
- Lock includes expiry time and version information

### Leader Maintenance

- Leader renews lock every TTL/3 period
- Uses versioning to ensure atomic updates
- Automatic failover if leader fails to renew

### Lock Release

- Automatic on process termination
- Clean shutdown on signals
- Other nodes can take over after TTL expiry

## Installation

```bash
Expand Down Expand Up @@ -104,27 +126,7 @@ export AWS_PROFILE=xyz
make test-acc
```

## How it works

Gonsensus uses atomic operations to implement a distributed lock mechanism:

### Lock Acquisition

- Nodes attempt to create a lock file in S3
- Only one node can hold the lock at a time
- Lock includes expiry time and version information

### Leader Maintenance

- Leader renews lock every TTL/3 period
- Uses versioning to ensure atomic updates
- Automatic failover if leader fails to renew

### Lock Release

- Automatic on process termination
- Clean shutdown on signals
- Other nodes can take over after TTL expiry
Note that acceptance tests require a bucket with the name of "my-bucket-1".

## License

Expand Down

0 comments on commit a601d76

Please sign in to comment.