ThreeDotsLabs/watermill là dự án Backend trên GitHub, viết chủ yếu bằng Go, với 10.0k sao. Building event-driven applications the easy way in Go.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Watermill is a Go library for working efficiently with message streams. It is intended
for building event driven applications, enabling event sourcing, RPC over messages,
sagas and basically whatever else comes to your mind. You can use conventional pub/sub
implementations like Kafka or RabbitMQ, but also HTTP or PostgreSQL if that fits your use case.
Goals
Easy to understand.
Universal - event-driven architecture, messaging, stream processing, CQRS - use it for whatever you need.
Fast (see Benchmarks).
Flexible with middlewares, plugins and Pub/Sub configurations.
Resilient - using proven technologies and passing stress tests (see Stability).
Getting Started
Pick what you like the best or see in order:
Quickstart — learn by coding!
Follow the Getting Started guide.
See examples below.
Read the full documentation: https://watermill.io/
Our online hands-on training
Go Event-Driven goes beyond Watermill Quickstart. You'll learn industry standard concepts and patterns like:
Handling at-least-once delivery
Asynchronous read models
Events & Commands
Observability
Message ordering
Sagas
Examples
Basic
Your first app - start here!
Realtime feed
Router
Metrics
CQRS with protobuf
Pub/Subs usage
These examples are part of the Getting started guide and show usage of a single Pub/Sub at a time.
Real-world examples
Exactly-once delivery counter
Receiving webhooks
Sending webhooks
Synchronizing Databases
Persistent Event Log
Transactional Events
Real-time HTTP updates with Server-Sent Events
Real-time HTTP updates with Server-Sent Events and htmx
Complete projects
NATS example with live code reloading
RabbitMQ, webhooks and Kafka integration
Background
Building distributed and scalable services is rarely as easy as some may suggest. There is a
lot of hidden knowledge that comes with writing such systems. Just like you don't need to know the
whole TCP stack to create a HTTP REST server, you shouldn't need to study all of this knowledge to
start with building message-driven applications.
Watermill's goal is to make communication with messages as easy to use as HTTP routers. It provides
the tools needed to begin working with event-driven architecture and allows you to learn the details
on the go.
At the heart of Watermill there is one simple interface:
func(*Message) ([]*Message, error)
Your handler receives a message and decides whether to publish new message(s) or return
an error. What happens next is up to the middlewares you've chosen.
You can find more about our motivations in our Introducing Watermill blog post.
Pub/Subs
All publishers and subscribers have to implement an interface:
All Pub/Subs implementation documentation can be found in the documentation.
Unofficial libraries
Can't find your favorite Pub/Sub or library integration? Check Awesome Watermill.
If you know another library or are an author of one, please add it to the list.
Contributing
Please check our contributing guide.
Stability
Watermill v1.0.0 has been released and is production-ready. The public API is stable and will not change without changing the major version.
To ensure that all Pub/Subs are stable and safe to use in production, we created a set of tests that need to pass for each of the implementations before merging to master.
All tests are also executed in stress mode - that means that we are running all the tests 20x in parallel.
All tests are run with the race condition detector enabled (-race flag in tests).
For more information about debugging tests, you should check tests troubleshooting guide.
Benchmarks
Initial tools for benchmarking Pub/Subs can be found in watermill-benchmark.
All benchmarks are being done on a single 16 CPU VM instance, running one binary and dependencies in Docker Compose.
These numbers are meant to serve as a rough estimate of how fast messages can be processed by different Pub/Subs.
Keep in mind that the results can be vastly different, depending on the setup and configuration (both much lower and higher).
Here's the short version for message size of 16 bytes.
Pub/Sub
Publish (messages / s)
Subscribe (messages / s)
GoChannel
315,776
138,743
Redis Streams
59,158
12,134
NATS Jetstream (16 Subscribers)
50,668
34,713
Kafka (one node)
41,492
101,669
SQL (MySQL, batch size=100)
6,371
2,794
SQL (PostgreSQL, batch size=1)
2,831
9,460
Google Cloud Pub/Sub
3,027
28,589
AMQP (RabbitMQ)
2,770
14,604
Support
If you didn't find the answer to your question in the documentation, feel free to ask us directly!
Please join us on the #watermill channel on the Three Dots Labs Discord.
ThreeDotsLabs/watermill có 10.0k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/ThreeDotsLabs/watermill. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
ThreeDotsLabs/watermill còn đang phát triển không?
Commit gần nhất trên ThreeDotsLabs/watermill là 6 tháng trước (theo timestamp GitHub). Repo có 513 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
ThreeDotsLabs/watermill là gì?
ThreeDotsLabs/watermill (ThreeDotsLabs/watermill) là dự án Go trên GitHub. Theo mô tả gốc: Building event-driven applications the easy way in Go.
ThreeDotsLabs/watermill so với các dự án Backend khác thế nào?
ThreeDotsLabs/watermill được TopGit xếp vào nhóm Backend, với 10.0k sao GitHub và viết bằng Go. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
ThreeDotsLabs/watermill viết bằng ngôn ngữ gì?
ThreeDotsLabs/watermill chủ yếu viết bằng Go. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Vì sao ThreeDotsLabs/watermill được xếp vào nhóm Backend?
TopGit xếp ThreeDotsLabs/watermill vào nhóm Backend dựa trên GitHub topics và mô tả của repo (gắn thẻ: "cqrs", "event-driven", "event-sourcing"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc watermill có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về watermill.