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
20251016_Rails News ~Rails 8.1の足音を聴く~
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Masato Mori
October 15, 2025
Programming
3
1.2k
20251016_Rails News ~Rails 8.1の足音を聴く~
2025/10/16に開催した RailsTokyo #1 で発表した資料です。
https://railstokyo.connpass.com/event/363339/
Masato Mori
October 15, 2025
Tweet
Share
More Decks by Masato Mori
See All by Masato Mori
20220218_Rails開発プロジェクトチームの始め方と入り方 in 銀座Rails#42
morimorihoge
3
590
20220125_令和版!RailsアプリでPDF生成するテクニック集 in 銀座Rails#41
morimorihoge
8
7k
それVIEWでできるよ!(Kaigi on Rails _2021_ new LT)
morimorihoge
2
160
20210827_出張!Railsウォッチ in 銀座Rails#36
morimorihoge
0
2k
20210730_出張!Railsウォッチ in 銀座Rails#35
morimorihoge
0
1.8k
20210618_出張!Railsウォッチ in 銀座Rails#34
morimorihoge
0
2.3k
20210521_出張!Railsウォッチ in 銀座Rails#33
morimorihoge
1
7.1k
20210423_出張!Railsウォッチ in 銀座Rails#32
morimorihoge
0
49
20210226_出張!Railsウォッチ in 銀座Rails#30
morimorihoge
0
510
Other Decks in Programming
See All in Programming
.NET Conf 2025 の興味のあるセッ ションを復習した / dotnet conf 2025 quick recap for backend engineer
tomohisa
0
120
AtCoder Conference 2025
shindannin
0
1k
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.6k
ThorVG Viewer In VS Code
nors
0
750
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
340
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
360
Apache Iceberg V3 and migration to V3
tomtanaka
0
120
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
200
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
280
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
570
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
670
Featured
See All Featured
For a Future-Friendly Web
brad_frost
182
10k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
150
Fireside Chat
paigeccino
41
3.8k
Rails Girls Zürich Keynote
gr2m
96
14k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
45
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
110
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
230
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.5k
How Software Deployment tools have changed in the past 20 years
geshan
0
31k
We Are The Robots
honzajavorek
0
150
BBQ
matthewcrist
89
10k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2k
Transcript
Rails News ~Rails 8.1の足音を聴く~ ~Structured Event Reporting解説~ ver. RailsTokyo #1
2025/10/16 森 雅智 / @morimorihoge 2025/10/16
• Web受託開発や自社サービス開発・運営をやっている会社です • TechRachoという自社技術Blogを運営しています ◦ 10年ほど前から平日毎日更新 してます ◦
https://techracho.bpsinc.jp/ • お仕事相談、転職相談、TechRachoへのご意見など気軽にどうぞ ◦ https://www.bpsinc.jp/ About Me • 森 雅智: @morimorihoge • BPS株式会社でRailsの受託開発チームをやってたり、週1大学非常勤でWeb開発を教えてたり します • Ruby/Rails歴は15年くらい。Web開発は20年くらい • 主にリモート開催時代に力尽きるまで銀座Railsを運営していました 🙏💦 • RailsTokyoではチームの力でやっていけるように強力していきます 💪 About BPS & TechRacho
About TechRacho 毎日更新の技術ブログです。Railsネタ多めなのでぜひBookmark & 購読してください😎
Rails 8.1の足音を聴く
【NEW】2025/10/15: Rails 8.1.0.rc1 リリース!
Rails 8.1の新機能(抜粋) • Active Job Continuations ◦ 大きなJobをstepごとに記述しておく ことで、一時停止・再開可能 に
• Active Record Tenanting: Codeminerの詳しいやってみた記事 ◦ テナントごとにDBを分ける 機能。現状SQLite3環境のみサポート • Action Push Native ◦ iOS/Android環境にAPNs / FCMを使ってpush通知する機能 • Lexxy (early beta): ※ちょっとデモする ◦ Action Textで現在のTrixを将来置き換えていく予定のよりリッチな WYSIWYGエディタ。PDFや動画 のプレビュー対応・”/” “@” によるイマドキのprompt / mention入力アシストなどもできるらしい • Structured Event Reporting ◦ -> 本日pickupして解説します • その他 ◦ Local CI、Markdown Rendering、Kamalの改善など 参考: https://rubyonrails.org/2025/9/4/rails-8-1-beta-1 https://blog.codeminer42.com/whats-new-in-rails-8-1-and-its-ecosystem など
Structured Event Reporting • 構造化したアプリケーションイベントをPub / Subする仕組み • Rails.eventを通じて利用することができる ◦
Event Reporterと呼ばれている機能 • ビジネスロジック的に取りたいイベントや、特定の問題調査などに利用できる • アプリケーションイベントの例 ◦ 商品を購入した ◦ 商品を閲覧した ◦ ユーザーがN日ぶりにログインした ◦ 商品のお気に入り登録数が 100を超えた
🤔ActiveSupport::Notificationsと何が違うの? • 以前からあるAS::NotificationsもPub/Subの仕組みを持っている • 今までも以下のような形でアプリケーションイベントを取ることはできた
Structured Event Reporting版
Structured Event Reporting版 Subscriber登録型に contextやtagを柔軟に設定可能に
AS::Notificationsに対する機能上の優位点 • pub / subするchannelの指定が柔軟 ◦ AS::Notificationsは文字列でしか指定できない : “sql.active_record” “enqueue_at.active_job”
◦ Structured Event Reportingはtags / contextの仕組みがあり、より柔軟な仕様が用意されている • tags / contextの指定方法が柔軟 ◦ AS::Notificationsは #instrument 呼び出し時にpayload内をすべて構築する必要がある ◦ Structured Event Reporting は #set_context でglobalな値を設定できたり、 #tagged を使ってブ ロック内でのみ当該tagを効かせるということができる ▪ before_actionやmiddlewareでcontextを設定できる
おそらくこんな使い方が想定されているのだろう(私見) • AS::Notifications ◦ これまでもログとして出力されているような Railsのシステム的な処理を扱う ◦ アプリケーションエラーや Jobの投入・実行状況などを扱う •
Structured Event Reporting ◦ よりビジネスレイヤや運用者視点でのイベントを扱う ◦ アプリケーションログとは別の LogStreamとしてCloudWatch Logsに流し、JSONログとして解析す るとか ◦ OpenTelemetryやDatadogにメトリクスを送信し、いい感じの Dashboardを作って閲覧するとか
その他気づいたこと • Loggingの置き換えではないので、JSON Logを出力したいという場合はJSON Loggerなどと組み合わせる必要がある ◦ JSONSubscriberなどを作ってsubscribeさせるイメージ • Subscriberの呼び出しは同期処理なので、重い処理を書くとレスポンス速度に影 響が出る
◦ AS::Notificationsと同じ。どうしても時間のかかる処理がしたければ Subscriber#emit 内で新しい スレッドを立てるなり、 Jobに詰むなりが必要 • tags / contextは柔軟な実装ができるが、収集・分析する側の問題もあるのでデー タ設計は慎重に ◦ contextのデータ構造を変えたら過去のデータと互換性がなくなってしまうので注意
まとめ • Rails 8.1のリリースが秒読みに入ったので、まだの人はそろそろキャッチアップ を! • 感想・リクエストなどあればXにて #railstokyo_meetup や @morimorihoge
までお 声かけください