Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Wprowadzenie do Watermill GoCracow
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Robert Laszczak
November 05, 2019
Programming
37
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Wprowadzenie do Watermill GoCracow
Robert Laszczak
November 05, 2019
More Decks by Robert Laszczak
See All by Robert Laszczak
Let's build event-driven application in 15 minutes - introduction to Watermill
roblaszczak
0
830
Wprowadzenie do Watermill - Gophers Silesia
roblaszczak
1
73
Event-driven application made easy with Watermill
roblaszczak
1
250
Tactical DDD patterns in Go
roblaszczak
0
110
Other Decks in Programming
See All in Programming
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
9
5.8k
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
560
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
370
Foundation Models frameworkで画像分析
ryodeveloper
1
160
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
180
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
290
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
280
メールのエイリアス機能を履き違えない
isshinfunada
0
160
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
230
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
3.2k
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
190
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
750
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
7k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
45k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Google's AI Overviews - The New Search
badams
0
1.1k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
640
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.8k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
190
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
350
Unsuck your backbone
ammeep
672
58k
Transcript
roblaszczak Wprowadzenie do Watermill zbudujmy aplikację opartą o eventy w
30 minut
roblaszczak About me • I’m Robert • Tech Lead @
• Blogging at https://threedots.tech/ • @roblaszczak at
roblaszczak Cascading failures
roblaszczak
roblaszczak
roblaszczak
roblaszczak PROBLEM?
roblaszczak BUILDING EVENT-DRIVEN APPLICATIONS IS NOT EASY
roblaszczak Building applications based on Kafka is not easy •
Consumer groups • Partitioning • At-least-once delivery • Message Ack and Nack support • Not losing any message • Not everyone is familiar with event-driven architecture
roblaszczak How to make building event-driven applications easy in Go?
roblaszczak Watermill
roblaszczak 1.4k GitHub Stars
roblaszczak 16 Contributors
roblaszczak 8 Supported Pub/Subs
roblaszczak
roblaszczak Watermill is a library Watermill is not a framework
roblaszczak
roblaszczak HOW?
roblaszczak Unix philosophy (1978) • Write programs that do one
thing and do it well. • Write programs to work together. • Write programs to handle text streams message, because that is a universal interface.
roblaszczak type Publisher interface { Publish(topic string, messages ...*Message) error
Close() error } type Subscriber interface { Subscribe(ctx context.Context, topic string) (<-chan *Message, error) Close() error }
roblaszczak type HandlerFunc func(msg *Message) ([]*Message, error)
roblaszczak
roblaszczak
roblaszczak
roblaszczak
roblaszczak Testing
roblaszczak func TestPublishSubscribe(t *testing.T) { features := tests.Features{ ConsumerGroups: true,
ExactlyOnceDelivery: false, GuaranteedOrder: false, Persistent: true, } tests.TestPubSub( t, features, createPubSub, createPubSubWithConsumerGrup, ) }
roblaszczak var stressTestTestsCount = 10 func TestPubSubStressTest( t *testing.T, features
Features, pubSubConstructor PubSubConstructor, consumerGroupPubSubConstructor ConsumerGroupPubSubConstructor, ) { for i := 0; i < stressTestTestsCount; i++ { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { t.Parallel() TestPubSub(t, features, pubSubConstructor, consumerGroupConstructor) }) } }
roblaszczak
roblaszczak How fast is Watermill?
roblaszczak Pub/Sub Publish (messages / s) Subscribe (messages / s)
Kafka 70,252 117,529 NATS 76,208 38,169 SQL (MySQL) 6,989 143 Google Cloud Pub/Sub 7,416 39,591 AMQP 2,408 10,608
roblaszczak Pub/Sub Publish (messages / s) Subscribe (messages / s)
Kafka 70,252 117,529 NATS 76,208 38,169 SQL (MySQL) 6,989 143 Google Cloud Pub/Sub 7,416 39,591 AMQP 2,408 10,608
roblaszczak Pub/Sub Publish (messages / s) Subscribe (messages / s)
Kafka 70,252 117,529 NATS 76,208 38,169 SQL (MySQL) 6,989 143 Google Cloud Pub/Sub 7,416 39,591 AMQP 2,408 10,608
roblaszczak The first rule of live coding
roblaszczak Don’t do livecoding The first rule of live coding
roblaszczak Not covered • It’s even hard to show everything
in 20 minutes :) • Kafka and Google Cloud Pub/Sub internals • At-least-once delivery • CQRS component • Go to watermill.io !
roblaszczak
roblaszczak
roblaszczak Thanks for all contributors!
roblaszczak roblaszczak https://watermill.io/ https://threedots.tech/ THANKS!
roblaszczak Photo by Micheile Henderson @micheile010 // Visual Stories [nl]
on Unsplash Photo by Thomas Ehling on Unsplash