Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Go言語でCQRS+ESの アプリを作ってみた
Search
Kizuku
March 14, 2025
800
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Go言語でCQRS+ESの アプリを作ってみた
Kizuku
March 14, 2025
Transcript
17 slides
Go言語でCQRS+ESの アプリを作ってみた イベントソーシング・CQRS勉強会 #1 Kizuku
Kizuku 九州工業大学 学部4年 →先日、上京 好きな言語: Go X: @Kizuku_tech 趣味: イベント・カンファレンス
参加/運営 自己紹介
今年の正月に CQRS+ESでアプリを作った
そこまで踏み込んだ 内容ではないです 🙇♂️
話すこと 実装ベースの説明 Goの実装で便利だったライブラリ Goの実装で楽だったこと/辛かったこと 話さないこと アプリの詳細 詳しい話(是非懇親会で!)
イベントストーミング Figjamを用いた 参考:イベントストーミング入門(なるセミ) https://youtu.be/jC9lE4YqgyY
技術構成 EventStore DynamoDB ReadModel TiDB GraphQL Next.js
使用ライブラリ event-store-adapter-go https://github.com/j5ik2o/event-store-adapter-go アクターシステムを用いずに Event Sourcingを行うライブラリ https://speakerdeck.com/j5ik2o/akutasisutemunilai -razuevent-sourcingsurufang-fa-nituite
Goの実装で楽だったこと Protocol Buffersとの親和性が高い lambdaの関連ライブラリが多く使いやすい
データのシリアライズ Protocol Buffersを用いてシリアライズ Goもprotobufも開発元が同じで親和性が高 い oneofフィールドがイベントのデータの取り 扱いと相性がいい
protobuf
データのシリアライズ bufを用いてコード生成 protoc-gen-goのプラグインを使用
Goの実装で辛かったこと 他言語と比べるとパターンマッチがやや貧弱 やや冗長な書き方が多くコードが長くなりが ち
Goでのパターンマッチング type switchで動的な型に応じた処理ができる
None
Goでのパターンマッチング Rustなどの言語のパターンマッチ機能と比べ るとGoはシンプルでわかりやすい 厳密性はないため、抜け漏れは発生しやすい
まとめ CQRS+ES 難易度が高いように見えるが、(簡 単な実装であれば)案外手は動く 難しい部分に関してはいろんな人がライブラ リを作ってくれている 好きな言語でトライしてみる!!
More Decks by Kizuku
See All by Kizuku
学生こそ ISUCONに出よう!
kizuku
1
140
WebTransportの パッケージを作った話
kizuku
0
140
きのこカンファレンス開催予告! - エンジニアがこの先生きのこるには -
kizuku
0
200
WebSocketで バイナリを扱う方法 + OSTやりたくない?
kizuku
1
92
WebTransportは未来の技術?
kizuku
2
2.4k
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
410
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
410
Product Roadmaps are Hard
iamctodd
55
13k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
49k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
250
The Cost Of JavaScript in 2023
addyosmani
56
10k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
610
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
660
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
640