Kafka implemented in Golang with built-in coordination (No ZK dep, single binary install, Cloud Native)
Jocko
Kafka/distributed commit log service in Go.
Goals of this project:
- Implement Kafka in Go
- Protocol compatible with Kafka so Kafka clients and services work with Jocko
- Make operating simpler
- Distribute a single binary
- Use Serf for discovery, Raft for consensus (and remove the need to run ZooKeeper)
- Smarter configuration settings
- Learn a lot and have fun
TODO
- [x] Producing
- [x] Fetching
- [x] Partition consensus and distribution
- [ ] Protocol
- [x] Discovery
- [ ] API versioning [more API versions to implement]
- [ ] Replication [first draft done - testing heavily now]
Hiatus Writing Book
Iβm writing a book for PragProg called Building Distributed Services with Go. You can sign up on this mailing list and get updated when the bookβs available. It walks you through building a distributed commit log from scratch. I hope it will help Jocko contributors and people who want to work on distributed services.
Reading
- How Jocko's built-in service discovery and consensus works
- How Jocko's (and Kafka's) storage internals work
Project Layout
βββ broker broker subsystem
βββ cmd commands
βΒ Β βββ jocko command to run a Jocko broker and manage topics
βββ commitlog low-level commit log implementation
βββ examples examples running/using Jocko
βΒ Β βββ cluster example booting up a 3-broker Jocko cluster
βΒ Β βββ sarama example producing/consuming with Sarama
βββ protocol golang implementation of Kafka's protocol
βββ prometheus wrapper around Prometheus' client lib to handle metrics
βββ server API subsystem
βββ testutil test utils
βββ mock mocks of the various subsystems
Building
Local
- Clone Jocko
$ go get github.com/travisjeffery/jocko
- Build Jocko
$ cd $GOPATH/src/github.com/travisjeffery/jocko
$ make build
(If you see an error about dep not being found, ensure that $GOPATH/bin is in your PATH)
Docker
docker build -t travisjeffery/jocko:latest .
Contributing
See CONTRIBUTING for details on submitting patches and the contribution workflow.
License
Jocko is under the MIT license, see the LICENSE file for details.
- travisjeffery.com
- GitHub @travisjeffery
- Twitter @travisjeffery
- Medium @travisjeffery