Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
20251016_Rails News ~Rails 8.1の足音を聴く~
Search
Masato Mori
October 15, 2025
Programming
3
1.1k
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.2k
20210521_出張!Railsウォッチ in 銀座Rails#33
morimorihoge
1
7k
20210423_出張!Railsウォッチ in 銀座Rails#32
morimorihoge
0
47
20210226_出張!Railsウォッチ in 銀座Rails#30
morimorihoge
0
510
Other Decks in Programming
See All in Programming
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
190
ゲームの物理 剛体編
fadis
0
350
関数実行の裏側では何が起きているのか?
minop1205
1
700
Go コードベースの構成と AI コンテキスト定義
andpad
0
130
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
2
220
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.6k
AIコーディングエージェント(skywork)
kondai24
0
180
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
180
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
340
FluorTracer / RayTracingCamp11
kugimasa
0
230
TestingOsaka6_Ozono
o3
0
160
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
340
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.7k
The Cult of Friendly URLs
andyhume
79
6.7k
Rails Girls Zürich Keynote
gr2m
95
14k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
Embracing the Ebb and Flow
colly
88
4.9k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
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
までお 声かけください