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
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
49
20210226_出張!Railsウォッチ in 銀座Rails#30
morimorihoge
0
510
Other Decks in Programming
See All in Programming
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
150
Patterns of Patterns
denyspoltorak
0
410
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
450
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
2k
SwiftUIで本格音ゲー実装してみた
hypebeans
0
550
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
550
PostgreSQLで手軽にDuckDBを使う!DuckDB&pg_duckdb入門/osc25hi-duckdb
takahashiikki
0
230
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
560
JETLS.jl ─ A New Language Server for Julia
abap34
2
470
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
690
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
870
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
1
880
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
110
Believing is Seeing
oripsolob
0
18
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
96
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.3k
The Limits of Empathy - UXLibs8
cassininazir
1
200
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Reality Check: Gamification 10 Years Later
codingconduct
0
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
までお 声かけください