TECH PLAY

KINTOテクノロジーズ

KINTOテクノロジーズ の技術ブログ

969

この記事は KINTOテクノロジーズアドベントカレンダー2025 の17日目の記事です🎅🎄 1.はじめに こんにちは! KINTOテクノロジーズのデジタル戦略部DataOpsG所属の上平です。 普段は社内のデータ分析基盤と「cirro」というAIを活用した社内アプリの開発・保守・運用を担当しています。 以前、下記の記事で、Strands Agentsの導入前の検証事例をご紹介させていただきました。 https://blog.kinto-technologies.com/posts/2025-07-18-try-strands-agent/ 当時より発展し、現在「cirro」はAmazon Bedrock × Strands Agentsという構成になっています。 本記事では、「cirro」にStrands Agentsを利用し、GA4への問い合わせ画面を構築した事例を紹介します。 2.本記事の対象者 本記事は、Amazon BedrockをConverse APIやInvoke Model経由で利用した経験があり、 Strands Agents等エージェント開発SDKへの切り替えを迷っている方が対象となります。 3.GA4への問い合わせ画面構築の背景、概要 3.1.背景 GA4 (Google Analytics 4) は、Webサイトやアプリに 「誰が」「どこから来て」「何をしたか」 という、 訪問者のアクセス状況を分析できる非常に便利なサービスです。 しかし、その分析できる項目の種類があまりにも多いため、 初めて使う方にとっては、どこを見たらいいのか、どうデータを読み解けばいいのか、かなり難しいです。 GA4のデータは、主に次の2種類の要素で構成されています。 ディメンション:データを分類したり切り口としたりする「属性」を示す項目です。 「どこから」アクセスしたか(例:Google検索、Twitterなど) 「どの国・地域」から来たか 「どのページ」を見たか 「どんなデバイス」を使ったか(例:スマートフォン、PC) メトリクス:具体的な量や頻度を表す「数値」を示す項目です。 Webサイトへのアクセス数(セッション数) 特定のページが表示された回数(表示回数) ユーザーがサイトに滞在した時間 サイトを訪れたユーザーの数 これらのディメンションやメトリクスの項目が200項目・300項目の規模で存在するため、 慣れていないと欲しい情報にたどり着くこと自体が課題です。 Google公開資料:アナリティクスのディメンションと指標 この課題について、例えば「今週のアクティブユーザ数が知りたい」「アクセス数が多いページは?」等、 自然言語で問い合わせできるようになれば、サイトやアプリの管理者が簡単に傾向を見ることができ 改善に役立つのでは…と構築に着手しました。 3.2.概要 GA4への問い合わせ画面は、よくあるシンプルなチャット画面です。 以下の流れでユーザの問い合わせに対し、GA4の内容を応答します。 ユーザの問い合わせを入力 AIがGA4のAPIから現在有効なディメンションとメトリクスの一覧を取得 AIが適したディメンションとメトリクスを選択し、GA4へ問い合わせる GA4の結果をAI側で表示用の形式に変換し、回答を出力 シンプルですが、ユーザはディメンションやメトリクスを把握せずともAIを介してGA4のデータにアクセスできます。 初心者には単純にデータアクセスの補助として、 ディメンションやメトリクスを全て把握していない中級者の方には、 どの項目で必要なデータが取得できそうかの当たりをつけることに役立ちます。 4.要素技術・アーキテクチャの紹介 ここからは、「GA4への問い合わせ画面」を構築時に使用した要素技術やアーキテクチャをご紹介していきます。 4.1.Strands Agentsとは? 2025年5月16日にAWS Open Source Blogで公開されたオープンソースのAIエージェントSDKです。 以下は、AWSのAmazon Web Services ブログで公開されている図です。 図のように、ツールを備えたAIを実装するには、Agentic Loopと呼ばれるループ処理が必要です。 この処理では、AIの応答がユーザーへの回答なのか、ツールを使ってさらに処理を進めるべきかを判断します。 Strands Agentsを使えば、このループ処理を開発者が自前で実装することなく、AIエージェントを構築できます。 参考、図の出典:Strands Agents – オープンソース AI エージェント SDK の紹介 4.2.cirroってどんなサービス? 私の所属するDataOpsGでは下記ミッションを目的に活動しています。 「全社のデータを分析用に整備、AI-Readyなデータ分析基盤を提供することでデータドリブンな意思決定を支援する」 AIは、非エンジニアでも容易にデータにアクセスするための入り口として注目しており、 cirroはDataOpsGで独自に開発・運用している生成AIの活用基盤です。 UI等可能な限り共通化し、チャットや問い合わせ画面のような画面構成であれば、 プロンプトと参照データの追加のみで 金太郎飴的に量産できる構成となっています。 図のように、①UI/コンピューティング機能と、②システムプロンプトや参照データを分離し、 ②を切り替えることで1つのシステムで複数のAIの機能を実現しています。 また、URLパラメータで使用するツールを指定することができ、ツールを持ったAIエージェントとして稼働することも可能です。 今回はこの機能を利用し、cirroでGA4への問い合わせ画面を構築しました。 4.3.GA4の問い合わせ用のツール Googleが公開する2つのAPIをStrands Agentsが使用するツールとしてラップし構築しました。 cirroはツールを使用して、「利用できるディメンションとメトリクスの取得」と「ユーザの質問に合ったデータをGA4から取得」を実現しています。 4.3.1.getMetadata GA4で使用できるメトリクスとディメンションを取得するAPI getMetadata詳細 4.3.2.runReport 指定したプロパティID、メトリクス、ディメンション等から、合致するデータを取得するAPI runReport詳細 5.実装時のポイント 本記事では、MCPを使用せずツールの形で機能追加を実現しました。 ここではMCPを使用しなかった理由や、ツールでの実装を採用したメリットをご紹介します。 5.1.MCPを使用しなかった理由 cirroはLambdaがコンピューティングエンジンです。 そもそもがツールでできることについて、より工数をかけてMCPサーバを立てることにメリットを見いだせなかった背景もありますが、 Lambda主体とすることで以下の課題があり、確実に機能提供するためツールでの実装を採用しました。 Lambdaでの起動方法や、起動時のオーバヘッドの課題 Googleが公開するMCPサーバはローカル稼働前提になっている 別途ECS等を使用し自前でリモートサーバとして用意する方法もあるが、Lambda主体の維持管理が容易なcirroのコンセプトと異なる。 Lambdaの特性上、うまくMCPサーバと通信できるかの課題 MCPサーバとAIの通信は、調べる限り別プロセスを立ち上げ、標準出力を介してやり取りしている。 Lambda上でMCPサーバと通信できるか調査期間では確証が持てなかった。 5.2.ツールでの実装を採用したメリット ツールとして実装することによるメリットもありました。 5.2.1.クレンジング処理の追加が容易 API「getMetadata」は大量のディメンションやメトリクスの内容を応答します。 おそらくすべてのディメンションやメトリクスが必要なケースは少ないのではないでしょうか? 私の環境でも、使用していなかったり、想定するユーザ(GA4初心者)にとって不要と思われる項目を、 ツール内で除去しています。 AIに与える情報を削減することで、精度の向上や応答速度、トークン消費量を抑える工夫をしました。 5.2.2.カスタムが容易 ローカルでも稼働するツールとすることで、実装と確認を容易にしました。 また各クライアントで資源を共有するMCPサーバでなく、ツールとして独立するため、 案件ごとの個別の変更を他に影響なく実施できます。 修正前後の比較も、新たなツールと旧ツールそれぞれ共存させ、確認することが容易です。 5.2.3.親子構成のマルチエージェントが構築しやすい ツールはただの関数です。当然関数内でBedrock等AIのサービスを呼び出すことができます。 AIを呼び出すツールを用意すれば、メインのAIとツール内の子AIが存在するマルチエージェントの構成が組めます。 本記事では採用しませんでしたが、例えば自由記述の文面の前処理や、AIの出力内容のチェック等、 ロジックベースの処理では難しい内容を子エージェント側で処理させるようなこともできそうだ…と考えています。 MCPが注目される昨今ですが、ツールにはツールのメリットがあり小規模で個別開発が発生するようなケースの場合、 まだまだツールでの実現の選択肢は残るだろうな...と個人的には思っています。 6.おわりに 今回は、デジタル戦略部で展開しているAI活用システム「cirro」を活用し、 GA4への問い合わせ画面を構築した事例を紹介させていただきました。 「AIにツールを持たせる」というと難しく感じるかもしれませんが、Strands Agentsを使えば驚くほどシンプルです。 元々「Converse API」を使用したただのチャットボットだったcirroが、 「Strands Agents」に切り替えるだけで、ツールを使ってAPIを呼び出すエージェントに進化しました。 AIエージェント開発に興味はあるけれど、何から始めればいいか分からない...という方は、 まずStrands Agentsで簡単なツールを1つ持たせてみることから始めてみてはいかがでしょうか? きっと、AIができることの幅が一気に広がる体験ができると思います。
アバター
この記事は KINTOテクノロジーズ Advent Calendar 2025 の17日目の記事です🎅🎄 Engineering OfficeのNaitoです。KINTOテクノロジーズ(以下、KTC)には4つの2025年注力テーマ(インテンシティ、AIファースト、ユーザーファースト、リリースファースト)があります。 以前のブログ で2025年注力テーマの1つ、リリースファーストについてお伝えしました。 今回はリリースファーストにまつわるこの1年の取り組みや変化について紹介します。 最初に認識合わせをしておくと、KTCではリリースファーストは、「アイディア創出からリリースまでの期間を短くし、ユーザー・顧客に早く価値を提供する」としています。 2025年1月〜3月 Engineering Officeが立ち上がりました。 メンバーは ahomu と私(当時入社3ヶ月)の2人です。 Findy Team+の導入・活用支援という切り口で開発チームとの対話を通し、各チームの状況やメンバーのことを知り始めた状態で、その結果わかったことは以下のようなことでした。 自分たちの現状を定量的に把握できているのは一部のチームにとどまっている Findy Team+を導入したが、うまく計測・可視化できないチームもある Findy Team+の1機能である、プロセスタイム分析(JiraをINPUTとして各工程ごとのリードタイム)の計測・可視化ができるチームはゼロ 開発パフォーマンスの計測・可視化に取り組んでいるチームにおいても一部の人で計測データを見て試行錯誤しながら、改善活動に取り組んでいる。チーム全体には広がっていない 計測・可視化に関心があっても先行しているチームがどんな状況なのかはわからず、情報収集ができない 現在(2025年末) Engineering Officeはなんと4名に増えました。それぞれの専門領域を最大限発揮しつつ、コラボレーションしてチームで活動しています。 「一緒にやろう」と複数チームから声をかけていただき(ありがたい!)、私たちはこの1年間で約20チームに関わらせていただきました。 各チームは、 注力テーマに紐づいた目標を設定し、取り組んでいる リリースファーストの第一歩は自分たちの現状を定量的に定性的に把握することからという意識が全社に広がっており、社内の主なプロダクト、開発チームはFindy Team+を導入して開発パフォーマンスの計測を行っている Findy Team+ではFour Keysについては全チームが計測可能な状態になっている Findy Team+を見て話し合うことがチーム全体に広がっているところも増え、改善事例が少しずつ共有されている Findy Team+の1機能である、プロセスタイム分析(JiraをINPUTとして各工程ごとのリードタイム)は3プロダクトが計測できている チームを超えたリリースファーストのタスクフォースが発足し、業務のかたわら、プロダクト横断でリリースファーストを実現するための仕組みづくりを実施中 ある部門では部門全体で役割分担や開発プロセスを見直し、役割間・チーム間のコラボレーションを強化中 チームのレビュープロセスを見直した結果、レビュー時間が向上した事例 この変化がどうやって起こったのか?正直、各チームの頑張りの賜物なわけですが。Engineering Office(横軸組織)から見た目線でお伝えしていきたいとおもいます。 注力テーマを理解する 各プロダクトにおいては注力テーマの意味はなんとなくわかるけど具体的にどういうこと?というのが当時の状況でした。 そのため、最初の2−3ヶ月は推進メンバー全員で注力テーマについて社内に浸透させるところから始まりました。 まずは社内で言葉の認識合わせを行い、「なぜこれがいまKTCにとって大事なのか」また「リリース期間だけ短くなればよいということではなく、ユーザー・顧客に向き合い、価値を提供することに意味がある」「ユーザーファーストをないがしろにしてリリースを優先しても技術的負債になってしまう」ということを伝える活動を続けました。 プロダクトやチームごとに自分たちにとってのリリースファーストを考える 注力テーマについて各人が理解すると、次はプロダクトごと、チームごとに自分たちは注力テーマを実現するために何をしたらいいのか?自分たちの現状ってどんな感じなのか?ということが話し合われました。 各方面で注力テーマについて考えた結果、私のところにも以下のような声が届いてきました。 リリースが早くなったかどうかBefore/Afterをわかるようにしたい AIを活用して実装スピードあげたい リリースまでの流れってどうなっているのか 統合テストに時間かかっている ユーザーが遠くて価値が届いているのかわからない 設計・実装より前のフェーズにボトルネックがあるように思うが計測できていない 自チームだけでは前に進めるのは難しい。関係者で集まって話し合いたい こういった課題感共有や話し合いを経て、プロダクトやチームで注力テーマを実現するための自分たちのチームの目標を定めていきました。 取り組み 以下はリリースファーストに関する取り組みの一部です。複数のチームで同様の取り組みをしているケースもあります。 なぜ開発パフォーマンスを計測するのかとFindy Team+導入の説明会 GitHubのブランチ戦略・運用ルール変更 PRレビュープロセスの改善 Findy Team+を見合う会 チームのケイパビリティの可視化 Jiraを使った工程ごとのリードタイムの計測(そのためにJiraの運用ルール見直し) 全社横断でのAI利活用状況の計測・可視化 Value Streamの可視化 部門全体でのValue Streamの改善 アジャイルトレーニングの実施 ユーザー視点で要求を整理し、PRDを作成するワークの実施 プロダクト毎のテスト環境構築 インシデント対応プロセス改善 テストデータ作成方法の見直し Techラウンドテーブル(チーム間の情報共有) トヨタ生産方式勉強会入門編 ここに挙げたのは私が関わった取り組みだけですので、社内には他にもたくさんの取り組みがあります。 ボトルネックを特定し、Value Streamを改善した事例 Techラウンドテーブル @Osaka Tech Lab まとめ 上記のような取り組みを1年間繰り返し続けてきた結果が冒頭のような変化に繋がっています。 当初のリリースファーストの目標を実現しているチームもまだ途中のチームもいますが、どのチームも自分たちの行動で起きた変化は実感していることとおもいます。 社内の風土としてボトムアップで様々なことが進むことが多いです。そのため、今回の注力テーマの各取り組みにおいてもまずは自分のチームの範囲でやってみようという形で始まることが大半でした。 一方で、KTCのプロダクトは複数のチームで構成されていることが多いです。リリースファーストやユーザーファーストを実現するためには、プロダクト全体を俯瞰する視点が欠かせません。 自チームが整うと、自然とメンバーの視野も広がりより広い範囲に目を向けるようになります。そのため、2025年後半にはチームを超えた「リリースファースト」の取り組みが増えてきました。 チームを超えると部門が異なる人や他の役割の人たちと課題を共有し、目線合わせをしていく必要があるのですが、専門領域や役割の違いにより見えているもの感じているものが異なる場合も多く、ゴール設定や進め方で躓くことも多いです。 このような時にはビジネス・技術・プロセスを統合して見えているマネージャーのアドバイスや方向性づけ、判断というのがとても大事になります。 それによりチームを超えた様々な関係者がまとまり、取り組みが加速するというの目の当たりにしています。 今年の変化が成果となって表れるのが来年です。来年、リリースファースト・ユーザーファーストの活動を加速させ、より多くの成果に結びつけていくためにはマネージャーの関与は不可欠です。 本当の意味でリリースファーストを実現するプロダクトがどれだけ増えるのか今からとても楽しみです。 リリースファースト、ユーザーファーストは一年で終わる話ではありません。プロダクト開発に携わる以上は継続的に取り組んでいくテーマです。 Engineering Officeは来年も引き続き各チームとともにリリースファースト、ユーザーファーストに取り組んでいきます。 お知らせ Regional Scrum Gathering Tokyo 2026 のDay1(1/7)に出ます。具体の取り組みのいくかについて話す予定です。みなさんよかったら見に来てくださいね。 「リリースファースト」の実感を届けるには〜停滞するチームに変化を起こすアプローチ〜
アバター
この記事は KINTO テクノロジーズ Advent Calendar 2025 の 16 日目の記事です 🎅🎄 はじめに こんにちは! KINTO 開発部 KINTO バックエンド開発 G マスターメンテナンスツール開発チーム、技術広報 G 兼務、Osaka Tech Lab 所属の high-g( @high_g_engineer )です。フロントエンドエンジニアをやっています。 現在、筆者はプロジェクトで TanStack Query を利用しています。 TanStack Query は、 useQuery や useMutation のおかげで、 React Hooks を扱う感覚でデータの取得・更新が可能で非常に便利なライブラリです。 しかし、キャッシュの扱いで少し癖があり、理解が浅いと、以下の様な挙動に振り回されてしまいます。 データをキャッシュで賄えるはずの場面で無駄にフェッチしてしまっている サーバーのデータを更新したはずなのに、古い情報が画面に表示されてしまっている 闇雲にキャッシュ削除を連発してしまっている 本記事は、こういった挙動に振り回されないように、TanStack Query の公式ドキュメントを読んで、 筆者自身がキャッシュ周辺の挙動を理解するため の内容となっております。 本記事の構成 TanStack Query とは? TanStack Query のキャッシュの基本である stale と gc を理解する TanStack Query のキャッシュの挙動を理解する クエリの無効化 ミューテーション時のクエリの無効化 プロジェクト内でよく利用している QueryClient のメソッドの紹介 TanStack Query とは? https://tanstack.com/query/v5 本記事では、TanStack Query v5 の利用を前提にしています。 TanStack Query(旧 React Query)は、フロントエンドアプリケーションにおけるサーバー状態管理のためのライブラリです。 サーバー状態とは、API から取得するデータのように、アプリの外部に存在し、非同期で取得・更新が必要なデータのことです。 以下を非常にシンプルなコードで実現してくれます。 データ取得&データ更新のシンプル化 キャッシュ管理 バックグラウンド更新 ローディング・エラー状態の管理 TanStack Query のキャッシュの基本である stale と gc を理解する まず、TanStack Query のキャッシュの挙動を理解するために、 stale (古いデータ) と gc (ガベージコレクション) について理解する必要があります。 以下の記事が TanStack Query のキャッシュを理解するうえで一番最初の入口として読むべきドキュメントです。 https://tanstack.com/query/latest/docs/framework/react/guides/important-defaults stale について stale とは、「古くなった」または「更新が必要な可能性がある」状態のデータを指します useQuery または、 useInfiniteQuery のようなデータ取得系のフックは、デフォルトでクエリ(※)のデータを stale として扱います stale は、 staleTime を設定することで再フェッチの頻度を制御できます staleTime のデフォルトは 0 なので、データ取得直後に stale となります stale なデータは、新しいクエリのマウント、ウィンドウの再フォーカス、ネットワーク再接続時に自動で再フェッチされます ※ クエリとは、取得データ、状態、メタ情報、キー、データ取得関数をひとまとめにした管理単位のことです。 gc について 使用しなくなったキャッシュを削除する機能のことです useQuery , useInfiniteQuery はアクティブなインスタンスがなくなった場合、「非アクティブ」というラベル付けが行われ、再使用される場合に備えてキャッシュに残ります 「非アクティブ」の場合、デフォルトだと、5 分後に gc されます gcTime を設定することで、 gc が発生するまでの時間を変更できます stale と gc について、 staleTime と gcTime (v4 より以前は cacheTime という名称) をもとに考えると分かりやすいです。 staleTime → クエリを再取得するまでの時間 gcTime → gc するまでの時間(キャッシュにメモリを保持する時間) staleTime が過ぎても、クエリはキャッシュに残っていますが、 gcTime が過ぎると、クエリがキャッシュから消えるということになります。 それ以外の細かいオプションなども書かれてはいますが、 TanStack Query のキャッシュの基本を理解するために、まずは stale と gc が理解できていれば問題ないと思います。 TanStack Query のキャッシュの挙動を理解する 以下のドキュメントでは、TanStack Query の useQuery がクエリのデータをキャッシュ、キャッシュしたデータの利用、そして gc するまでの流れが解説されています。 https://tanstack.com/query/latest/docs/framework/react/guides/caching useQuery は、 useQuery({ queryKey: ["todos"], queryFn: fetchTodos }); といった記述が基本になりますが、こちらがどのように動作するかを順番に解説します。 本題の前に useQuery の基本コードを簡単に紹介 キャッシュの挙動理解の本題に入るまでに、 useQuery を利用した簡単なサンプルを紹介します。 useQuery が利用される場合、以下のようなコードが記述されることが一般的です。 // データ取得関数 const fetchTodos = async () => { const response = await fetch("/api/todos"); return response.json(); }; // コンポーネント内で使用 const TodoList = () => { // useQuery の記述 const { data, isPending, error } = useQuery({ queryKey: ["todos"], queryFn: fetchTodos, }); if (isPending) return <p>読み込み中...</p>; if (error) return <p>エラーが発生しました</p>; return ( <ul> {data.map((todo) => ( <li key={todo.id}>{todo.title}</li> ))} </ul> ); } useQuery の引数として与えられているオブジェクトには、 queryKey と queryFn というプロパティがありますが、それぞれについては以下の意味があります。 queryKey → キャッシュを識別するためのキー。配列で指定。同じキーを持つクエリはキャッシュを共有 queryFn → データをフェッチするクエリ関数 TanStack Query のキャッシュの一連のライフサイクルを理解する ここまで出た queryKey , stale , gc を元に useQuery のキャッシュ周辺の流れを整理すると、以下のようになります。 1. 初回の useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) を実行 まだ、 queryKey: ['todos'] に紐づけられたクエリのデータが存在しないため、データを取得する為に queryFn で指定された fetchTodos を実行します。 クエリ関数の実行が完了すると、レスポンスは、 ['todos'] キーのもとにキャッシュされます。 staleTime はデフォルトで 0 なので、この時のデータは即座に stale になります。 2. 再度、 useQuery({ queryKey: ['todos'], queryFn: fetchTodos })  を実行 この時、 ['todos'] キーのもとにキャッシュされたデータが stale として存在するため、 stale なデータがレンダリングに利用されます。 それと同時に queryFn で指定された fetchTodos がバックグラウンド実行されます。 クエリ関数の実行が完了した時点で、キャッシュが新しいデータで更新されます。(初回と同じく、 staleTime が 0 なので、即座に stale になります) そして、この時点で更新されたデータを元にまたレンダリングが更新されます。 3. useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) がマウント解除され、使用されなくなる この時、アクティブなインスタンスがなくなったため、クエリは「非アクティブ」のラベルが付与され、 gcTime を利用して、 gc を実行するための時間設定を行います。 gcTime のデフォルトは 5 分なので、何もなければ、5 分後に ['todos'] キーに紐づいたキャッシュデータは gc されますが、5 分以内に再度 useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) が実行されるようなことがあれば、 gc のタイマーはリセットされ、同じ様な流れでキャッシュの更新が行われます。 一連のライフサイクルを図示すると以下のようになります。 queryKey によるキャッシュ管理について 少しだけ脱線しますが、 queryKey については、以下のドキュメントで詳しく解説されています。 https://tanstack.com/query/latest/docs/framework/react/guides/query-keys TanStack Query は、 queryKey に基づいて、キャッシュを管理します。 queryKey の型は unknown[] なので、シンプルな文字列のみで構成された配列から文字列とオブジェクトのネストなどの複雑な配列まで対応しています。 大切なことは、TanStack Query は queryKey を一意のキーとして、キャッシュを管理するため、キャッシュしたクエリのデータを再利用したい場合は、正しく配列を指定する必要があります。 例えば、以下のように、 queryFn に対して同じクエリ関数を指定しているが、異なった queryKey を指定している場合、キャッシュは全く別のもとして扱われます。 useQuery({ queryKey: ['todos'], queryFn: fetchTodos }) useQuery({ queryKey: ['todos1'], queryFn: fetchTodos }) また、逆に queryFn は異なったクエリ関数を指定しているが、同じ queryKey を指定している場合、同一のキャッシュが扱われます。 useQuery({ queryKey: ['todos'], queryFn: fetchTodos1 }) useQuery({ queryKey: ['todos'], queryFn: fetchTodos2 }) queryKey の指定が正しくないだけで、そもそもキャッシュが正しく効かない状態になるので、注意が必要です。 ただし、以下のように、 queryKey にオブジェクトが扱われている場合、オブジェクトの中身(キーと値)が同じであれば、オブジェクト内のキーの順序に関係なく、同じキャッシュとして扱われます。 useQuery({ queryKey: ['todos', { status: 'done', page: 1 }], queryFn: fetchTodos }) useQuery({ queryKey: ['todos', { page: 1, status: 'done' }], queryFn: fetchTodos }) ここまでの内容が理解できれば、TanStack Query のキャッシュの基本はかなり押さえられたと思います。 クエリの無効化 staleTime に基づいた自動的なキャッシュ更新のみだと、必ずしも効果的でない場面は存在します。 例えば、ユーザーの何らかの操作によって、キャッシュが古くなっていることが確実な時や、意図的にキャッシュを更新したい時などです。 そういった場面に利用できるのが、 QueryClient に存在する invalidateQueries メソッドです。 これを利用することで、クエリのデータを強制的に stale にします。そのクエリが現在レンダリング中(アクティブ)であれば、即座にバックグラウンドで再取得されます。 import { useQuery, useQueryClient } from "@tanstack/react-query"; // QueryClient からコンテキスト取得 const queryClient = useQueryClient(); // キャッシュ内のすべてのクエリを無効化 queryClient.invalidateQueries(); // todos キーを持つ全てのクエリを無効化 queryClient.invalidateQueries({ queryKey: ["todos"] }); 注意点として、 invalidateQueries() はクエリのデータを stale にするだけであり、キャッシュを削除したり、 gc したりするわけではありません。 キャッシュを削除する場合、 removeQueries() を利用する必要があります。 ミューテーション時のクエリの無効化 TanStack Query を扱う上で最も挙動に振り回されるタイミングがミューテーション(更新、削除などの操作)後のレンダリングだと筆者は思います。 正直なところ、ここまでの説明は、この項目を説明するための長い前置きでした。 (本当に長くてすみません・・・。) ドキュメントとしては、以下を読んで終わりなのですが... https://tanstack.com/query/latest/docs/framework/react/guides/invalidations-from-mutations ドキュメントで扱われているサンプルコードを記載します。 import { useMutation, useQueryClient } from "@tanstack/react-query"; const queryClient = useQueryClient(); const mutation = useMutation({ mutationFn: addTodo, onSuccess: async () => { // パターン1: 単一のクエリのデータを無効化する場合 await queryClient.invalidateQueries({ queryKey: ["todos"] }); // パターン2: 複数のクエリのデータを無効化する場合 // ※ 実際はパターン1かパターン2のどちらかを使用します await Promise.all([ queryClient.invalidateQueries({ queryKey: ["todos"] }), queryClient.invalidateQueries({ queryKey: ["reminders"] }), ]); }, }); ミューテーション後に queryClient.invalidateQueries({ queryKey: ["todos"] }) を実行することで、キャッシュに保持しているクエリのデータを手動で無効化し、バックグラウンドで再取得が行われます。これにより、キャッシュのデータを最新の状態に更新できます。 この記述がない場合、キャッシュの更新が staleTime に依存するため、タイミングによってはミューテーションでデータを更新したにもかかわらず、画面の表示が古いままになることがあります。 ここまでで紹介したドキュメントに目を通した方なら、なぜ onSuccess のタイミングで、 queryClient.invalidateQueries({ queryKey: ['todos'] }) を実行しているのか?を正しく理解できると思います。 ただ、このドキュメントを読むだけだと正しい理解ができず、更にこのドキュメントでもそこまで触れられていない為、 useMutation を利用した後は、対応する queryKey を invalidateQueries() に記述するだけで終わってしまうのではないかと思います。 実際、筆者はそうでしたし、未だにプロジェクト内にはそういったコードが散在しています。 プロジェクト内でよく利用している QueryClient のメソッドの紹介 最後に、プロジェクト内でよく利用している QueryClient のメソッドを紹介します。 invalidateQueries queryClient.invalidateQueries({ queryKey: ["todos"] }); 指定したクエリキーのクエリを無効化し、キャッシュを stale にマークします。 キャッシュは即座に削除されません そのクエリを使用しているコンポーネントがアクティブな場合、バックグラウンドで再フェッチが自動的に実行されます 用途: データ更新後に関連するクエリを再取得させたいとき refetchQueries await queryClient.refetchQueries({ queryKey: ["todos"] }); 指定したクエリキーのクエリを即座に再フェッチします。 invalidateQueries とは異なり、アクティブなコンポーネントの有無に関係なく強制的に再取得 await で完了を待つことが必要 用途: 更新後に最新データが確実に取得されていることを保証したいとき removeQueries queryClient.removeQueries({ queryKey: ["todos"] }); 指定したクエリキーのキャッシュを完全に削除します。 キャッシュからデータが消えるため、次回アクセス時は新規フェッチが必要 用途: エンティティが削除された後など、キャッシュに残っていると問題になるケース setQueryData queryClient.setQueryData([`/v1/versions/${variables.id}`], data); 指定したクエリキーのキャッシュデータを直接書き換えます。 サーバーへのリクエストなしでキャッシュを更新 用途: Mutation の結果をそのままキャッシュに反映したいとき(楽観的更新など) まとめ TanStack Query というライブラリは処理を非常にシンプルに記述でき、ドキュメントをそこまで読まなくても利用できてしまうほど便利なライブラリです。 ただ、キャッシュ周辺に関しては、ある程度ドキュメントを読み込んで理解しておかないと、挙動に振り回されて、書かなくても良いようなコードを書いて、場当たり的な対応をしてしまうことになります。 この記事が TanStack Query のキャッシュ周辺で悩んでいる方の助けに少しでもなれば幸いです。 最後まで読んでいただきありがとうございました。 参考記事 https://tanstack.com/query/v5 https://tanstack.com/query/latest/docs/framework/react/guides/important-defaults https://tanstack.com/query/latest/docs/framework/react/guides/caching https://tanstack.com/query/latest/docs/framework/react/guides/query-keys https://tanstack.com/query/latest/docs/framework/react/guides/query-invalidation https://tanstack.com/query/latest/docs/framework/react/guides/invalidations-from-mutations https://tanstack.com/query/latest/docs/reference/QueryClient
アバター
はじめに KINTOテクノロジーズのデジタル戦略部DataOpsG所属の西です。 普段は社内のデータ分析基盤の開発・保守・運用を担当しています。 データガバナンスの一環としてのデータ分析基盤へのアクセス制御のため、AWS Lake Formation、その機能であるハイブリッドアクセスモードとLFタグを扱う機会がありました。 はじめてLake Formationを触ると、その仕様や用語を理解するだけでも大変だと思います。(自分は、なかなか苦労しました。) そのため本記事ではLake Formationの主要な概念や設定方法をご紹介します。 Data lake locations、Data permissions、Data locations、IAMAllowedPrincipalsについて ハイブリッドアクセスモードについて LFタグによるアクセス制御について ハイブリッドアクセスモード、LFタグによるアクセス制御の設定方法 :::message なお、本記事はGlue Data Catalog(以下、Glueデータカタログ)上のリソースに対するLake Formationのアクセス制御を前提として書かれています。 ::: またLake Formationを触って気づいた注意点として、下記を本稿後半の 注意点 に記します ハイブリッドアクセスモード運用における新規作成IAMロールの関係について ハイブリッドアクセスモードとCloudFormation Amazon Athenaビューへのアクセス制御 AWS Lake Formation データ分析基盤のデータカタログにGlueデータカタログを採用している場合、IAMポリシーやS3バケットポリシーよりもさらにきめ細かいアクセス制御を実施するには Lake Formationの導入検討が必要になると思います。 Lake Formation自体の詳細はAWSから出ている下記ドキュメントをあたってください。 デベロッパーガイド AWS Black Belt ← 個人的に、Lake Formationの概要を掴むのにわかりやすい資料でした Data lake locations Lake Formationでアクセス制御する対象を登録する機能 対象:S3パス 説明:ここに登録されたS3パス配下をLake Formationによるアクセス制御対象として登録する 例:Glueデータカタログ上のデータベースをアクセス制御したい場合、データベースのS3ロケーションはData lake locationsに登録されたS3パス配下である必要がある 注意点:ここにS3パスを登録するだけではLake Formationによるアクセス制御は実施されない Data locations 対象:プリンシパル ^1 とS3パス 説明:Glueデータカタログのデータベースやテーブルへの作成や変更の権限を付与する。ここで行う設定はデータロケーション(S3リソース)へのメタデータをプリンシパルに作成、変更する権限 Data permissions 対象:プリンシパル、Glueデータカタログのデータベースやテーブル 説明:下記のアクセス権限をプリンシパルに付与する データベースに対して Create Table、Alter、Update、Drop、Describe テーブルに対して Select、Insert、Delete、Describe、Alter、Drop 注意点: Data lake locationsの設定を事前におこなっておく メタデータを作成、変更する権限(Create Table/Alterなど)をData locationsで事前に設定しておく AWS Black Belt のP19,P20 がわかりやすいです。 IAMAllowedPrincipals IAMAllowedPrincipals について Lake Formation 許可のリファレンス に下記の通り説明があります。(2025/11) 「Lake Formation は、データカタログ内のすべてのデータベースとテーブルに対する Super アクセス許可を、デフォルトで IAMAllowedPrincipals というグループに設定します。このグループアクセス許可がデータベースまたはテーブルに存在する場合、アカウント内のすべてのプリンシパルが、 AWS Glueの IAM プリンシパルポリシーを介してリソースにアクセスできるようになります。」 IAMAllowedPrincipalsにSuper権限があるため、Lake Formationのデフォルト設定時では、GlueデータカタログリソースにIAMポリシーでアクセスが可能です。 Glueデータカタログのデータベースやテーブルのアクセス制御について、IAMポリシーでのアクセス制御からLake Formationでのアクセス制御に移行するには IAMAllowedPrincipalsの設定の排除が必要 それぞれのIAMプリンシパルに対して、Lake Formationでアクセス制御(メタデータ、データロケーションへの制御)を設定する 上記を実施する場合、既存IAMプリンシパルの棚卸が必要になります。 この棚卸に漏れがあると、GlueデータカタログのリソースにアクセスできないIAMプリンシパルが発生することに注意が必要です。 また、Lake Formationのアクセス制御を解除し元のIAMによるアクセス制御に戻す際は、手順の逆を実施することになります。 こちらにその手順とスクリプトが公開されています Using only IAM access controls ハイブリッドアクセスモード これまでの方式では、Lake Formationでアクセス制御を実施するには、IAMAllowedPrincipalsの設定を排除しLake Formationを設定する必要があります。(この方式はLake Formationモードと呼ばれます) 一方、ハイブリッドアクセスモードの場合はIAMAllowedPrincipalsが付与されていてもLake Formationのアクセス制御が優先されるため、IAMAllowedPrincipalsの設定を排除せずにLake Formationのアクセス制御を有効にできます。 つまり、IAMAllowedPrincipalsが付与されていてもLake Formationによる制御を強制的に⾏わせる機能です。そのため、上述のIAMプリンシパルの棚卸を行わずにLake Formationによるアクセス制御を有効にできます。 ハイブリッドアクセスモードの場合、下記が可能になります。 選択したリソースとプリンシパルについてLake Formationのアクセス制御を有効化(ハイブリッドアクセスモードのオプトイン) Lake Formationアクセス制御を解除するには、ハイブリッドアクセスモードのオプトインを解除する LFタグ Glueデータカタログのリソース(データベース、テーブル、カラム)にタグを割り当て、そのタグに基づいてプリンシパルにアクセス権限を付与するための機能です。 LFタグを定義(例: Key=Confidential, Value=True/False) リソースにLFタグを付与する プリンシパルに、LFタグに対するアクセス権を付与する LFタグを使うと、リソースとプリンシパル間の権限関係を疎結合に保つことができます。 LFタグを使わない場合、リソースとプリンシパル間で直接アクセス権を設定する必要があります。この場合、リソースやプリンシパルが増えると、アクセス権の管理が煩雑になります。 設定方法 以下、Lake FormationのハイブリッドアクセスモードとLFタグ方式によるアクセス制御の手順を記します。 前提条件 今回は、下記のペルソナのもとアクセス制御を実施したいと思います。 ペルソナとLFタグ ペルソナ 役割 対象IAMロール名 対象LFタグ 許可する権限 データレイク管理者 Lake Formationの操作権 lf-test-001 Confidential = True, False Super データユーザー 許可されたテーブルにアクセスできる lf-test-001-user Confidential = False Select、Describe 手順 Lake Formationでアクセス制御を実施するには、大まかには、下記を実施します。 データレイク管理者に登録する Glueデータカタログのメタデータへのアクセス制御のため、S3パスをData lake locationsに登録し、そのS3パスをLake Formationで制御可能状態にする Glueデータカタログのメタデータの作成の制御として、Data locationsの設定。これでテーブルのCreateやAlter権限をLake Formationで付与 LFタグの設定 Data lake administratorsの設定 Lake Formationの操作設定権をIAMロールに付与する Data lake administratorとして今回はlf-test-001というIAMロールをセットする Data lake locationsの設定 GlueデータカタログのデータベースのS3ロケーションを設定する Hybrid access modeを選択する Data locationsの設定 Data locationsの設定として、ハイブリッドアクセスモードでアクセス制御をしたいプリンシパルと制御対象のS3プレフィックスを登録する この制御対象のS3プレフィックスはGlueデータカタログのデータベースのうち、ハイブリッドアクセスモードでアクセス制御したいデータベースのS3ロケーションを設定している LFタグを作成 キーはConfidential、バリューはTrue、Falseを作成する LFタグへのアクセス権を設定 「Permissions」の「Data permissions」からアクセス権を設定します。 Lake Formationで権限を渡したいプリンシパルを選択する Lake Formationで管理したいLFタグを選択する 今回は、lf-test-001-userというIAMロールに対して、LFタグのキーがConfidentialでバリューがFalseにアクセス権を付与する Lake Formationで許可したいアクセス権を選択する lf-test-001-userはキーがConfidential、バリューがFalseのリソースに対して、データベースの場合Describeを付与、テーブルの場合Select、Describeを付与する LFタグを管理対象リソースに設定する 今回はconfidential というデータベースのtable_001、table_002 というテーブルに下表のようにLFタグを付与します。 データベース名 テーブル名 LFタグのキー名 LFタグのバリュー名 confidential table_001 Confidential True confidential table_002 Confidential False table_001にはキー=Confidentialのバリュー=True、table_002にはキー=Confidentialのバリュー=Falseを設定する ハイブリッドアクセスモードを有効化する 管理したいリソース(テーブル)を設定 今回はデータベースを設定しないため、データベースはIAMポリシーでのアクセス制御が継続される アクセス制御したいプリンシパルを設定 動作確認 アクセスさせないテーブルについて lf-test-001-user にスイッチロールするとConfidential=Trueであるtable_001はUI上から見えない confidential.table_001 へのクエリは失敗する アクセス許可しているテーブルについて Confidential=Falseであるtable_002 はUI上から見える confidential.table_002 へのクエリは成功する 解除手順 ハイブリッドアクセスモードをRemove(解除)することでLake Formationによるアクセス制御は解除される 注意点 最後にLake Formationを触ってみて気づいた注意点を書いておきます。 異なるキーのLFタグによるリソースへのアクセス制御はLFタグの AND条件ではなく OR条件になる 例:キーがConfidential=TrueのLFタグとキーがDepartment=SalesのLFタグが付与されたリソースに対しては、プリンシパルにキーがConfidential=TrueのLFタグへのアクセス権またはキーがDepartment=SalesのLFタグへのアクセス権を持つ場合、アクセス可能になる 運用時にはハイブリッドアクセスモードでは新規作成されたIAMロールには対応できない。Lake Formation管理者とIAM管理者が異なる場合、Lake Formation管理者が予期せぬIAMロールがGlueデータカタログにアクセスする可能性がある ハイブリッドアクセスモードのオプトイン操作はCloudFormationには現時点で非対応と思われる。 ハイブリッドアクセスモードのオプトインの実施(CreateLakeFormationOptIn)が必要だが、CloudFormationには現時点では見当たらない。 ^2 CloudFormationでリソースの作成後、下記が必要なのではないかと思われる。(今後の検証が必要) Lake FormationコンソールやAWS CLIなどでプリンシパルのオプトインの設定を行う CloudFormationのカスタムリソースを用いて、Lambda関数からCreateLakeFormationOptIn APIを実行する Athenaで作成したビューに対するアクセス制御は基礎となるテーブルの権限と一致させておく必要がある。そのためAthenaビューとテーブルのアクセス制御は同じものとなる ^3 ※1 データカタログビューを使うとテーブルとは異なるアクセス制御をビューに設定できる。 ^4 ※2 データカタログビューはハイブリッドアクセスモードのIAMAllowedPrincipalsを排除が不要という恩恵を受けられない ^5 データカタログビューの作成には下記が必要 データカタログビュー作成にはIAMAllowedPrincipalsのアクセス権限をビューの基のテーブルから外す テーブルが所属するデータベースからデフォルトで設定されている[Use only IAM access control for new databases] を外す データカタログビューを作成するIAMロールに対して、Lake Formationでビューの基のテーブルに対するアクセス権限を設定する あとがき Lake Formationを使うとGlueデータカタログのリソースに対してきめ細かいアクセス制御が可能になることは分かりました。 一方で、Lake Formation自体の理解と設定に学習コストがかかる印象を受けました。 そのためチーム内で知見を十分に共有できていないと、誰もアクセスできないリソースが発生しそれを解決できる人間がわずかしかいないという状況に陥りかねないと感じました。ドキュメントの整備、ハンズオンの実施などでチーム内の知見を高めることが重要と思います。 また、Lake Formation管理下のテーブルとビューのアクセス制御については、テーブルとビューで異なるアクセス制御を実施したい場合は注意が必要です。 既存のIAMロールの管理体制、Glueデータカタログの運用方法とLake Formationの仕様を十分に検証することが重要と思います。
アバター
Introduction Hello. I'm Sato, a frontend developer at KINTO Technologies Corporation (KTC). In this article, I'd like to introduce my team developing a website for KINTO used vehicles, sharing how we proceed with the development and how our team structure looks like. I recently started using a sun umbrella for the first time in my life. For learning more about myself, please check here What Is the KINTO Used Vehicle Website Development Team? In general, when you sign up with KINTO, a subscription with a new vehicle is started. At the end of the subscription, you need to return the vehicle. Our team mainly work on developing and operating KINTO used vehicles (only in Japanese) , a website that sells the returned vehicles as used vehicle subscriptions online. A major difference of the e-commerce site from the one for KINTO new vehicles is that vehicle inventory fluctuates daily as used vehicles are basically one-of-a-kind items sold on a first-come, first-served basis. We implement e-commerce-specific initiatives and approaches, considering how to display inventory and recommendation sections, which is very worthwhile. Team Structure (as of November 2025) One product manager One producer Five frontend engineers Eight backend engineers Team Atmosphere My team members working at our office Our frontend (FE) team, backend (BE) team, and contract partners are able to communicate casually without barriers and freely share opinions. Since we're close to the business teams related to used vehicles, I think we are in the mindset of sharing opinions and growing the used vehicle e-commerce site together! Sometimes people from other divisions join our regular project meetings, giving very pleasant comments like, "This meeting has a really great atmosphere." **Introducing Some Team Members!** Some of our used vehicle frontend team members have written articles, so please check them out too! NAKAHARA Yuki Loves cheering for soccer Boosting work efficiency with his custom-built keyboard! NAKAHARA Yuki's article (below) Website Image Optimization with Lambda@Edge & Next.js ![Ren.M](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/minakawa.png) Ren.M - Basketball club captain! Shining as a point guard - When it comes to iPhone, the high-end model is the best! - Ren.M's articles (below) - [Introduction to TypeScript](/posts/2024-04-10-TypeScript入門/) - [Introducing In-House Club Activities: Basketball Club](/posts/2024-09-26-社内部活動紹介-バスケ部編/) Project Team Structure The used vehicle e-commerce site is developed and operated by KTC members in different teams. Team Role Affiliation Used vehicle business team Business owner KINTO Corporation Used vehicle site development team Handles all development KTC Creative team Handles project direction and website design KTC Analytics Team Manages numbers of website access and CVR KTC :::message Did you know the role of KINTO Technologies (KTC)? ::: KTC is a tech company founded to drive mobility services developed by companies in the Toyota Group using diverse technologies and our creativity. It handles in-house development of KINTO, which is one of Toyota's mobility services. By dividing business domains into two organization—KINTO Corporations (KINTO’s service operation domain) and KTC (KINTO’s development domain)—and working together, we are able to leverage each other's strength. How We Develop Products In developing the used vehicle e-commerce site, we determine what to do based on regular project meetings, and we growth hack the website through running PDCA cycles using the HCD development methodology. We proceed with the development in four different teams led by the business team, and everyone shares opinions while developing with a sense of ownership. What Is HCD? User testing is underway HCD stands for Human Centered Design, a methodology that focuses on understanding user needs and how to translate them into products. We, the used vehicle team, specifically conduct surveys and user testing, organize website improvement points and user demands to make a better e-commerce site. User testing involves communicating with users about what they're thinking while operating the website, which helps us to explore unexpected insights and is a very valuable experience for the website developers as well. Example of How We Proceed PDCA Cycle Content Responsible Team Plan Set goals and improvement plans based on analytics team reports, customer feedback, and achievements as a commercialized project Everyone shares opinions to make decisions on structure, design, etc. (repeat the above activities several times until we finalized the project) ・Used vehicle business ・Used vehicle development ・Creative ・Analytics Do Development to release ・Development Check Check metrics Discuss results ・Used vehicle business ・Used vehicle development ・Creative ・Analytics Action Plan next steps based on checked points, if needed ・Used vehicle business ・Used vehicle development ・Creative ・Analytics Regular Project Meetings Project members attending regular business meeting In weekly meetings, we share information with the used vehicle business team while discussing improvements and considering service expansion. The used vehicle business team, creative team, and analytics team attend meetings from their own working positions. I personally like how Kitahata-san from the used vehicle business team facilitates—there's no formal icebreaker segment, but he keep things running in a great atmosphere throughout. For more about Kitahata-san, see here The regular meeting agenda is structured like this: Updates from individual teams Used vehicle business Used vehicle development Analytics Creative Topics Planning improvement measures based on inquiries received Proposing ideas on what we want to do Sharing results of initiatives, etc. Development Team Initiatives We implement various initiatives alongside development. Recently, we've been actively adopting AI-powered development and using the external service Findy Team+ to improve our development process. Item Details AI-related ・Devin  ・Minor fixes, document creation, etc. ・Copilot  ・Source code review  ・Implementation assistance ・RCA (Root Cause Analysis)  ・AI-powered critical alert root cause analysis Internal development meetings ・Scrum events ・Study sessions ・Pair programming Development process improvement ・Findy Team+ ・Process improvements related to code review Interview I, Sato, interviewed some of members involved with the e-commerce site development. ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) Sato, leader of the development FE team "Nobe-san, it's been about 3 months since you joined. What are your impressions of the used vehicle website development team?" ![開発P野辺](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/nobe.png) Nobe, producer of the development team "By participating in various development meetings, I was particularly impressed that everyone speaks up and thought that this is an environment allowing everyone to share opinions." "And I could feel that opinions are quickly adopted, and everyone wants to make things better together." ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) Sato, leader of the development FE team "Thank you. I'm very grateful that you've already shared your opinions and made many improvement suggestions." "How are things going with the BE team lately, Kaneda-san?" ![開発BE(リーダー)金田](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/kaneda.png) Kaneda, leader of the development BE team "Well, the BE team is also trying to boost productivity and holding study sessions to raise the skill level of team members." "Recently, we've been focusing on domain-driven development." ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) Sato, leader of the development FE team "Thank you. The BE team's initiatives and success stories that you share are always helpful for my FE team’s improvements too." "I'd like us to enhance our products as a whole team, regardless of FE or BE." "Let's also talk with Kitahata-san from the used vehicle business team. What do you think about the used vehicle website development structure?" ![中古車ビジネスチーム北畑](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/kitahata.png) Kitahata, member of the used vehicle business team "I always feel that new features are released at a good pace and progress are being made daily. The style of 'just try it first and run PDCA' feels like a very good match for us." "What's great about this project team is that anyone can say anything regardless of job title or position. The development side often proposes things we, the business side, never thought of, and it feels like we're all doing business together." ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) Sato, leader of the development FE team "Thank you. I also feel that each team is united in development and operations." "I'd like to continue increasing KINTO fans one by one." "Finally, a question for Mizuuchi-san, our product manager. What do you expect from the development team?" ![開発PDM水内](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/mizuuchi_1.png) Mizuuchi, product manager of the development team "It's not just about doing development. We discuss in meetings how to improve the website, expecting the service to grow in mind. That's why I want project members to speak up and make the website even better." "As an ideal way of working, I don't intend to fix a role, like 'this is your job,' so I want people to proactively do what they can and what they notice for any improvements." "Technology is a means of achieving what you want to do, so I want the members who can develop with a service-first mindset rather than technology-first. We bring members with that perspective in mind." ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) Sato, leader of the development FE team "So it is ideal that we have members who are service-first and can develop proactively." "I also thought this is an important perspective in terms of growing all services in KTC. Thank you." In Closing I hope this has given you at least a glimpse of how we develop the used vehicle e-commerce site and the atmosphere of our team. We've also introduced our team atmosphere and processes here! If you're interested, please read it, which makes me very happy. A Development Culture That Starts with "Let's Just Try It." The KINTO Used vehicle Team Talks About the Driving Force and Flexibility Behind the Scenes (only in Japanese)
アバター
この記事は KINTOテクノロジーズ Advent Calendar 2025 の12日目の記事です🎅🎄 はじめに my route のAndroidアプリを開発している 長谷川 です。 開発をしていると、何らかの理由でメンテナンス性を犠牲にしてしまうことってありますよね。「今動けばいいや」という感じで。 この記事では、アプリがローカルにデータを保存(永続化)する際に陥りがちな罠と、それを防ぐテスト手法を紹介します。ここでは例として Android を取り上げていますが、ローカル永続化を扱うあらゆるアプリケーションに共通する問題であり、同様のアプローチで対策できます。 ケーススタディ:チケット機能の実装 シンプルなチケットの永続化 とあるアプリの開発では、お得なチケット機能があります。チケットには以下のような情報があります。 data class Ticket( val id: String, val name: String, ) このチケットはオフラインでも使える必要があります。オフライン状態ではサーバーから情報を取得できないため、ローカルに永続化する必要があります。 AndroidのSQLiteデータベースを扱いやすくする Room ライブラリを使うと、シンプルなデータ構造なら、アノテーションをいくつかつけるだけで永続化することができます。 @Entity data class Ticket( @PrimaryKey val id: String, val name: String, ) 現実は複雑... しかし、実際のチケット情報はもっと複雑です。 価格情報 有効期限 利用条件 AndroidのRoom (SQLite) などのRDB (リレーショナルデータベース) では、このような複雑なオブジェクトをそのまま保存できません。通常は以下のような対応が必要です。 テーブル設計を工夫してリレーションを作る TypeConverter (複雑な型を基本型に変換する仕組み) を使って変換する しかし、これらの対応は結構大変です... 「あ〜、今はそんなこと考えている時間ないなぁ!」 楽な方法:全部JSONにする! そこで思いつくのが、 全部JSONにしてしまう という方法です。 // ビジネスロジックで使う実際のデータクラス @Serializable // kotlinx.serializationを使用 data class Ticket( val id: String, val name: String, // ... その他複雑なプロパティ (価格、有効期限など) ) // データベースに保存する用のクラス @Entity data class TicketForDB( @PrimaryKey val id: String, val json: String, // Ticketを丸ごとJSON文字列として格納 ) // 保存 fun write(ticket: Ticket) { db.write( TicketForDB( id = ticket.id, json = Json.encodeToString(ticket) // オブジェクト → JSON文字列 ) ) } // 復元 fun read(id: String): Ticket { val ticketForDB = db.read(id) return Json.decodeFromString<Ticket>(ticketForDB.json) // JSON文字列 → オブジェクト } やった〜!複雑なデータ構造を持つチケット情報を簡単に保存できた! この方法なら 複雑なTypeConverterを書く必要なし テーブル設計で悩まなくていい 開発スピードが速い 数ヶ月後...チケット機能の改善 時は流れ、新機能の開発が始まります。 「一つのチケットで複数人が利用できる機能を追加しよう!」 今までは一つのチケットで一人しか利用できませんでしたが、グループ利用に対応するため、 maxUsersPerTicket というパラメータを追加しました。 @Serializable data class Ticket( val id: String, val name: String, val maxUsersPerTicket: Int, // 追加! // ... その他のプロパティ ) やったね!これで便利な新機能も簡単に開発できた! テストも通ったし、リリース準備OK! リリース後、問題発生... リリース後しばらくして、 「クラッシュ報告が来ています!オフラインでチケットが使えないという問い合わせが多数...」 何が起きたのか? 原因は、 新しく追加した maxUsersPerTicket プロパティ です。 問題の流れ: [v1.0] チケット保存 {"id":"abc123", "name":"Sample Ticket"} ↓ [v2.0にアップデート] ↓ [復元を試みる] maxUsersPerTicketが必要だが、JSONにない ↓ クラッシュ! 永続化されたJSONには maxUsersPerTicket がありません。しかし、新しい Ticket クラスは maxUsersPerTicket を必須としています。JSONライブラリは値を決められず、エラーになります。 // この時、永続化されたJSONには maxUsersPerTicket が存在しない val ticket = Json.decodeFromString<Ticket>(json) // → Field 'maxUsersPerTicket' is required for type Ticket どうすれば良かったのか? 解決策1:RDBでリレーショナルモデリングを頑張る RDBはJSONとして保存するよりも、圧倒的に型に強いです。 丁寧にテーブル設計を行っていれば スキーマ変更時にRoomのコンパイルエラーで気づける 型安全性が保証される データの整合性を保ちやすい 一方でデメリットもあります。 複雑なデータ構造の表現が難しい (RDBは表形式) テーブル設計に時間がかかる TypeConverterやリレーションの管理が煩雑 将来的なメンテナンス性も不透明 → 準備が大変な割に、メンテナンス性が必ずしも高くなるとは限らない 解決策2:JSONを使いつつ、ユニットテストで安全性を確保する JSONの手軽さを維持しつつ、ユニットテストで問題を早期発見する方法です。 課題 将来の開発者 (または未来のあなた) が、何も知らずに Ticket のプロパティを追加/削除/変更しても気づけるようにするには? 解決方法 過去のJSON形式をテストで保存し、デシリアライズをテストする まず、現在のバージョンで保存されるJSONをfixtureファイル (テストで使う固定サンプルデータ) として保存します。 // fixture.json (テストリソースとして保存) { "id": "abc123", "name": "Sample Ticket" } テストコード 以下の2つのテストを追加します。 @Test fun `古いバージョンのJSONをデシリアライズできる`() { // 過去に永続化されたJSONが、現在のコードで読み込めることを保証 val jsonString = loadJson("fixture.json") val deserialized = runCatching { Json.decodeFromString<Ticket>(jsonString) } // 失敗したら、新しいプロパティに初期値が必要など、問題に気づける assert(deserialized.isSuccess) { "デシリアライズに失敗しました: ${deserialized.exceptionOrNull()}" } } @Test fun `デシリアライズ後に再シリアライズすると元のJSONと一致する`() { // fixtureファイルの更新漏れを検知 val jsonString = loadJson("fixture.json") val deserialized = Json.decodeFromString<Ticket>(jsonString) val serialized = Json.encodeToString(deserialized) // プロパティを削除したのにfixtureを更新していないケースなどを検知 assert(jsonString == serialized) { "JSONが一致しません。fixture.json の更新が必要かもしれません" } } このテストが守ってくれるもの 古いJSONとの互換性 :過去のバージョンのJSONが読み込めることを保証 fixtureの更新漏れ防止 :データ構造が変わったら気づける 実際にテストを動かしてみよう ケース1:プロパティを追加した場合 問題が発生した例と同じく、数ヶ月後、複数人利用機能が追加されたとします。 @Serializable data class Ticket( val id: String, val name: String, val maxUsersPerTicket: Int, // 追加 ) 先ほどのユニットテストを実行してみます。使用しているJSONライブラリにもよりますが、概ね以下のようなエラーでテストが落ちます。 Field 'maxUsersPerTicket' is required これで将来の開発者やAIはこのデータクラスが永続化されていて、追加されるパラメータには初期値が必要なことが分かります。なぜならすでに永続化されたデータには新しい値が当然考慮されていないからです。 次にプロパティの名前が変更されたとします。 ある開発者がnameという名前は抽象的だ!と言い出して、 displayName に変更しました。 @Serializable data class Ticket( val id: String, val displayName: String, // 変更 ) 先ほどのユニットテストを実行してみます。同じように以下のようなエラーにより、問題に気づくことができます。 Field 'displayName' is required 次に、Ticketから名前が不要になりました。 @Serializable data class Ticket( val id: String, // val displayName: String, // 削除 ) たいていのプロジェクトではJSONライブラリの設定で、 ignoreUnknownKeys のような、知らない値が来たら無視するための設定を有効にしていることが多いと思います。 したがってこれによるクラッシュが発生することは少ないでしょう。 しかし永続化されているであろうfixtureファイルの更新を漏らしたくないです。 先ほどのユニットテストを実行してみます。 以下のようなエラーにより、fixtureファイルの更新漏れを防ぐことができるでしょう。 "JSONが一致しません。fixture.json の更新が必要かもしれません" (上記のテストではどのプロパティに差分があるかまでは分からないので、実際にはobjectとして比較する案が考えられる) まとめ 本記事では、永続化したデータを安全に扱うためのテスト手法を紹介しました。 今日から始められること 現在永続化しているデータのJSON例をfixtureとして保存 そのJSONをデシリアライズするテストを書く CIに組み込む 一度ユーザーの端末に保存されたデータは、簡単には消せません。それは「技術的負債」になりやすい部分ですが、裏を返せば、ここを堅牢に保つことこそがアプリの長期的な信頼性に繋がります。 また、今回紹介したFixtureを用いたテストは、 JSONライブラリの置き換え (例:GsonからMoshi/Kotlin Serializationへの移行) などにおいても極めて強力な武器になります。同じFixtureに対してテストが通れば、ライブラリや環境が変わっても「以前と同じようにデータを復元できる」ことが保証されるからです。 「今動くコード」を書くのは当然として、私たちはそこから一歩進んで、「ライブラリが変わっても、担当者が変わっても、少しでも安全に動き続けるコード」を残せるエンジニアでありたいものです。
アバター
この記事は KINTOテクノロジーズ Advent Calendar 2025 の15日目の記事です🎅🎄 こんにちは。KINTOテクノロジーズ株式会社でQAエンジニアをしているおおしまです。今回は、51歳の私が今年一年間、AIに助けてもらいながら業務に向き合ってきた経験と、その活用の仕方についてご紹介します。ほぼ自分語りになりますが、お付き合いいただければ幸いです。 前提:AI推進の機運と現場の課題に挟まれて — 51歳からの挑戦 私の勤務するKINTOテクノロジーズでは、会社全体としてAI活用を強く推進する機運があり、専門部署の設立や数多くの研修機会の提供、社内環境の整備・アップデートなど、非常に恵まれた環境が整っています。そんな状況に身を置くと、 「使わない手はない」という気持ちになる のは自然なことでした。 一方、私がメインで担当していた案件は、既存Webサービスの改善や機能追加を小さな単位で素早くリリースするものでした。規模は大きくありませんが、短期間で高品質を求められる開発・テストは常に厳しく、キャッチアップに苦労する日々。 自動化や仕様整理の効率化は必須であり、AIはそれを支える重要な道具 という認識は持っていました。 黎明期:まずは触ってみる — AIとの距離を縮めたきっかけ 昨年までは公私ともにAIに触れる機会はほとんどありませんでしたが、社内の機運もあり「学んで使えるようになりたい」という漠然とした思いはありました。そんな中、外部講師によるAI研修を受けたことが大きな転機になります。 研修は初歩的な内容でしたが、印象に残ったのは「毎日プロンプトを書いてAIと触れる」という講師のアドバイスでした。世の中の大きな成果を見上げるのではなく、少しずつでも使うことを習慣化する。これが私の中で「スモールスタートでも継続する」という意識に変わった瞬間でした。 この時期はまだ実務とは関係ない形で、 AIと仲良くなるための時間を過ごして いました。 習熟期:現場の必然に応える — 短納期対応でのAI活用模索 最初は業務無関係にプロンプトを書いて、期待通りの答えなのか質問の仕方が悪いのかといった試行錯誤をしていました。そのうち実業務で効率化できないかと抱えてきた課題について、小規模なものからAIで解決できないか試すようになったのが研修から3か月ほど経過したくらいです。 それまでは実務ではAIは全く活用していませんでしたが、このくらいならできそうという感触を実務での困りごとの解決に生かすように仕向けてみました。 結果としてはいろいろできそうという感触がありつつ、 まだ実戦投入にはしんどい状態 というのがこの時期です(案件内容によっては現在もこの状態です)。 開花期:自動化の可能性を掴む — コード生成とプロセス変革 今年9月、社内では「Vibe Coding Challenge」という企画が行われました(詳細は 別のテックブログ記事 で紹介しています)。QAというコーディングが主業務ではない私たちにとっても、この企画は業務の進め方を発展させるきっかけになりました。 具体的には、テスト実施やデータ作成に必要な自動化コード生成でAIが大いに役立ちました。 これが出来たらいいなと願いがありながらスキル不足でできなかったこれらの作業をAIの助力であっさりクリアできたこと。これまでマニュアルテストで確認していたもののうち 自動で置き換えできる領域の拡大可能性が見えた ことが大きな成果でした。 適応期:実戦投入と成果 — 高頻度リリース現場でのAI活用 可能性が見えてきた一方、現場のスケジュールは相変わらず厳しく、むしろ以前よりタスク量は増加。期間延長はできない中で、もうAIに頼らざるを得ない状況でした。 とはいえ、まだ社内コンセンサスが十分ではないため、従来の手法で検証を行いながら、AIによる自動テストでカバーできる部分を徐々に増やす方針を採用しました。 案件詳細はお伝えできませんが、これまで「5車種を3日間で確認」していたペースを、AI活用によって「5日間で60車種以上」をこなすことに成功。今後も続いていく同種の案件では、この成功をベースにより効率的な進行が可能となり、 大きな成功体験 になりました。 展開期:情報共有と発信 — 知見を広げる挑戦 得られた知見はまずQAグループでの定例ミーティングで共有していきました。その後、社内外の勉強会で複数回登壇して成果を外部発信する機会をいただきました。まだまだ先を走る人から見ると小さな成果かもしれませんが、 他社エンジニアとの交流から新しいアイデアを得られたのは大きな収穫 でした。 2025年登壇イベント一覧 日時とイベント名 登壇タイトル 内容 3月27日 JaSST Tokyo QA作業における生成AI活用事例 SpeakerDeck ※弊社ブース前でのミニセッションでプログラムには記載なし 9月24日 CO-LAB Tech Night vol.3 生成AIを自動テストに活用していくための試行錯誤と見えたもの — 11月14日 TokyoTestFest Claude Code × Playwright環境で自然言語による指示のみでフロントエンドテストを自動実行できた話 ※弊社ブース前でのミニセッションでプログラムには記載なし 11月20日 AI時代の開発現場 — 成功と失敗のリアル共有会 Claude Code × Playwright環境で自然言語による指示のみでフロントエンドテストを自動実行できた話 SpeakerDeck ※11/14とほぼ同じ 登壇機会が多かった理由としては会社がシンポジウムのスポンサーになったり、勤務先のOsaka Tech Labにイベントスペースがあって会場として多くの勉強会が開催されたりしたことが大きな助けになりました。そのほか、稚拙な内容ながらも恥を忍んで登壇できたのは、50歳を超えた厚かましさのおかげかもしれません。 終わりに:未来への展望 — AI4QAからQA4AIへ、次の挑戦 今年の取り組みは、とある勉強会で知ることになった今風の用語をお借りして「AI4QA:QA業務にAIを活用」の実現となります。一部できつつあるものの、まだまだ完成には程遠い出来というところも実感しています。この取り組みは来年以降も継続していきます。 その一方で、「QA4AI:AIに対してQAする」も世間的には進んできているようです。弊社でも各サービスや製品をAI活用を前面に押したものが増えるのではないかと想像しています。となると、これまで個人的には想定していなかったAI自体に立ち向かう時代も遠くないと感じています。 これはAI4QA以上の難関で、何をすればいいのかも見当が付きません。ただ、QA4AIが求められるのは、厳しくしんどい仕事である一方、51歳の私でも伸びしろを感じられる刺激的な面がある楽しみもあります。 とはいえ、自分自身の向上も大事ですが、エンジニアの仕事はいいサービス・製品を提供することが第一です。AI4QAでこれまで出来なかったことの実現や時間がかかったことが短縮できた成果を広げていくことは大事ですが、効率化による時間的・精神的余白が出来たことで人間だからできる品質向上への貢献ができれば、高速リリースの時代でもお客様に満足していただけるリリースに貢献できるのではと思います。 今年はこれまで触れる機会がなかったAIにある程度向き合うことができました。来年以降もしっかり向き合っていきたいと思います。
アバター
はじめに こんにちは。KINTOテクノロジーズ株式会社(以下、KTC)でフロントエンド開発をしている佐藤です。 この記事では私が属しているKINTO中古車サイト開発チームについて紹介させていただきます。 主に開発の進め方や体制などをお伝えできればと思います。 最近日傘デビューしました。佐藤について詳しくは こちら KINTO中古車サイト開発チームって? 通常KINTOで契約すると新車でサブスク開始となり その後契約終了するとその車両が返却されます。 返却された車両を中古車のKINTOとして 再びEC販売する「 KINTO 中古車 」のプロダクトを 開発、運用をメインとしているチームです。 「KINTO 新車」と大きく違うポイントとして、 中古車は基本的に早い物勝ちの一点物商品となりますので 日々在庫変動があるECサイトとなります。 在庫の見せ方、おすすめコーナーなど ECサイトならではの施策や打ち出し方がやりがいの一つでもあります。 チーム内体制(2025年11月時点) プロダクトマネージャー 1名 プロデューサー 1名 フロントエンドエンジニア 5名 バックエンドエンジニア 8名 チームの雰囲気 チームの様子 フロントエンド(FE)、バックエンド(BE)チーム、業務委託のパートナーさんとも 垣根なく気軽に会話コミュニケーション、意見が言い合える雰囲気です。 また中古車のビジネスチームとも距離が近く、 意見を言ったり一緒に中古車サイトを育てていこう!という気持ちで 皆同じ方向を向いていると思います。 たまに他部署の方がビジネス定例会議に参加される事があるのですが、 「非常に雰囲気の良い会議ですね」のようなありがたいお言葉を 耳にすることもあり嬉しい限りです。 **チームメンバーを一部ご紹介!** 中古車フロントエンドのチームメンバーが執筆した記事もありますので ぜひこちらもチェックしてみてください! NAKAHARA Yuki サッカーの応援が大好き 自作キーボードで作業効率UP! NAKAHARA Yukiさんの記事↓↓ Lambda@Edge & Next.jsによるサイト画像最適化 ![Ren.M](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/minakawa.png) Ren.M - バスケ部部長!ポイントガードで輝いています - iPhoneはハイエンド機種に限る! - Ren.Mさんの記事↓↓ - [TypeScript入門](/posts/2024-04-10-TypeScript入門/) - [社内部活動紹介-バスケ部編-](/posts/2024-09-26-社内部活動紹介-バスケ部編/) 体制 中古車サイトは様々なステークホルダーと 関わりながら運用されています。 チーム 役割 所属 中古車ビジネスチーム ビジネスオーナー 株式会社KINTO 中古車サイト開発チーム 開発全般を担当 株式会社KINTOテクノロジーズ クリエイティブチーム ディレクションやサイトデザインを担当 株式会社KINTOテクノロジーズ 分析チーム アクセス数やCVRなどを管理 株式会社KINTOテクノロジーズ :::message 豆知識「KINTOテクノロジーズ(KTC)の役割」 ::: KTCはトヨタグループ各社が展開するモビリティサービスをテクノロジーとクリエイティビティでリードするために創設されたテックカンパニーです。KINTOもトヨタモビリティサービスの一つとして、KTCが内製開発を担っています。 KINTO(KINTOの運営領域)、KTC(KINTOの開発領域)と 専門領域を分担し協業することによって強みを活かしております。 開発の進め方 中古車サイトの開発ではビジネス定例を軸としてやることを決めていき、 HCDという開発手法を元にPDCAのサイクルでECサイトをグロースハックしています。 ビジネスチームを中心とした4チームで進めており、 皆で意見を出し合いながら主体性を持って開発しております。 HCDとは ユーザーテストの様子 人間中心設計(Human Centered Designの略称)のことを指し、 ユーザーのニーズを理解し、 どうやって製品に反映させるかを中心に設計する手法となります。 中古車チームでは 具体的に実際にアンケートやユーザーテストを行い、 サイトの改善点、ユーザーの欲求などを整理して改善に繋げています。 ユーザーテストは何を思って操作しているかなど、 コミュニケーションをとりながら実施するので 予想外な気づきがあったり 開発者としても非常によい経験となっております。 進め方の例 PDCAサイクル 内容 担当チーム Plan(計画) 分析チームのレポートやお客様の声、 ビジネスとして実現した事などを元に目標、 改善案などを設定 皆で意見出し合い、構成、デザインなどを決めていく (fixするまで何度か繰り返す) ・中古車ビジネス ・中古車開発 ・クリエイティブ ・分析 Do(実行) 開発〜リリース ・開発 Check(評価) 数値をチェック 結果の議論 ・中古車ビジネス ・中古車開発 ・クリエイティブ ・分析 Action(改善) 評価を元に必要であれば次の計画へ ・中古車ビジネス ・中古車開発 ・クリエイティブ ・分析 ビジネス定例 ビジネス定例の様子 週次ミーティングで中古車ビジネスチームと情報共有をしつつ、 改善の相談やサービス拡大の対応を検討しています。 中古車ビジネスチーム、クリエイティブチーム、分析チームがあり ミーティングではそれぞれの立場で参加しています。 中古車ビジネスチーム北畑さんのファシリテートが私は好きで アイスブレイクなど形式張ったコーナーはないのですが 終始とても良い雰囲気で進行してくださります。 北畑さんについては こちら 定例はこのようなアジェンダ構成になります。 各チーム共有 中古車ビジネス 中古車開発 分析 クリエイティブ トピックス 問い合わせがあった内容をもとに改善策を皆で考える やりたい事の相談 施策の結果など 開発チームでの取り組み 開発に伴い、さまざまな取り組みを実施しています。 最近ではAIを使った開発や 外部サービスのFindy Team+を活用した開発プロセスの改善など を積極的に取り入れています。 項目 詳細 AI関係 ・Devin  ・軽微な修正や、資料作成など ・Copilot  ・ソースコードレビュー  ・実装の補佐 ・RCA(Root Cause Analysis)  ・AIによるクリティカルアラート原因分析 開発内部定例 ・スクラムイベント ・勉強会 ・ペアプロ 開発プロセス改善 ・Findy Team+ ・コードレビュー周りのプロセス改善 インタビュー 私、佐藤が関係者にインタビューしてみました。 ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) 開発FEリーダー佐藤 「野辺さん入社して3ヶ月ほど経ちましたが中古車サイト開発チームについて感じた事などありますか?」 ![開発P野辺](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/nobe.png) 開発P野辺 「各開発定例に参加させていただき、皆発言していて意見が言いやすい環境なんだなと特に印象的に感じました」 「そしてすぐ意見を取り入れ皆でよくしていこうという気持ちが伝わってきましたね」 ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) 開発FEリーダー佐藤 「ありがとうございます。野辺さんからも早速ご意見いただいたり、改善の提案をたくさんいただいているので非常に感謝しています」 「BEチームの最近はいかがでしょうか?金田さん」 ![開発BE(リーダー)金田](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/kaneda.png) 開発BE(リーダー)金田 「そうですね、BEチームも生産性アップの試みや勉強会なども開催し、チームメンバーのスキル底上げをしていますね」 「最近だとドメイン駆動開発に注力しています」 ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) 開発FEリーダー佐藤 「ありがとうございます。いつもBEチームの取り組みや成功事例などご共有していただきFEチームの改善にも参考になっております」 「FE、BE問わずチーム全体としてよりよくしていきたいですね」 「中古車ビジネスチーム北畑さんともお話ししてみましょう。中古車サイトの開発体制についていかがでしょうか?」 ![中古車ビジネスチーム北畑](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/kitahata.png) 中古車ビジネスチーム北畑 「いつもテンポよく新しい機能などがリリースされ日々改善されていく事を実感しています。まずやってみてPDCAを回すスタイルは我々にとって非常にマッチしたやり方だと感じています」 「職責や役職に関係なく、誰が何を言ってもよいのがこのチームの良いところです。ビジネス側で思いもつかなかったことを開発側が提案してくれることも多く、皆でビジネスをしている感覚です」 ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) 開発FEリーダー佐藤 「ありがとうございます。それぞれのチームが一丸となって開発、運用ができていると私自身も感じております」 「引き続きKINTOのファンを一人でも増やしていきたいですね」 「最後にPDM水内さんに質問です。開発チームに期待していることはどんな事ですか?」 ![開発PDM水内](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/mizuuchi_1.png) 開発PDM水内 「開発だけやっていればいいわけではなく、サービスが成長することを念頭にサイトをどう改善していくかをミーティングで会話している。そのためメンバーにも発言してもらってより良いサイトにしていきたい」 「理想の働き方として、あなたの業務はこれですと決めるつもりはないので各自出来ること、気づいたことを自発的にやってもらいたいです」 「技術はやりたいことを叶えるための手段なので技術ファーストではなく、サービスファーストで開発できるメンバーであってほしいです。その観点でメンバーを採用しています」 ![開発FEリーダー佐藤](/assets/blog/authors/Keita.S/2025-10-20-UpTeamWebsiteImprovement/sato.png) 開発FEリーダー佐藤 「サービスファーストであり、自発的に開発できる方が理想なのですね」 「私も自社サービスを育てていくという意味で重要な視点だと思いました。ありがとうございます」 さいごに 少しでも中古車サイトの開発の進め方や雰囲気が伝われば幸いです。 また他にもチームの雰囲気や進め方などこちらでもご紹介しております! ご興味のある方はぜひ一度読んでいただけると幸いです。 “とりあえずやってみる”から始まる開発文化。KINTO 中古車チームが語る、推進力と柔軟性の裏側
アバター
この記事は KINTOテクノロジーズ Advent Calendar 2025 の14日目の記事です🎅🎄 はじめに 2025年にKINTOテクノロジーズのQAGに入社したメンバーで、アドベントカレンダーに参加しました! 入社してからこれまでのQAとして取り組んできたトピックをまとめています。 同じQAの方々にはアイデアのきっかけとして、開発の方々には「QAってこんなこともやるんだ」という認知の拡大につながればと思います。 テスト効率化のためのWebAppの作成 自己紹介 とみよしです。前職でも第三者検証でQAをしていました。開発経験はほとんどありません。 内容 ある日こんなことが。 スマホ端末でチャットに文言入力するのに効率よくテストをするためにはどうすればいいだろうかという話に。 いっそのことAIを使ってWebAppを作るか!という案が出ました。 なので作りました!! コピー ペースト 仕組みとしては作業自動化ツールのZapierを使用し、 AIで生成した質問をGoogle SpreadSheetにDBとして格納、 Google App Scriptを使用してWebAppとして作成しました。 ツール 行っていること 参考画像 1 Zapier form画面の作成。 Zapierの機能としてInterfacesからformの作成を行うことができます。 2 Zapier AIによる質問生成 form画面から入力された内容を元に質問を生成します。 ー 3 Zapier Googleスプレッドシートへの連携 生成した質問をGoogleスプレッドシートに連携します。Zapierの標準機能としてこちらの連携が行えます。 ー 4 Googleスプレッドシート DBの代わりとして使用 Zapierから連携した質問内容を保存する ー 5 GoogleAppsScript DBの代わりとして使用Zapierから連携した質問内容を保存する ー これを作成するにあたって最初はできるのか?と思いながら進めていましたが、 AIにどうすればできるのか、どうやればいけるのかなど細かく聞きながら進めていきました。 Zapierでスプレッドシートに連携することはできました。連携している内容に生成された質問JSON(D列)があります。 このJSONのquestionsの内容を一覧にして一つ一つコピーできるようなwebを作成したいです 添付:ダウンロードしたGoogleスプレッドシートのExcelファイル もちろん一発でできるわけもなく、AIに生成してもらったコードをそのまま利用してもエラーが発生しました。 そのエラーに対してもAIに一つ一つ確認していくことで今のような形になりました。 当初は検索機能などもなかったため、利便性の面ではやや物足りない状態でした。 ただ一度に大量のことを要求することはせず、細かく機能追加を行うように指示したのが今回はうまく行った要因かと思っています。 このように行っていったおかげでコードについてもほとんど自分からは手を加えてはいません。 ひたすらこうして欲しいと言ったのを繰り返し、コードと向き合っていた期間としては1〜2日程度で作成してくれました。 このWebAppであらかじめチャットに入力する内容を登録しておき、 スマホ端末でアクセスしてコピペをするだけになったことで、 ひたすらキーボード入力するよりは効率的に実施できるようになりました。 初のWebApp作成でしたがAIと二人三脚で何とか作り上げることができました。 開発ほぼ未経験でもこうして作り上げることができるので今後も挑戦していきたいと思います。 付録 Zapier: https://zapier.com/ Googleスプレッドシート: https://workspace.google.com/intl/ja/products/sheets/ Google Apps Script : https://developers.google.com/apps-script?hl=ja Appium環境構築初心者の体験談を発表してきました 自己紹介 ろきです。前職ではニュースアプリの会社でQAをやっていました。開発未経験です。 内容 こんにちは! 先日、 Appium Meetup Tokyo #3 で「Appium環境構築の初心者つまづきポイント」についてLTしてきました。 形式はオンラインとオフライン両方。時間は15分くらいで、スライドを使って4つのポイントを紹介しました。 そもそもAppiumに興味を持ったのは、「コーディングの第一歩を踏み出せそう!」と思ったから。 とはいえ、初心者だと環境構築で詰まってしまって心が折れることもありますよね。 私自身もかなりハマったので、「同じようなところで困っている人に少しでも役立てば…」と思って発表しました。 話したポイントはこんな感じです。 エラーはAIに聞くと意外と解決できる バージョン合わせはAppium公式HPを見ると確実 必要なツールだけ起動してツールの競合を防ぐ Gitコマンドは触って慣れるのが早い 登壇後、参加者の方から「あるあるばかりで共感できました!」と言ってもらえたのが嬉しかったです。 人前で話すのはやっぱり緊張しますが、終わったあとはホッとしました。 これからも少しずつコーディングに挑戦して、できることを広げていきたいです。 付録 https://speakerdeck.com/kintotechdev/appiumwodong-kasumatenotumatukihointo-chu-xin-zhe-kagan-sitariarunabi-toxue-hi Playwrightによる自動化 自己紹介 ひがしです。前職では第三者検証のQAをしていました。開発経験はほとんどありません。 内容 僕が入社して印象深かった経験は『テスト自動化』です。 前職では全くしたことがありませんでしたが、上長と先輩社員から「やってみる?」とお話を頂いた時は「ぜひ!」と二つ返事するくらいワクワクでいっぱいでした! ジョインした案件では、様々な申込条件で申込完了までの一連のフローを確認するリグレッションテストが必要となりました。 そこで、それを自動化で実施するために、この案件専用のリグレッションテスト用スクリプトを作成することになりました。 また、僕の所属チームでは、E2Eテスト自動化のためのツールとして『Playwright』を採用しており、 既に先輩社員がデータ作成用やリグレッションテスト用のスクリプトをある程度完成させている状態でした。 それらのスクリプトを参考に、指定された申込条件のスクリプトを作成するお手伝いをさせていただきました。 参照するスクリプトがあるものの、 プルダウンの選択値やテキストボックスの入力値、押下するチェックボックスやボタンなど、コンポーネントの操作が1つ異なるとそこで要素取得エラー等が出て、 なかなか思うように作業を進めることができないことがありました…。 そこで僕がお世話になったPlaywrightの機能が『コード生成機能』です。 この機能は、ブラウザ操作を録画し、その操作に対応する自動化用コードを出力してくれるものになります。 この機能を使い、一度申込条件に沿ったブラウザ操作を行なってみることで、 初心者でもすごく簡単にコード生成および要素の取得ができ、エラーを解決することができました。 (例:”取扱車種一覧を見る”をクリックする操作を録画) 他にもまだ知らないPlaywrightの便利な機能があると思いますので、 先輩社員に尋ねたり自身で調べながら少しずつ使用できるようになり、徐々にPlaywrightに慣れていきたいです。 Appium周りの対応と開発ルール周り整備を行った話 自己紹介 mです。KTC入社と同時にQAへジョブチェンジしました!前職まではAndroidアプリの開発をしていました。 内容 最近、Appiumを用いたE2Eテストの自動化に挑戦する機会がありましたのでその内容についてです。 主に2つのポイント、単体テストとE2Eテストの違いと所感、そして開発ルール周りの整備について触れます。 1. AppiumによるE2Eテストの導入 E2Eテストとはユーザーが実際に行う操作を端末上で再現し、アプリ全体の動作を検証するものです。 Appiumを使ってAndroidアプリとiOSアプリのE2Eテストの作成に取り組みました。 その中で特に課題となったのが実行にかかる時間です。 E2Eテストでは待機時間の発生が避けられません。具体的には、以下のような待機時間が発生します。 UI操作の待機 画面描画の待機 通信処理の待機 待機時間の増加に伴い、テスト実行時間とコストも増大します。 そのため、どのシナリオからテストを優先するかの判断や、外的要因によってテストが正常に実行できない場合に備えたリトライ処理の設計が重要になります。 現在は相互レビュー時に処理内容について相談することで、実行速度の高速化を進めています。 その結果、一部処理の負荷軽減を実現できました。引き続き検討と対応を進めていきたいと思います。 2. 開発ルール周りの整備について プロジェクトのメンバーが増えてきたため、ブランチ戦略やブランチ保護の設定見直し、PRのルール策定など開発にまつわるルールの整備を行いました。 ブランチ戦略の変更 以前はGitHub Flowを採用していましたが、現在はGit Flowに変更しました。 この変更の主な理由は、利用するアプリのバージョンごとにリリースを管理したかったためです。 Git Flowを採用することで、機能開発やリリースの管理が明確になり、複数のバージョンを同時に扱う際の混乱を軽減できます。 ブランチ保護の設定見直し 実運用環境で動作しているmainブランチで、 自身含めて新規でアサインがあった開発者の各個人の環境によって動作しない事象が発生していました。そのため、mainおよびreleaseブランチへのPR作成時に GitHub Actionsのワークフローを利用して 自動的に動作確認(全テスト実行)が通るかどうか確認できた場合のみマージ可能とする設定に変更しました。 PRのルール策定 開発者がそれぞれ以前のPRで何を対応していたかを明確にするため、 以下の項目を含むPRテンプレートを用意しました。 対応内容概要 詳細 動作確認した内容 レビュー時に確認して欲しいこと このテンプレートにより、PRの内容が整理されレビューが効率的になることを目指しています。 これにより、さらに安定・安全に開発を進めるための基盤を整えることができました。チーム全体で協力し、より良い開発環境を作り上げていきたいと思っています。 今回ご紹介したようなAppiumを用いたE2Eテスト自動化の取り組みや、 QA観点での開発ルール整備については社内イベントでも継続的に発信しています。 大阪支社(Osaka Tech Lab)にてCO-LAB Tech Nightというイベントを毎月実施しておりますのでぜひご参加ください、、、! QA回で登壇させていただいたときの様子です。 最後に 最後まで読んでいただきありがとうございます。 今回の内容が皆様のQA活動のきっかけの一つになれば幸いです。
アバター
This article is the Day 14 entry for the KINTO Technologies Advent Calendar 2025 🎅🎄 Introduction We, members who joined KINTO Technologies' QA Group in 2025, have participated in this Advent Calendar campaign! This blog describes the topics we have worked on as QA team members from our joining the company to date. We hope it serves as inspiration for QA professionals and helps developers understand that QA has tasks which are not perceived well. Creating a Web App for Test Efficiency Self-introduction I'm Tomiyoshi. I worked as a QA in third-party verification at my previous job. I have almost no development experience. Content One day, something came up. We discussed how to efficiently test text input in a chat on mobile devices. Someone said, "Why don’t we just use AI to create a web app? So, I built one!! Copy Paste The system uses Zapier, a process automation tool. After questions generated by AI are stored in Google Spreadsheet as a database, we use Google Apps Script to create the web app. Tool What a Tool Does Reference Image 1 Zapier Creating a form screen Zapier's Interfaces feature allows you to create forms. 2 Zapier AI-powered question generation Generates questions based on input from the form screen. — 3 Zapier Integration with Google Spreadsheet Links generated questions to Google Spreadsheet. This integration is enabled as a standard Zapier feature. — 4 Google Spreadsheet Used as a database substitute Stores question content shared from Zapier — 5 Google Apps Script Displays the web app based on the question content stored in Google Spreadsheet — When I started creating the app, I was in doubt that I could finish it. I proceeded by asking AI for details about how to accomplish each step for the app creation. I was able to link Zapier to the spreadsheet. The linked content includes the generated question JSON (in Column D). I want to create a web page that lists the contents of the questions in this JSON and allows for copying each one individually. Attachment: Downloaded Google Spreadsheet Excel file Of course, it didn't work on the first attempt, and errors occurred when I used the code generated by AI as-is. By checking each error with AI one by one, I was able to create the app in the current format. Initially, the app didn’t have a search function, so it somewhat lacked in convenience. However, I believe the key to success is not to request too many things at once but instruct AI to add detailed features step by step. Thanks to this approach, I rarely modified the code on my own. I simply kept writing about what I wanted to do on prompt, and AI gave shape to my ideas by coding for about 1 to 2 days. Once I registered template texts in advance to input into the chat using this web app, all I need to do is to access it from a mobile device and copy-paste, rather than to manually type texts on a keyboard, which increased the input task efficiency. This was my first web app creation, but I managed to build it, collaborating with AI. Despite a lack of development experience, I was able to create something like this, so I will continue trying to develop new things. Appendix Zapier: https://zapier.com/ Google Spreadsheet: https://workspace.google.com/intl/ja/products/sheets/ Google Apps Script: https://developers.google.com/apps-script?hl=ja Presenting My Experience as a Beginner Setting Up an Appium Environment Self-introduction I'm Roki. At my previous job, I worked as a QA at a news app company. I have no development experience. Content Hello! Recently, I gave a lightning talk at Appium Meetup Tokyo #3 about "Stumbling Blocks for Beginners in Appium Environment Setup." The event took place both online and onsite. I talked for 15 minutes about introducing four key points using slides. The reason I felt interested in Appium was that I thought this could be my first step into coding! However, as a beginner, getting stuck on environment setup may be discouraging. Since I struggled quite a bit myself, I wanted to present my experience, hoping it might be helpful for others facing similar issues. Here are the points I presented: AI is surprisingly capable of providing solutions when you ask about errors Checking the official Appium website ensures the correct versions Only launching necessary tools prevents tool conflicts Getting hands-on experience is the fastest way to learn Git commands After my lightning talk, I was happy when participants told me that they could really relate to all common issues. Speaking in front of people is still nerve-wracking, but I felt relieved when it ended. I want to continue coding little by little and expand what I can do. Appendix https://speakerdeck.com/kintotechdev/appiumwodong-kasumatenotumatukihointo-chu-xin-zhe-kagan-sitariarunabi-toxue-hi Automation with Playwright Self-introduction I'm Higashi. At my previous job, I worked as a QA in third-party verification. I have almost no development experience. Content The most memorable experience since I joined the company was testing automation. I had never done it at my previous job, but when my manager and colleagues said, "Would you like to try it?" I was so excited that I immediately said, "Absolutely!" The project I joined required regression testing to verify the entire process up to application completion under various conditions. To automate the process, we decided to create a regression test script specifically for this project. Also, my team has adopted Playwright as a tool for E2E testing automation, and my colleagues had already completed data creation and regression test scripts to some extent. Based on the scripts, I created ones for specified application conditions. Although I had reference scripts, when even one component operation differed—such as dropdown selections, text box inputs, or checkboxes and buttons to click—element retrieval errors would occur. This hindered me from making progress as smoothly as I expected... That's when I found a Playwright feature that helped me the most: the code generation feature. It records browser operations and outputs automation code for them. Using this feature for performing browser operations in line with the application conditions, even beginners can easily generate code and retrieve elements. Thanks to the feature, errors are solved. (Example: Recording the operation of clicking "View vehicle list") There are still many convenient Playwright features I don't know about, so I want to gradually learn how to use them by asking colleagues and researching on my own, thereby getting more familiar with Playwright over time. Handling Appium-Related Tasks and Establishing Development Rules Self-introduction I'm m. I made a job change to QA when I joined KTC! Until my previous job, I was developing Android apps. Content Recently, I had an opportunity to get involved with E2E testing automation using Appium, so I'll share that experience. I'll touch on two main points: the differences between unit tests and E2E tests along with my impressions, and the establishment of development rules. 1. Introduction of E2E Testing with Appium E2E testing reproduces the operations that users actually perform on devices and verifies the overall behavior of the app. I worked on creating E2E tests for Android and iOS apps using Appium. The particular issue was the execution time. Wait times are unavoidable in E2E testing. Specifically, the following wait times occur: Waiting for UI operations Waiting for screen rendering Waiting for network communication The more waiting time we have, the more test execution time and costs we need to spend in testing. Therefore, it is significant to decide which scenarios to prioritize for testing and to design retry processing for cases where tests cannot execute normally due to external factors. Currently, we are working on speeding up execution through discussions about processing content in our peer review phase. As a result, we have achieved reduced load on some processes. We will continue to discuss and address these issues. 2. Establishing Development Rules As the number of project members increased, we established development-related rules, such as reviewing branch strategies, branch protection settings, and PR rules. Changing Branch Strategies Previously, we used GitHub Flow, but we have now changed the version control system to Git Flow. That is mainly because we wanted to manage releases for each version of the app we use. Adopting Git Flow enabled clearer feature development and release management, reducing confusion when we handle multiple versions simultaneously. Reviewing Branch Protection Settings On the main branch running in the production environment, we faced an issue that the application didn’t work due to individual environment differences among newly assigned developers, including myself. To overcome the issue, we changed the branch settings to enable merging in creating PRs for the main and release branches only when GitHub Actions workflows automatically verify that operation checks (running all tests) pass. Establishing PR Rules To clarify what each developer was doing for previous PRs, we prepared a PR template including the following information: Summary of changes Details What was verified What reviewers should check This template was designed to organize PR content and make reviews more efficient. It helped us establish a foundation for more secure and safe development. We want to work together as a team to create an even better development environment. We continuously share initiatives like E2E testing automation using Appium and development rule establishment from a QA perspective at internal events. We currently hold a monthly event called CO-LAB Tech Night at our Osaka branch (Osaka Tech Lab), so please join us...! Here's a photo of the event when I presented at the QA session. Conclusion Thank you for reading to the end. We hope this content serves as inspiration for your QA activities.
アバター
こんにちは。プラットフォームGでPlatformEngineeringの考え方をベースにツール周りの開発・運用・展開の役割(とエンジニアリングマネージャーと本格的にアプリケーション開発もやり始めて、よくわからなくなった) 島村 です。 この記事は KINTOテクノロジーズアドベントカレンダー2025 の14日目の記事です🎅🎄 社内モニタリング基盤をリプレイスするにあたって、ECSやManagedServiceではなく、EKS上に構築した話についてお話しをします。 背景 弊社では元々、 社内モニタリング基盤 OpenSearch (Log + Alert + Visualization) Managed Prometheus (Metrics) Managed Grafana (Alert + Visualization) X-Ray (Trace + Visualization) SaaS NewRelic (ALL) となっていました。基本、そんなに監視運用レベルが求められないものはモニタリング基盤、ガッツリ色々見たい+関連サービスがあるものはNewRelicというような感じです。 OpenSearchについては、本当はバージョン追従をするべきなんですが、古いままで運用し、 2025/11についにEOLになりました。 コストや運用の手間を減らす目的と、AIのベクトルストアで使えるか確認のため、Serverlessの検証なども行ったんですが、「確認の際に横断的に見えないというのは課題だ」、ということで、全体的な刷新を行うことにしました。 合わせて、RCA(RootCauseAnalysis)の情報取得元としても使いやすくしようということで、関連プロジェクトとしてプロジェクト化しました。 (RCAの概要はこちらのイベントのLT参照) まずはStackを決める まず、弊社のワークロードの基本構成はECS+Fargateです。AWS上に環境を作る場合、PackModuleと呼ばれているTerraformのモジュール群があります。→ 過去参考動画 なので、ECSをベースに考えたのですが、制限事項も多いことから、まずは求められること(要件)を整理しました。 したいこと 横断的にLog/Metrics/Traceが可視化できること (リソース、ライセンス的に)安価であること 切り替えが容易であること Fluentbitでログを、AdotCollectorでMetrics/Traceを転送している部分を大きく変更しない。 永続ログはS3に保存できること モニタリング基盤から保存ではなく、途中でAWSコンポーネントからの転送でもOK NewRelicより可能なら長く検索できる期間があること 特に、2番目については、NewRelicというSaaSツールも既にありますから、使用するアプリケーションユーザ側の予算的に今までより高価になると意味がありませんでした。 しないこと こちらも重要だと思います。最低限必要なものを整理して、あれもこれも…とやると時間と手間が増えます。 AWSのアカウントは既存と同じにする 運用アカウント分割を過去は検討したが、現状ではやらない CloudInfraチームやSCoEなど、アカウント増やすなら関係各所が増えるのと、アカウント自体のセキュリティールールの運用のため Profile可視化(Pyroscope) アプリケーション担当者へのトランスファーや運用手順が増える S3にある永続ログを検索できるように戻したりとかはしない 生成AI周りの監視基盤 最終的にはLangFuseが生えましたが、最初の時点ではスコープ外 決まったこと 使うOSS 名称 機能 概要 Loki Log保存 ログ保存。OpenSearchのOSSやElasticも悩みましたが、全体揃ってるので基本GrafanaLabs系で統一 Tempo Trace保存 トレース保存 Grafana 可視化 各種可視化とアラート。Grafanaの構築単位は任意のアプリ群にしました Alloy AWSログ転送 Lambda/WAF/RDS系のログがKinesisFirehose(HTTP)からAlloyを経由してLokiに転送 Thanos Metrics保存 Mimirではなくこちらで。メンバーのナレッジがあったため 自作Logger AWSログ転送 ALB/Cloudfrontの、S3にしか出力できないログの転送用。現行はLogStashを使用 ArgoCD GitOps GitOpsのためこちらを選択 制限事項 Thanos/MimirともにNFSをサポートしてないので、ECS+Fargateだと厳しい CNDW2025でLokiをECS+Fargateで構築した人がいらっしゃったんですけど、コンポーネントとか考慮点が多い Grafana系だとLoki以外はDockerでのDeploy手順が公式でサポートされていない Prod環境だとHelmかTankaでのデプロイメントが推奨 あ、EKSで動かすしか無いか… もともと、EKSはアプリケーション要件があれば導入を検討しようという話もありました。そのため、ちょうど良い機会としてEKSを実行サービスとして決めました。ただ、Webアプリケーションを動かしているワークロードについてはECSのままとしています。 PlatformEngineeringTeamとして、CICDのテンプレートやその他ツール群を提供していますが、アプリケーション部門にEKSを提供するメリットがあまり見えなかったことと、提供のための各種修正を考慮した結果です。 構成 ※NewRelic経路は変わらないので割愛 AWSコンポーネント この時点で、ちょうどEKSにAutoModeが発表されました。制限事項の1つ目のEFSの対応という点では、EKS+Fargateでも対応不可だったので、AutoModeを使ってみようということになりました。 AutoModeでも、ARM64を指定した設定ができ、起動するEC2のインスタンスが安価になるので、構築後にArmアーキテクチャのNodePoolを設定しています。 EKS構築以外の新モニタリング基盤の推進に向けたおしごと PackModuleの修正 最初の方 にあった、Moduleの修正です。 意識しないと移行しない(=Default値が変わらないようにする)形で修正しました。 KinesisFirehose(HTTPエンドポイント向け)のModule作成 Backupの取得をALLにしてS3へ保存( 要件4 に関連する) 呼び出す各コンポーネントModuleの修正 Lambda WAF RDS セキュリティー調整 Firehoseですが、VPC内部に作成されないので、Alloyの前段のALBにインターネット経由での通信経路となります。その場合、さすがに認証認可もなしでALBにログを送るのもNGでしたので、Headerでの認証を追加しました。 構築時にSecretManagerにKEYを保存して、Firehoseからはそれを付与して送信。ALBではその値とマッチしているか?と確認しています。 コンテナの脆弱性を検知する仕組みをECR+通知で作っており、DockerHubから直接呼び出さずに、ECRに一時的に保管する運用も行なっています。が、かなり運用負荷が高いので、どうにかしたいのが課題となっています。 移行のお願い 一番泥臭く、CustomerSuccessEngineerチーム(CSE)が各担当にお声がけをしてチケットを切って管理する形で行なっています。一部は開発タスク優先で期限からはみ出ましたが、多くのプロダクトはありがたいことに協力いただき、年内での切り替えを想定しています。 アプリケーションの担当者の変更作業としては Fluentbitの使用バージョンの変更(LokiPlugin向け) 各種Configの修正 AdotCollector ECS TaskDefinition こちらは、PlatformGでConfluenceに作業手順を準備して、提供しています。 Firehoseなどの切替は、アプリケーション担当者と日程を調整し、PlatformGとCloudInfraGでTerraformの修正という形で行なっています。 おまけ アカウント分割の対応 移行中ではあるんですが、社内のAWSアカウントの最適化が進んでおり、そちらの変更反映も実施する予定です。 ただ、EKSの前にはNLB/ALBを挟んでいるため、VPCPeeringかVPCEndpointによる対応で済む見込みです。 (´・ω・) 運用アカウントに分割する日は、何時来るのかな LLM監視や追加機能のデプロイ RCAのためのLangFuse、実行時間やメモリなどの関係からCode分析機能がLambdaをやめてEKS上に移行、AWSメトリクス収集のための YACE のデプロイなど、モニタリング・RCA関連が色々と追加で載るようになりました。 所感 基本、機能要件とか技術制限など、何かしらの理由がない場合は、AWSでコンテナなどを動かすにはECSで十分だと思います。実際、n8nとか他のOSS系はECSで起動するようにしています。 新しくジョインしたメンバーがEKSと各種Grafanaスタックに経験が多かったこともあって、ある程度、スムーズに構築や移行できたこともあります。 ただ、AutoModeの運用経験や、実際に各環境のログなどを投入していくと問題、エラーなどが出てきました。安定運用までに色々と手を打たないといけないと考えています。 やはり、K8s運用は一筋縄ではいかないと実感しました。 さいごに PlatformEngneeringチームは、社内向けの横断ツールを統制して必要なものを開発しています。 必要なものを新規作成や既存のものをマイグレーションしたり、ツールを使ってもらうためのEnablingの活動や、マーケティング技術を使った内部展開などのチームもあります。 GoldenPathの整理(そもそも業務フローの可視化・改善)も実施していく予定です。 こういった活動に少しでも興味を持ったり話を聞いてみたいと思った方は、お気軽にご連絡いただければと思います。 @ card
アバター
この記事は KINTOテクノロジーズアドベントカレンダー2025 の 13 日目の記事です🎄 はじめに KINTO開発部 KINTOバックエンド開発G マスターメンテナンスツール開発チーム・Osaka Tech Lab 所属の yuki.n( @yukidotnbysh )です。 わたしたちのチームでは各サービスと連携する管理システムを開発しています。これらは管理システムであると同時に、業務課題を解決するためのものでもあります。 そのため管理システムと言えども単純な CRUD システムというわけにはいかず、開発するシステムや業務によって様々複雑な課題が発生します。これらをビジネスロジックに落とし込むにあたって Railway Oriented Programming が効果的ではないかと考え、実際のプロジェクトで導入しました。その事例をもとにどのようなメリット・見えてきた課題があったのかをご紹介したいと思います。 Railway Oriented Programming について Railway Oriented Programming Railway Oriented Programming とは F# for Fun and Profit の運営や「 Domain Modeling Made Functional(関数型ドメインモデリング) 」の作者である Scott Wlaschin 氏が提唱した、関数型プログラミングにおけるエラーハンドリングの手法です。日本語では「鉄道指向プログラミング」と呼ばれています。 F# for Fun and Profit に投稿された 同じタイトルの記事 を見ると、少なくとも 2013 年には公開されていたようです。 Railway Oriented Programming では、関数を「線路(Railway)」に例え、正常系の処理と異常系の処理を 2 本の線路として表現します。 この「線路」を複数つなぎ合わせたのが以下のイメージ図です。 各処理ステップは「スイッチ」として機能し、成功すれば正常系の処理(線路)を進み、失敗すれば異常系の処理(線路)に切り替わります。一度異常系に入ると、以降の処理では成功することはなく、エラーとして最後まで流れていきます。 具体的には Result 型を返す関数をパイプラインで次々とつなぎ合わせていくイメージです。 Railway Oriented Programming を取り入れた理由 もともとわたしたちのチームでは Rust の開発実績があり、このプロジェクトでもバックエンドサーバーの開発言語として Rust を採用しています。 アーキテクチャとしては「The Clean Architecture」の図を参考にしています(以後、便宜的にあえて「Clean Architecture」と書きます)。 過去のプロジェクトで Clean Architecture を導入した時、上の図で描かれている「Use Cases」層の処理が複雑かつ肥大化していく傾向にあり、一部処理をドメインサービスとして「Entities」層へ切り出したとしても、やはり Use Cases 層の可読性が落ちてしまうという課題がありました。 そんな中で Railway Oriented Programming の存在を知り、導入することになりました。 Rust での Railway Oriented Programming 全体の構造 わたしたちが実装した Use Cases 層は概ね以下のような構造になっています。 #[derive(Debug, thiserror::Error)] pub enum CreateUserUseCaseError { // エラー型の定義 } pub trait UsesCreateUserUseCase { /// Workflow fn handle( &self, input: CreateUserInputData, ) -> impl Future< Output = Result<CreateUserOutputData, CreateUserUseCaseError>, > + Send; } pub trait CreateUserUseCase: // 依存関係 ProvidesUserFactory + ProvidesUserRepository { } impl<T: CreateUserUseCase + Sync> UsesCreateUserUseCase for T { async fn handle( &self, input: CreateUserInputData, ) -> Result<CreateUserOutputData, CreateUserUseCaseError> { // railway モジュールで定義した関数のチェーン } } mod railway { type RailwayResult<T> = Result<T, super::CreateUserUseCaseError>; pub(super) fn validate_input(/* ... */) -> RailwayResult<(Email, UserName)> { /* ... */ } pub(super) async fn check_email_not_exists(/* ... */) -> RailwayResult<(Email, UserName)> { /* ... */ } pub(super) fn build_user(/* ... */) -> RailwayResult<User> { /* ... */ } pub(super) async fn save_user(/* ... */) -> RailwayResult<User> { /* ... */ } pub(super) fn end(/* ... */) -> CreateUserOutputData { /* ... */ } } 「 Rust の DI を考える –– Part 2: Rust における DI の手法の整理 」で紹介されている Cake Pattern を用いています(本記事の本筋とは逸れるため詳細は割愛します)。 railway モジュールに関数を定義し、それらを UsesCreateUserUseCase の handle メソッド内で結合する、という形です。 (なお、「関数型ドメインモデリング」では handle メソッドにあたる部分を「ワークフロー」、引数は「コマンド」と表現されています。本記事でもこれに倣います) これらの要素をひとつずつ分解していきます。 エラー型の定義 #[derive(Debug, thiserror::Error)] pub enum CreateUserUseCaseError { // エラー型の定義 #[error("メールアドレスが既に存在します。")] AlreadyExistsEmail, #[error("無効なメールアドレスです。")] InvalidEmail, #[error("無効なユーザー名です。")] InvalidUserName, #[error("UserFactoryError")] UserFactoryError(#[from] UserFactoryError), #[error("UserRepositoryError")] UserRepositoryError(#[from] UserRepositoryError), } Use Case ひとつに対し、エラー型を必ずひとつ定義する形で運用しています。 Rust ではエラー型を Enum で定義することができます。標準のままだと std::error::Error トレイトを実装する必要があるのですが、 thiserror クレートを使うことでエラー型の定義を簡略化できます。 また thiserror クレートで定義した場合、 #[from] アトリビュートを設定することで From トレイトが実装されるので、該当エラーが発生した時に明示的に変換をせずとも、自動的に目的のエラー型へ変換できるようになります。 RailwayResult 型 mod railway { // このユースケース専用のResult型 type RailwayResult<T> = Result<T, CreateUserUseCaseError>; } Use Case 専用のエラーをすべての関数に定義するのは大変なので、 RailwayResult 型という型エイリアスを定義して、戻り値だけ設定するようにしています。 railway モジュール mod railway { /// 入力値を検証し、値オブジェクトに変換します。 pub(super) fn validate_input( input: CreateUserInputData, ) -> RailwayResult<(Email, UserName)> { let email = Email::try_from(input.email) .map_err(|_| CreateUserUseCaseError::InvalidEmail)?; let name = UserName::try_from(input.name) .map_err(|_| CreateUserUseCaseError::InvalidUserName)?; Ok((email, name)) } /// メールアドレスが存在していないことを確認します。 pub(super) async fn check_email_not_exists( (email, name): (Email, UserName), impl_repository: &impl UsesUserRepository, ) -> RailwayResult<(Email, UserName)> { impl_repository .find_by_email(&email) .await .map_err(CreateUserUseCaseError::UserRepositoryError)? .map_or(Ok((email, name)), |_| Err(CreateUserUseCaseError::AlreadyExistsEmail)) } /// ユーザーを新規作成します。 pub(super) fn build_user( (email, name): (Email, UserName), impl_factory: &impl UsesUserFactory, ) -> RailwayResult<User> { impl_factory .build(UserFactoryParams { email, name }) .map_err(CreateUserUseCaseError::UserFactoryError) } /// ユーザーを保存します。 pub(super) async fn save_user( output: User, impl_repository: &impl UsesUserRepository, ) -> RailwayResult<User> { impl_repository .save(output) .await .map_err(CreateUserUseCaseError::UserRepositoryError) } /// 戻り値を返し、処理を終了します。 pub(super) fn end( output: User, ) -> CreateUserOutputData { CreateUserOutputData { user: output.into(), } } } railway というモジュールを作り、その中に「線路」となる関数群を定義していきます。 これは Railway Oriented Programming の流儀ではなく、単純にわたしたちが確認しやすいように目印として設けています。 この記事のコードの場合では以下の流れを想定しています。 入力値(メールアドレス・ユーザー名)の検証 メールアドレスの存在チェック User エンティティの生成 User エンティティの保存 保存した User エンティティを上位層に渡すための DTO に変換し、終了 前回の関数の戻り値が次の関数の入力値になるため、第一引数は output と命名しています。 ただし output がタプルだった場合は始めから展開しています。これはタプルのままだと変数の所有権の問題で取り扱いが面倒なためです。 基本的には前回の値だけがそのまま次の関数の入力値になることが望ましいとは思うのですが、バケツリレーのように不要な値まで渡し続ける必要が発生するなどデメリットの方が多いと判断し、各関数で新たな入力値を渡しても良いというルールにしています。 ワークフロー全体 原典では F# が使われていますが、Result 型や Either 型の概念があり、かつ関数を合成する機能がある言語(またはそれを補完するライブラリなど)であれば Railway Oriented Programming の導入は可能です。 Rust では幸い、Result 型以外にも Railway Oriented Programming を実現するのに欠かせない以下の機能が標準で備わっています。 ? 演算子:エラー発生時の処理停止を表現 map ・ and_then 関数:関数の合成 これらを組み合わせることで以下のようにパイプラインを構築することができます。 impl<T: CreateUserUseCase + Sync> UsesCreateUserUseCase for T { async fn handle( &self, input: CreateUserInputData, ) -> Result<CreateUserOutputData, CreateUserUseCaseError> { railway::validate_input(input) .map(|output| { railway::check_email_not_exists(output, self.user_repository()) })? .await .and_then(|output| railway::build_user(output, self.user_factory())) .map(|output| railway::save_user(output, self.user_repository()))? .await .map(railway::end) } } 実践して感じたメリット 以下、Railway Oriented Programming を実践して感じたメリットです。 処理の流れが明確になり、機能追加がしやすくなった ワークフローの中身がパイプラインで繋がっているので、どういう処理が行われているのかは一目である程度わかるようになりました。 もちろん複雑な仕様であればワークフローが長くなることは避けられませんが、それでも関数の流れを追えば、どこで何が行われているのかはだいたいの当たりをつけられるようになりました。 ワークフロー内の各処理も関数に切り出されていることで、それぞれの処理・変数のスコープも明確になりました。 このおかげで機能追加の場合は新たに関数を差し込むだけでよく、変更の場合は該当の関数のみ修正すれば良くなり、保守性も向上したように感じます。 処理の入出力を型で表現できるようになった これは Railway Oriented Programming と直接結びつく効果ではないと思いますが、各関数の引数・戻り値が何のデータであるかを型レベルでチェックできるようになりました。 コンパイルエラーで型の誤りを防げるようになり、処理途中で誤った値が渡ってしまうといった問題を回避できるようになりました。 単体テストが書きやすくなった ワークフローに対し正常系・異常系すべてのテストを実装するのは非常に大変だったため、各 railway 関数それぞれをしっかりテストして、ワークフローのテストではハッピーパスを通すというやり方を取っています。 Private な関数のテストコードが必要かどうかの是非はあると思いますが、それでも railway モジュールの各関数をテストできるのは個人的にメリットと感じました。いまのところは大きな問題も感じていません。 また、副次的効果として、機能追加があった場合でもその関数分のテストを追加し、既存のテストがパスすれば問題ないことが確認できるので、この点は良かったと思います。 実践して感じた課題 実践してメリットが得られた反面、やはりいくつか課題もありました。 Railway Oriented Programming の慣れが必要 普段から関数型言語に慣れている方であればそれほど違和感ない手法と思うのですが、もちろんわたし含めてそうでないメンバーもいます。そのため、この書き方に慣れるまではどうしても実装が難しくなりますし、実際、わたしも Rust で Railway Oriented Programming が実装できるか調べていた時はかなり苦戦しました。 現在は AI のおかげでかなり難易度は下がりましたが、できあがったものが適切な内容かどうかはやはりある程度の理解が必要です。そのため、メンバーに対してのフォローがどうしても必要になります。 実際のところ、このプロジェクトでも開発初期はどうしてもレビュー負荷が大きくなりました。そのため、開発規模や納期など、プロジェクトの状況・条件によっては Railway Oriented Programming の採用を見送ることも検討した方が良いかもしれません。 fatal runtime error: stack overflow が発生する場合がある 実装内容によっては実行時に Stack Overflow エラーが発生する場合があります。 コンパイルエラーとして検出されないのが非常に厄介で、かつ具体的にどの箇所が問題なのか、ソースコードを見るだけでは判断がつきません。 原因の探し方ですが、rust-lldb を使ってスタックトレースを確認することで、Stack Overflow エラーが発生したコードを特定することができます。 # LLDB でバイナリを起動する rust-lldb target/debug/your-bin # 実行 run # Stack Overflow が発生したらバックトレースを確認 thread backtrace all 解決が難しい場合の別案として、もっとも安全かつかんたんな解決策は map や and_then によるメソッドチェーンをやめ、1 行ずつ処理を書いていく形です。 async fn handle(&self, input: InputData) -> Result<OutputData, UseCaseError> { railway::begin(self.uow()).await?; let output = railway::validate_email(&input.email)?; let output = railway::authenticate(output, input.password, self.authenticator()).await?; let output = railway::update_last_access(output, self.user_repository()).await?; let output = railway::commit(output, self.uow()).await?; railway::end(output) } これはこれで悪くありませんが、メソッドチェーンによるパイプラインがなくなり、どうにでも書けてしまうという問題が発生します。なので本当にどうしても解決が難しい場合のみこの形式に置き換えるというのが安全と思います。 なお、他の方法としては RUST_MIN_STACK 変数の値を追加することでスタック領域を拡張できます。しかしこれは問題を先送りにしているだけで、いつの日か Stack Overflow エラーが再発しかねません。そのため、この解決方法はあまりおすすめできません。 ちなみにわたしの事例では、デバッグビルドの時に railway モジュール内に定義した関数の中で、非同期処理を並列実行する場合に起こるケースがありました。 async/await は Future 型の糖衣構文ですが、 rust-lang/rust#132050 を見ると実行時に Future 型の持つ状態がスタック領域へ展開されるため、多くの async 関数を実行する時に Stack Overflow エラーを引き起こしてしまうようです。 このケースでは、並列で処理したい Future 型のデータを Vec 型のデータへ格納することで対処できました( Vec 型の値はヒープ領域に格納される ためです)。 処理フローが明確になる代わりにコードは増える Rust で Railway Oriented Programming を導入すると、各関数を map と and_then でつなぎ合わせていく形になります。それに加えて、それぞれの関数を定義していく必要があるので、ふつうに書くより全体のコード量は増えます。 たとえば Railway Oriented Programming を適用しなかった場合の handle メソッドは impl<T: CreateUserUseCase + Sync> UsesCreateUserUseCase for T { async fn handle( &self, input: CreateUserInputData, ) -> Result<CreateUserOutputData, CreateUserUseCaseError> { // 入力値の検証 let email = Email::try_from(input.email) .map_err(|_| CreateUserUseCaseError::InvalidEmail)?; let name = UserName::try_from(input.name) .map_err(|_| CreateUserUseCaseError::InvalidUserName)?; // メールアドレスの重複チェック let existing_user = self .user_repository() .find_by_email(&email) .await .map_err(CreateUserUseCaseError::UserRepositoryError)?; if existing_user.is_some() { return Err(CreateUserUseCaseError::AlreadyExistsEmail); } // ユーザーの作成 let user = self .user_factory() .build(UserFactoryParams { email, name }) .map_err(CreateUserUseCaseError::UserFactoryError)?; // ユーザーの保存 let saved_user = self .user_repository() .save(user) .await .map_err(CreateUserUseCaseError::UserRepositoryError)?; // 結果の変換 Ok(CreateUserOutputData { user: saved_user.into(), }) } } となり、関数がなく代わりに handle メソッドの中(または部分的に関数を切り出すなど)で実装することになります。このため、場合によってはこの方がシンプルなこともあると思います。 なので、かんたんな処理・分岐がほとんどといったアプリケーションの場合、無理に Railway Oriented Programming を採用しない方が無難かもしれません。 余談:「リポジトリパターンはどこにある?」 この記事の本筋とは直接関係しませんが、「関数型ドメインモデリング」では「リポジトリパターンはどこにある?」という題でリポジトリパターンについて言及されていて、関数型のアプローチではリポジトリパターンを すべてを関数としてモデル化し、永続化を端に追いやることで、リポジトリパターンは必要なくなります。 と書かれています。 しかしわたしがこのことについての意図・方法を読み切れなかったため、この記事のコードおよびわたしたちのプロジェクトではリポジトリパターンを採用しています。 おわりに 以上、Railway Oriented Programming を Rust で実践した内容についての紹介でした。 Rust は非常に表現力が豊かで様々な機能を持つ言語ですが、Railway Oriented Programming を採用することでより強化できるのではないかと感じています。 もし同じように Rust で Railway Oriented Programming の採用を検討している方がいらっしゃいましたら、この記事が少しでも参考になれば幸いです。
アバター
This article is the Day 13 entry for the KINTO Technologies Advent Calendar 2025 🎄 Introduction I'm yuki.n ( @yukidotnbysh ) from the Master Maintenance Tool Development Team in the KINTO Backend Development Group, KINTO Development Division, based in the Osaka Tech Lab. Our team develops management systems that integrate with various services. These systems serve not only as administrative tools but also as solutions to business issues. To address these challenges, our management systems cannot be simple CRUD applications. Each system and its business requirements bring various complexities. I believed Railway Oriented Programming would be effective for handling these complexities in our business logic, so I introduced it in a project. Based on this case study, I would like to share the benefits we gained and the issues we faced. What is Railway Oriented Programming? Railway Oriented Programming Railway Oriented Programming is an error handling approach in functional programming proposed by Scott Wlaschin, who runs F# for Fun and Profit and authored Domain Modeling Made Functional . Looking at the article with the same title posted on F# for Fun and Profit , it seemingly have been published at least as early as 2013. In Railway Oriented Programming, functions are compared to railways, with success and failure handling represented as two separate tracks. The following diagram shows multiple of these railways connected together. Each processing step functions as a switch: if successful, processing continues on the success track; if it fails, it switches to the failure track. Once on the failure track, subsequent processing never succeeds, and the error flows through to the end. Specifically, this involves chaining functions that return Result types through a pipeline. Why Did We Adopt Railway Oriented Programming? Our team already had experience developing with Rust, and we adopted it as the backend server development language for this project as well. We designed the project architecture, according to the Clean Architecture diagram—for convenience, simply hereinafter referred to as Clean Architecture. When we introduced Clean Architecture in past projects, we found that the processing in the Use Cases layer (as depicted in the circle diagram above) often results in an unnecessarily complex and clunky structure design. Even when we carved some processing as domain services to combine them into the Entities layer, the readability of the Use Cases layer still suffered. In this situation, I learned about Railway Oriented Programming, which led to its adoption. Railway Oriented Programming with Rust Overall Structure The Use Cases layer we implemented has roughly the following structure. #[derive(Debug, thiserror::Error)] pub enum CreateUserUseCaseError { // Error type definitions } pub trait UsesCreateUserUseCase { /// Workflow fn handle( &self, input: CreateUserInputData, ) -> impl Future< Output = Result<CreateUserOutputData, CreateUserUseCaseError>, > + Send; } pub trait CreateUserUseCase: // Dependencies ProvidesUserFactory + ProvidesUserRepository { } impl<T: CreateUserUseCase + Sync> UsesCreateUserUseCase for T { async fn handle( &self, input: CreateUserInputData, ) -> Result<CreateUserOutputData, CreateUserUseCaseError> { // Chain of functions defined in the railway module } } mod railway { type RailwayResult<T> = Result<T, super::CreateUserUseCaseError>; pub(super) fn validate_input(/* ... */) -> RailwayResult<(Email, UserName)> { /* ... */ } pub(super) async fn check_email_not_exists(/* ... */) -> RailwayResult<(Email, UserName)> { /* ... */ } pub(super) fn build_user(/* ... */) -> RailwayResult<User> { /* ... */ } pub(super) async fn save_user(/* ... */) -> RailwayResult<User> { /* ... */ } pub(super) fn end(/* ... */) -> CreateUserOutputData { /* ... */ } } We use the Cake Pattern introduced in Thinking About DI in Rust — Part 2: Organizing DI Approaches Using Rust (only in Japanese) (I will omit the details as this diverges from the main topic of this blog). We define functions in the railway module and combine them within the handle method of UsesCreateUserUseCase . (Note: In Domain Modeling Made Functional, the part corresponding to the handle method is called workflow, and the arguments are called commands. This article follows that convention.) Let's break down each of these elements. Error Type Definition #[derive(Debug, thiserror::Error)] pub enum CreateUserUseCaseError { // Error type definitions #[error("Email address already exists.")] AlreadyExistsEmail, #[error("Invalid email address.")] InvalidEmail, #[error("Invalid username.")] InvalidUserName, #[error("UserFactoryError")] UserFactoryError(#[from] UserFactoryError), #[error("UserRepositoryError")] UserRepositoryError(#[from] UserRepositoryError), } We always define one error type for each Use Case. In Rust, error types can be defined as Enums. While the standard approach requires implementing the std::error::Error trait, using the thiserror crate simplifies error type definitions. Additionally, when defining with the thiserror crate, setting the #[from] attribute implements the From trait, allowing automatic conversion to the target error type without explicit conversion when the corresponding error occurs. RailwayResult Type mod railway { // Result type specific to this use case type RailwayResult<T> = Result<T, CreateUserUseCaseError>; } Since defining Use Case-specific errors for all functions would be cumbersome, we define a RailwayResult type alias so we only need to specify the return value. railway Module mod railway { /// Validates input values and converts them to value objects. pub(super) fn validate_input( input: CreateUserInputData, ) -> RailwayResult<(Email, UserName)> { let email = Email::try_from(input.email) .map_err(|_| CreateUserUseCaseError::InvalidEmail)?; let name = UserName::try_from(input.name) .map_err(|_| CreateUserUseCaseError::InvalidUserName)?; Ok((email, name)) } /// Confirms that the email address does not already exist. pub(super) async fn check_email_not_exists( (email, name): (Email, UserName), impl_repository: &impl UsesUserRepository, ) -> RailwayResult<(Email, UserName)> { impl_repository .find_by_email(&email) .await .map_err(CreateUserUseCaseError::UserRepositoryError)? .map_or(Ok((email, name)), |_| Err(CreateUserUseCaseError::AlreadyExistsEmail)) } /// Creates a new user. pub(super) fn build_user( (email, name): (Email, UserName), impl_factory: &impl UsesUserFactory, ) -> RailwayResult<User> { impl_factory .build(UserFactoryParams { email, name }) .map_err(CreateUserUseCaseError::UserFactoryError) } /// Saves the user. pub(super) async fn save_user( output: User, impl_repository: &impl UsesUserRepository, ) -> RailwayResult<User> { impl_repository .save(output) .await .map_err(CreateUserUseCaseError::UserRepositoryError) } /// Returns the result and terminates processing. pub(super) fn end( output: User, ) -> CreateUserOutputData { CreateUserOutputData { user: output.into(), } } } We create a module called railway and define the functions that form the tracks within it. This is not a Railway Oriented Programming convention but simply a guide we use for easier identification. In the code for this blog, we assume the following process flows: Validate input values (email address and username) Check email address existence Create User entity Save User entity Convert the saved User entity to a DTO for passing to the upper layer, and end the process Since the return value of the previous function is set as the input value for the next function, the first argument is named output . However, when output is a tuple, we destructure it from the start. This is because handling tuples as-is causes issues with variable ownership. Ideally, only the previous value should be set as the input for the next function, but we determined that the drawbacks outweighed the benefits—such as needing to pass unnecessary values as if through a bucket brigade. That is the reason we adopted a rule allowing new input values to be passed to each function. Overall Workflow The original programming convention uses F#, but Railway Oriented Programming is applicable in any language (or with libraries that supplement it) that has the concept of Result or Either types and the ability to compose functions. Fortunately, Rust comes standard with the following features essential for implementing Railway Oriented Programming, in addition to the Result type: ? operator: Expresses stopping processing when an error occurs map and and_then functions: Function composition By combining these, you can build a pipeline as follows: impl<T: CreateUserUseCase + Sync> UsesCreateUserUseCase for T { async fn handle( &self, input: CreateUserInputData, ) -> Result<CreateUserOutputData, CreateUserUseCaseError> { railway::validate_input(input) .map(|output| { railway::check_email_not_exists(output, self.user_repository()) })? .await .and_then(|output| railway::build_user(output, self.user_factory())) .map(|output| railway::save_user(output, self.user_repository()))? .await .map(railway::end) } } Benefits I Experienced in Practice The following are the benefits I experienced from practicing Railway Oriented Programming. Processing Flow Became Clear, Making Feature Addition Easier Since the workflow contents are connected through a pipeline, you can understand at a glance what processing is being performed. Of course, complex specifications inevitably lead to longer workflows, but even so, tracking the function flow helps us to roughly identify where and what is happening. With each process in the workflow extracted into functions, the scope of each process and its variables also became clear. This helped us add features simply by inserting new functions and modify them by changing the relevant function, which enhanced the system maintainability. Processing Input/Output Can Now Be Expressed Through Types I don't think this is a direct effect of Railway Oriented Programming, but we can now check by type level what data each function's arguments and return values represent. As compile errors can prevent type mistakes, we are able to avoid problems where incorrect values are passed during processing. Simplified Unit Test Scenarios Since implementing all success and failure tests for workflows was extremely labor-intensive and time-consuming, we adopted an approach of thoroughly testing individual railway functions, then only testing the happy path for the workflows. There may be controversies about whether tests for private functions are necessary, but I personally felt it was helpful to test each function in the railway module. So far, I haven't experienced any major problems with this approach. Additionally, as a secondary effect, when features are added, we can confirm there are no issues by adding tests for those functions and ensuring existing tests pass, which I think was beneficial. Issues I Experienced in Practice While gaining benefits from practice, we also faced some issues. Railway Oriented Programming Takes Some Getting Used To For those already familiar with functional languages, this approach probably doesn't feel unusual, but of course there are team members, including myself, who are not. The approach implementation is difficult until you get used to the style of writing. In fact, I struggled quite a bit when examining whether Railway Oriented Programming could be implemented using Rust. Currently, AI has significantly lowered the technical barriers for the implementation, but we humans still need to understand Railway Oriented Programming at some level to determine whether the outcomes are appropriately generated. That’s where supporting team members come in. In practice, the process of reviewing outcomes placed a significant burden on us in the early development phase of this project. Depending on the project's situation and conditions—such as development scale and deadlines—we suggest that you seek another solution instead of Railway Oriented Programming. We May Face fatal runtime error: stack overflow Depending on what kind of process is executed, Stack Overflow errors may occur at runtime. It is particularly troublesome because the error is not detected as a compile error, and you cannot determine which specific location contains issues just by searching around the source code. To find the error cause, you can use rust-lldb to check the stack trace and identify the code where the Stack Overflow error occurred. # Start binary with LLDB rust-lldb target/debug/your-bin # Execute run # Check backtrace when Stack Overflow occurs thread backtrace all When we address issues that are difficult to solve using a method chaining with map and and_then , we take an alternative solution to stop the method and write the processing line by line instead. This is the safest and easiest way to overcome tough issues. async fn handle(&self, input: InputData) -> Result<OutputData, UseCaseError> { railway::begin(self.uow()).await?; let output = railway::validate_email(&input.email)?; let output = railway::authenticate(output, input.password, self.authenticator()).await?; let output = railway::update_last_access(output, self.user_repository()).await?; let output = railway::commit(output, self.uow()).await?; railway::end(output) } The above solution isn't bad in itself, but it eliminates the pipeline through method chaining, creating the risk that we can write codes on a no-holds-barred basis. So, I think it's safest to only switch to this format when we hardly solve issues. As another option, you can expand the stack area by adding a value to the RUST_MIN_STACK variables. However, this merely postpones the issue and may cause the recurrence of the Stack Overflow errors. Therefore, I don’t recommend this solution. In my case, the error occurred in debug builds in the meantime when I executed asynchronous processing within functions defined in the railway module. async/await is syntactic sugar for the Future type, but, according to rust-lang/rust#132050 , the state held by the Future type is expanded to the stack area at runtime, which causes Stack Overflow errors at the execution of many async functions. In this case, I was able to avoid the error by storing the Future type data I wanted to simultaneously process into the Vec type data (because Vec type values are stored in the heap ). Increase in Codes in Return for Clarified Processing Flow When introducing Railway Oriented Programming in Rust, you end up connecting each function with map and and_then . Additionally, you need to define each of those functions, so the overall code volume increases compared to the one when you usually write codes. For example, if Railway Oriented Programming were not applied, the handle method would look like as follows: impl<T: CreateUserUseCase + Sync> UsesCreateUserUseCase for T { async fn handle( &self, input: CreateUserInputData, ) -> Result<CreateUserOutputData, CreateUserUseCaseError> { // Input validation let email = Email::try_from(input.email) .map_err(|_| CreateUserUseCaseError::InvalidEmail)?; let name = UserName::try_from(input.name) .map_err(|_| CreateUserUseCaseError::InvalidUserName)?; // Email duplication check let existing_user = self .user_repository() .find_by_email(&email) .await .map_err(CreateUserUseCaseError::UserRepositoryError)?; if existing_user.is_some() { return Err(CreateUserUseCaseError::AlreadyExistsEmail); } // User creation let user = self .user_factory() .build(UserFactoryParams { email, name }) .map_err(CreateUserUseCaseError::UserFactoryError)?; // Saving user let saved_user = self .user_repository() .save(user) .await .map_err(CreateUserUseCaseError::UserRepositoryError)?; // Result conversion Ok(CreateUserOutputData { user: saved_user.into(), }) } } Without functions, the implementation would be within the handle method (or with some functions partially extracted). Therefore, depending on the case, this approach might be simpler. So for applications with simple processing and mostly branching, it may be safer to unnecessarily adopt Railway Oriented Programming. P.S.: Where’s the Repository Pattern? While not directly related to the main topic of this blog, Domain Modeling Made Functional addresses the repository pattern in a section named “Where’s the Repository Pattern?” The book states the pattern in the functional approach as follows: “...when we model everything as functions and push persistence to the edges, then the Repository pattern is no longer needed.” However, since I couldn't fully grasp the intent and method behind this, we adopted the repository pattern for the code and our project described in this blog. Conclusion This concludes my explanation about practicing Railway Oriented Programming in Rust. Rust is an extremely expressive language with various features, and I feel that adopting Railway Oriented Programming can enhance it further. If you consider adopting Railway Oriented Programming in Rust, I hope this article can serve you as a helpful reference.
アバター
This article is the Day 13 entry for the KINTO Technologies Advent Calendar 2025 🎅🎄 Introduction Nice to meet you if this is our first encounter, and hello again if you've been following along! I'm Hikaru Takeno ( @t_hikarutaaaan ), and I handle engineer recruiting and recruitment PR at KINTO Technologies (KTC). The annual Advent Calendar tradition—I signed up for it again this year as naturally as breathing! (lol) This time, I'll give you a casual look at the behind the scenes of engineer recruiting and recruitment PR through a day in my life. Brief Self-Introduction It's been about 4 years since I joined KTC and about 2 years since I became a recruiter in the company. Back then, I started with absolutely zero experience in HR or recruiting. I could barely understand half of the technical discussions and would get frustrated with just sending a single scout email. In addition, at interviews, I was so nervous, so all I could do was just read my script in a monotone voice. (Now, it’s a funny story. lol) As I have been committed to recruitment without stopping, I can say this now: "I truly love this job." KTC is a company that genuinely entrusts responsibilities to members who raise their hand and say they want to try. Thanks to that corporate culture, I was able to move forward even with no recruitment experience. Now, I can host events with a smile. Engineers Are Basically Wizards A little while after becoming a recruiter, I built a small app that could analyze recruiting data using generative AI for writing the app code for me. (It may not as well-developed as apps at a professional level, though. lol) With a single click on the app, a graph appeared on screen, which I couldn't help but speak out loud, "Wow, that's amazing! It’s like magic." I was simply impressed by how technology can solve someone's problem in an instant. And that's when I thought: "I need to engage in this job more seriously." I wanted to understand what kind of passion onsite members have when they build products, thereby introducing them to the public even in a more appropriate manner. Since then, I've been busy working on my job every day. (lol) From here, let me casually show you a day in my life! Time Activity What I Actually Did How I Feel About It (Example) 09:00 Scouting time Selecting target candidates, reading profiles, drafting & sending scout messages. With a consideration of which platform should I use, I found a great candidate, always writing "why I want to reach out that person." 10:00 Resume screening Reviewing work history, sharing evaluations with onsite team members. Hmm... this person is really impressive...! 11:00 Onsite team meeting Sharing recruiting status, checking if the potential candidates meet our requirements, catching up project updates. I ask honestly when I don't understand. I’m grateful for the culture where team members kindly answer my questions all the time. 🙏 12:00 Lunch time Gobble a tamago kake gohan (rice with a raw egg). Bonito flake is a great combination with the egg. I’m so full. 13:00 Casual interview Learning about candidates’ career, introducing our products The best moment is when we can have a real two-way conversation. I often don’t enough time to understand candidates just in the single interview. 15:30 Recruitment PR planning Researching recruiting trends and competitors’ strategies, drafting plans, organizing materials I’m stuck..., needing someone to bounce ideas off. 17:00 Casual interview Learning about candidates’ career, introducing our products I couldn't answer some technical questions...so got to ask them to team members later. 19:00 Event operations Reception, photo shooting, making announcements, assisting attendees I basically running around the event venue (lol), taking photos, talking to people... OK, coming right up! Tamago kake Gohan—the most cost-effective and time-efficient meal to me Facing the Difficulties in Talent Recruitment Every Day Recruiting is a field where we can’t judge individuals on their knowledge, skills, and other characteristics. The atmosphere of a conversation with them Subtle changes in their facial expression The values behind their choices You need to carefully perceive these hard-to-see signs from candidates. I can't forget what one said: "To me, the important factor when choosing a new job is 'who I work with.'" This made me realize something— I had been so focused on conveying attractive points about working at our company. But what candidates really want to know is: "Can I entrust my career to this team?" Since then, I've strive to talk openly and honestly to candidates about our teams’ atmosphere, corporate culture, and even what we struggle with and concerns arising from our working environment. I still remember when a candidate said at the end of an interview: "I can clearly picture myself working together with you." After hearing that, I made a little fist pump in my mind. (lol) Efforts I Made for Recruitment PR This year, as part of recruitment PR initiatives, I led a speaking session at Japan Mobility Show 2025 , one of the largest mobility events in Japan. It was a project that involved stakeholders within the TOYOTA Group where KTC belongs, as well as people engaging in both real-world and IT domains. To be honest, it was the most challenging project I've ever experienced with such large number of tasks for the event coordination and high-level difficulty in handling them. (lol) Despite that, I really wanted to make the project a success—that is because I wanted to properly convey to the public our strength of taking on new things collaborating with real and IT areas. I also wanted to share the passion of our senior managers who readily agreed to work the project together. I wanted to deliver through live words the atmosphere in KTC and our passion that can't be conveyed through job postings alone. After the event, team members who had been cheering me on said, "That was really great!" and it made me so happy. When the video of the speaking session was released, employees from group companies who I work with on various tasks also gave us the following comments: "I watched your YouTube video!" "Great content!" "That was cool!" And the senior manager, who spoke at the event session, gave me these words: "The recruiting impact might come a bit later, but it'll definitely work for internal PR and KTC's self-branding." I was so incredibly happy but couldn’t find words to clearly express my feeling. (lol) Recruitment PR is a job to facilitate sharing information about the company's initiatives with future teammates. I want to be the bridge between them and our company. Myself working hard to take photos at the event venue By the way, here's the archived video of the speaking session I mentioned above! I hope you enjoy this 50-minute video packed full of passion♪ https://youtu.be/NXM2lyapia0?si=QiK5GP2XFtCh0c9c Recruiting Is Achieved through Teamwork to Build Future There's no single right answer in recruiting talents. Every time, I get lost, worry, or waver. (Honestly, I feel restless for so many days because I can’t often find any solutions for my concerns. lol) But there's one thing I'm sure about: Good recruiting can only come from good dialogue with candidates. At KTC, there are 5 recruiters including myself. Each of us is assigned as a dedicated recruiter for specific divisions. That's why we are able to communicate super closely with the division members on the team, sharing information about products and cultures in each division, as well as happy things and tough things in their work—we think through everything together. That's how I feel we're building recruiting as a team. I think this is truly something to be proud of. Finally, to All Reading This Article To all engineers:   I respect you. I mean that seriously.   The way you change the future with technology has always looked like magic to me 🪄 To everyone involved in product development:   I understand your dedication to seriously engaging in product development through constant communication and trials and errors to create a single value.   Those real stories always struck me so deeply. To my teammates in the Human Resources Group:   Thank you for always worrying alongside me while I'm running around all over the place!!   Let's keep running together!! (/・ω・)/ To everyone at KTC:   Thank you for always helping me!!   I'll contribute to making my beloved company even stronger with all my efforts as an employee working at the recruitment frontline!!! To everyone who read this article:   If anything resonated with you even a little,   I'd love to meet you somewhere—at an event, a casual interview, or anywhere else!! To Future Teammates We at KINTO Technologies are taking initiatives in building an organization focusing on internal product development from scratch, right in the middle of the transforming automotive industry. Opportunities to be part of such dynamism don't come so often. We're waiting for teammates who will create the future together🙌 That's all for a day in the life of a recruiter and PR person! Thank you so much for reading!
アバター
この記事は KINTOテクノロジーズアドベントカレンダー2025 の13日目の記事です🎅🎄 はじめに はじめまして!の方も、いつもありがとうございますの方もこんにちは!! KINTOテクノロジーズ(以下、KTC)でエンジニア採用と採用広報を担当している たけの ひかる( @t_hikarutaaaan )です。 毎年恒例のアドベントカレンダー企画、 今年も呼吸をするようにエントリーしてみました!(笑) 今回は、 「エンジニア採用と採用広報の舞台裏」 をテーマに、 私の “とある1日” をゆるっと紹介してみようと思います。 すこしだけ自己紹介 入社して約4年、採用担当になって約2年。 当時は 人事も採用も完全にゼロ経験からのスタート。 技術の話は半分も理解できず、 スカウト1通送るだけであたふたして、 面談ではガチガチに緊張してスクリプトを棒読み。(今では完全にネタw) でも、止まらずに挑戦し続けたからこそ今言えます。 「採用という仕事が、本当に好きです。」 そしてKTCは、 “やってみたい” と手を挙げた人に本気で任せてくれる会社。 未経験の私が走り続けられたのは、そのカルチャーのおかげです。 やっと笑ってイベント司会ができるようになりました エンジニアって、魔法使いじゃん 実は、採用担当になって少し経ったころ、生成AIにコードを書いてもらいながら 採用データを分析できる小さなアプリをつくったことがあります。(アプリって言っていいレベルではないですがw) ワンクリックで画面にグラフが表示された瞬間、思わず声が出ました。 「え、すご…魔法じゃん。」 技術が人の困りごとを一瞬で解決してしまう瞬間にシンプルに感動しました。 で、そのとき思ったんですよね。 「あ、もっとちゃんと向き合わなきゃ」って。 現場の人たちがどんな想いでプロダクトつくってるのか、 「もっとちゃんと知りたいし、もっともーっとちゃんと伝えたい」と。 そこから更に毎日あたふたしながら走り回ってます。(笑) というわけでここからは、 そんな私の 「とある1日」 をゆる〜く紹介してみます! 時間 内容 実際にやったこと こんな気持ちでやってます(例) 09:00 スカウトtime ターゲット選定、プロフィール読み込み、スカウト文作成&送付 どの媒体にしようかな。良い人発見。「なぜ声をかけたいのか」を必ず書く 10:00 書類選考 職務経歴確認、現場メンバーと評価すり合わせ むむ…めちゃくちゃ良い人…! 11:00 現場MTG 採用状況共有、採用要件摺り合わせ、PJ状況ヒアリング 分からないことは素直に聞く。優しく答えてくれる文化に感謝 🙏 12:00 ランチtime 卵かけごはんをすする かつお節が合う。おなかいっぱい。 13:00 カジュアル面談 キャリアヒアリング、プロダクト紹介 双方コミュニケーションできた時が最高。時間足りない日も多い。 15:30 採用広報企画 採用トレンド調査、競合リサーチ、企画案作成、資料構成 煮詰まった…。壁打ち相手求む。 17:00 カジュアル面談 キャリアヒアリング、プロダクト紹介 技術質問に少し答えられず…あとで現場に確認。 19:00 イベント運営 受付、撮影、アナウンス、来場者サポート 基本、走り回ってます(笑)。写真撮って声かけて…ハイハイ! コスパ&タイパ最高の卵かけごはん 採用の難しさと向き合う日々 採用は、スペックだけでは測れない世界です。 会話の空気 ちょっとした表情の変化 選択の背景にある価値観 そういった“見えないもの”を丁寧に受け止める必要があります。 ある候補者の言葉が忘れられません。 「転職の決め手は、“誰と働くか”なんです」 その一言で、ハッとしました。 私はずっと会社としての魅力を伝えることに精一杯でした。 でも候補者の方が本当に知りたいのは、 「このチームなら、自分の挑戦を託せるか」 それからは、 現場の空気やカルチャー、そこで生じる悩みや挑戦も含めた本音を届けることを大切にしています。 面談の最後に 「一緒に働く姿が想像できました」 と言ってもらえた日は、心の中で小さくガッツポーズしています。(笑) 採用広報で挑戦したこと 今年、採用広報として 国内最大級のモビリティイベントである Japan Mobility Show 2025 の登壇企画を担当しました。 KTCが所属するTOYOTAグループ内の関係者や、 リアル領域とIT領域それぞれの担当者を巻き込みながら進めるプロジェクトで、 調整量も難易度も、正直これまでで一番大変でした。(笑) でも、どうしても実現したかった理由があります。 私たちの強みである「リアル × IT」での挑戦を、ちゃんと外に届けたかった。 そして、「一緒にやろう」と快諾してくれた部長の熱量を発信したかった。 求人票だけでは伝わらない空気や想いを、 生の言葉で届けたかったんです。 本番のあと、応援してくれていた社内メンバーから 「めちゃくちゃよかったよ!」 と声をかけてもらえて、すごく嬉しかったです。 さらに後日、登壇企画の動画が公開されたあと、 日々いろいろな業務で関わるグループ企業の方々にも 「YouTube見たよ!」「いい内容だった」「かっこよかった」 と声をかけてもらえたと。 さらに、登壇してくれた部長はこんな言葉をくれました。 「採用に効いてくるのはもう少し先かもしれないけど、 社内広報とか、KTCのセルフブランディングには効いてくるね」 めちゃめちゃ嬉しかったぁ。なんだろ。うまく言葉にできないけど(笑) 採用広報は、会社の挑戦と未来の仲間をつなぐ仕事。 私はその“橋渡し役”でありたいと思っています。 会場の写真を一生懸命撮ってます ちなみに以下がこの記事で触れた登壇企画のアーカイブ動画です! あつーーく、ギュギュっと詰まった50分なので是非ご視聴ください♪ https://youtu.be/NXM2lyapia0?si=QiK5GP2XFtCh0c9c 採用はチーム戦であり、未来づくり 採用に、これが正解!っていう形はありません。 毎回迷うし、悩むし、揺れ続けます。 (正直、答えが分からなすぎてソワソワする日もある。笑) でも、ひとつだけ確信していることがあります。 いい採用は、いい“対話”からしか生まれない。 KTCには、私を含めて5名の採用担当がいます。それぞれが部門に専任としてつく部門担当制。 だからこそ、現場とめちゃくちゃ密にコミュニケーションができるんです。 プロダクトの話も、カルチャーの話も、 嬉しいことも、しんどいことも、ぜんぶ一緒に考える。 そうやって、チームで採用をつくっている感覚がある。 これは本当に誇れるポイントだと思っています。 最後に、読者のみなさまへ エンジニアのみなさまへ   尊敬しています。本気で。   技術で未来を変えていく姿は、私にとってずっと魔法のように見えています🪄 プロダクト開発に関わるみなさまへ   本気でプロダクトと向き合う姿勢や、ひとつの価値をつくるためのコミュニケーションや試行錯誤。   そのリアルなストーリーに、私はいつも心を動かされています。 人事グループの仲間へ   いつもわちゃわちゃしている私と一緒に悩んでくれて感謝です!!   これからも一緒に走ってね!!(/・ω・)/ KTCのみなさまへ   いつも助けてくれてありがとうございます!!   私の大好きな会社がもっと強くなるために、まずは採用という場所から全力で貢献します!!! この記事を読んでくださったみなさまへ   もし少しでも何か響くものがあったら、   ぜひイベントで、カジュアル面談で、、、、どこかでお会いできたら嬉しいです!! 未来の仲間へ 私たちKINTOテクノロジーズは変革期の自動車産業のど真ん中で、 内製開発組織をゼロからつくる挑戦をしています。 こんなダイナミズムに関われるチャンスは、そう多くありません。 未来を一緒に創る仲間をお待ちしています🙌 以上、採用担当・広報担当の“とある1日”でした! 読んでくださり、本当にありがとうございました~~~!
アバター
はじめに この記事は KINTOテクノロジーズ Advent Calendar 2025 の12日目の記事です🎅🎄 こんにちは。クラウドインフラ所属の松尾です。 AWS re:Inventで発表された新機能ではないですが、 個人的に熱いと感じたアップデートがあったので紹介します。 Service Quotasの自動管理機能です。 2025年10月に「自動管理設定」機能がGAとなり、 Service Quotasの上限値が近づくと通知が飛ぶようになりました。 そして先日、GAのタイミングで予告されていた「自動調整」モードが追加。 これまでクォータ監視を実装しようとすると、複雑な構成を自前で用意する必要がありましたが、 この機能を使えばコンソールからポチポチするだけでクォータの監視から自動調整までやってくれます。 しかも無料です。 ただ、先に言っておくと自動調整について、「全部のクォータに対応しているわけではない」という制約があります。 この記事では、実際に検証してわかった仕様や制約を書いていきます! アップデートの経緯 日付 内容 2025年10月 自動管理機能の追加。追加時は「通知のみ」モードがGA。自動調整モードの予告あり 2025年11月 「通知と自動調整」モードが追加 公式アナウンス: AWS Service Quotas の自動クォータ管理の一般提供を開始 - AWS AWS Service Quotas now supports automatic quota adjustment 何が嬉しいのか Before(従来の方法) クォータ監視を実装するには、こんな構成が必要でした: https://aws.amazon.com/solutions/implementations/quota-monitor/ 出典: AWS Solutions Library CloudWatch Alarmsでメトリクスを監視 Lambda関数でService Quotas APIを叩いて上限緩和リクエストを送信 EventBridgeでトリガー設定 SNSで通知 Amazon DynamoDB 監視対象のクォータの管理 これだとかなり複雑な構成になるので構築、運用が大変でした。 After(自動管理機能) コンソールで数クリックで設定完了 80%/95%で自動通知 「自動調整」モードなら自動で上限緩和リクエストまで送ってくれる 今までクォータ監視で必要だったリソースの料金の発生はなし 従来までの方法と比べ、複雑な設定は無し。かなり導入がしやすそうです。 Before After 設定の手間 Lambda/EventBridge/SNS/DynamoDB等の構築が必要 コンソールで数クリック 通知タイミング 自分で閾値を設定 80%/95%で自動通知(固定) クォータ調整 Lambda等で自前実装 自動調整モードで対応 料金 各リソースの料金が発生 無料 機能の仕様 通知タイミング 公式ドキュメント によると、以下のタイミングで通知が送信されます: 80% 使用率に達した時 95% 使用率に達した時 重要:この閾値は固定です。 コンソールで設定するとき「あれ、閾値設定するところないな?」って思ったんですが、そもそも変更できない仕様でした。 「70%で通知が欲しい」みたいなカスタマイズはできないので、その場合は従来通りCloudWatch Alarmsを使う必要があります。 自動管理モード モード 説明 通知のみ(NotifyOnly) 80% / 95%で通知を送信 通知と自動調整(NotifyAndAdjust) 通知に加えて、自動でクォータ増加リクエストを送信 通知先 AWS User Notificationsと統合されていて、以下の通知先を設定できます: Eメール(SES経由、サポートされていないリージョンからのイベントはバージニア経由で送信) AWS コンソールモバイルアプリケーション(事前にアプリのインストールとプッシュ通知の有効化が必要) チャットチャネル(Amazon Q Developer経由でSlack/Teamsに配信、事前にチャットクライアントの設定が必要) 料金 無料で使用できます。 自動管理機能自体には追加料金はかかりません。 通知に使われるAWS User Notificationsも無料ですが、 裏で呼び出しているSES・モバイルプッシュ・Amazon Q Developerの使用や、 自動管理機能とは別にCloudWatch Alarmsで独自の監視を設定する場合は、別途料金がかかる場合があります。 設定方法 📝 補足 : 2025年11月時点では本機能は現在Terraformでは対応しておりません コンソールでの設定 Service Quotasコンソールを開く 左メニューから「自動管理」を選択 「自動管理を開始」をクリック 自動管理モードを選択(「通知のみ」または「通知と自動調整」) 通知設定を構成(オプション) 例外設定を構成(オプション) 確認して送信 めちゃくちゃ簡単。 CLIでの設定 以下はus-west-2(オレゴン)リージョンでの設定例です。 # User Notificationsの通知先と自動調整を指定する場合 aws service-quotas start-auto-management \ --opt-in-level ACCOUNT \ --opt-in-type NotifyAndAdjust \ --notification-arn arn:aws:notifications::xxxxxxxxxxxx:configuration/xxxxx \ --region us-west-2 公式ドキュメント ⚠️ 注意 : リージョンごとに設定が必要です。オレゴンリージョンで設定しても、東京リージョンには適用されません。 CLIで全リージョン設定する場合はスクリプトを組むなどの対応が必要です。 内部の仕組み(イベントパターン) 自動管理を設定すると、内部的にはAWS User Notificationsの詳細フィルターとして以下のようなイベントパターンが設定されます: { "source": ["aws.health"], "detail-type": ["AWS Health Event"], "detail": { "service": ["SERVICEQUOTAS"], "eventTypeCode": [ "AWS_SERVICEQUOTAS_THRESHOLD_BREACH", "AWS_SERVICEQUOTAS_INCREASE_REQUEST_FAILED", "AWS_SERVICEQUOTAS_APPROACHING_THRESHOLD" ], "eventTypeCategory": ["accountNotification"] } } 各イベントタイプの意味( 公式ドキュメント ): eventTypeCode 意味 AWS_SERVICEQUOTAS_APPROACHING_THRESHOLD 調整可能な クォータが閾値に近づいた。自動調整モードならここでクォータの引き上げリクエストが送信される AWS_SERVICEQUOTAS_THRESHOLD_BREACH 調整できない クォータが閾値を超過。クォータの引き上げできないので使用率を最適化する必要あり AWS_SERVICEQUOTAS_INCREASE_REQUEST_FAILED クォータの引き上げリクエストが失敗した 実際に検証してみた 検証環境 リージョン:us-west-2(オレゴン) 自動管理モード:通知と自動調整 必要な権限 自動管理機能を使用するために必要な権限、および閲覧権限は以下の通りです。 使用するために必要な権限 ServiceQuotasFullAccess AWSHealthFullAccess 閲覧するために必要な権限 AWSHealthFullAccess 対応クォータの確認 コンソールの「サポートされているクォータを表示」から確認してみたんですが、リリース直後だからか思ったより対応範囲が限定的でした。 今後、対応するリソースが増えることを期待したいです。 対応していたサービスの例: AWS Systems Manager Amazon EC2 WAF(Regionalのみ) ELB Lambda Route53 IAM 対応していなかったサービスの例: VPC API Gateway EventBridge Amazon Simple Email Service(SES) Route53やIAMなどのグローバルサービスの場合、通知のみできるようで自動調整には対応していない印象でした 自動調整の動作確認 AWS WAFの「Maximum regex pattern sets per account in WAF for regional」で検証してみました。 このクォータはデフォルト値が10なので、8個作成すれば80%に到達します。 検証手順 1. 事前準備 まずはService Quotasで自動管理の設定を行います。 Service Quotasの自動管理を「通知と自動調整」モードで有効化 (オレゴンリージョンで設定した際、キャプチャしてなかったのでバージニアリージョンでの設定画面になりますmm) 通知設定に移ります。ここではAWS User Notificationsの設定を行います。 今回はAmazon Q Developerを用意し、Slackチャンネルに通知するようにしました。 ⚠️ 注意 : イベントソースのリージョンを選択できますが、自動管理を有効にしているリージョンのイベントしか受け取れないため、 監視したいリージョンごとに自動管理の設定が必要です(自動管理とAWS User Notificationsは別設定だからちょっとややこしい) 自動管理の例外とするサービスを選択できますが、今回は何も設定しないまま作成 2. 正規表現パターンセットを作成 次に正規表現パターンセットを作成し、閾値に引っかかるようにします。 WAFコンソール → 正規表現パターンセット → 「Create regex pattern set」 リージョン:us-west-2(オレゴン)※Regionalを選択 適当な名前で8個作成 3. 使用率の確認 Service Quotas → AWS WAF → 「Maximum regex pattern sets per account in WAF for regional」 使用率が80%になっていることを確認しました 4. 通知/自動調整の発動を待つ 数分待機... 検証結果 通知/自動調整反映までの時間:正確には確認できていませんが、数分程度で完了 クォータ値:10→11に。自動調整後のクォータ値の指定はできませんが、80%を切るようなクォータに更新してくれそう? 通知に関して、Slack通知は見づらい 改行コード( \n )がそのまま表示されてしまい、長文が一塊になっています。 また、通知本文には「どのクォータが閾値に近づいたか」の具体的な情報が含まれておらず、 通知文に添付のリンクからAWS Health Dashboardの「Affected resources」タブを確認する必要があります。 通知としては「何か閾値に近づいた」ことはわかるが、詳細確認には一手間かかる印象です。 注意点・制約 1. 対応クォータが限定的 正直、今のところこれが一番大きな制約だなと感じました。 VPCやSESといった基本的なサービスのクォータが対応していないのは残念です。 現時点ではService Quotaの自動管理だけでは「クォータ周りの調整がすべて解決」とはならない。 対応クォータの拡大を今後待つしかないです。 2. 閾値のカスタマイズ不可 80%/95%の閾値は固定。「50%で早めに通知が欲しい」「100%になるまでは通知不要」みたいな要件には対応できません。 3. AWS Organizations対応は未実装 2025年11月時点では、Organizations単位での一括設定には対応していないため、 各アカウントで個別に設定する必要があります。 CLIコマンドには --opt-in-level というオプションがCLIであるのでいつか対応されることを期待したいです。 4. 自動調整の承認は保証されない 自動調整はあくまで「上限緩和リクエストを自動送信する」機能です。 リクエストがAWSに承認されるかどうかは別の話で、拒否される可能性もあります。 5. 通知・自動緩和までに時間がかかる場合がある クォータが11に上がった直後、正規表現パターンを3つ追加して合計11個にして使用率を100%にしてみました。 が、今度は通知もされず、自動調整もありませんでした。 しかし数時間後、自動調整されていることが確認できたことから、 場合によっては通知や自動調整までに時間がかかることがあるようです。 まとめ Service Quotasの自動管理機能は、クォータ監視のハードルを大きく下げてくれる個人的にはかなり良いアップデートです。 無料で始められて、コンソールから数クリックで設定できます。 対応クォータがまだ限定的だったり、IaC(Terraform)未対応だったりとまだまだ制約はありますが、 サポートされているクォータに関しては実際にクォータ拡張作業の工数を削減できることがわかりました。 弊社では独自実装のクォータ管理ツールも運用しており、 自動管理機能でサポートされていないクォータについては引き続きそちらで対応していく予定です。 以上、この記事が誰かの参考になれば幸いです。
アバター
Introduction This article is Day 12 of the KINTO Technologies Advent Calendar 2025 . Hello. I'm Matsuo from the Cloud Infrastructure Group. While this wasn't announced at AWS re:Invent, there was an update that I personally found exciting, so I'd like to share it. It's the automatic management feature for Service Quotas. In October 2025, the automatic management settings feature became generally available, enabling notifications when Service Quotas limits are approaching. Then recently, the automatic adjustment mode that was announced at GA was added. Previously, implementing quota monitoring required building a complex architecture yourself, but with this feature, you can set up quota monitoring and automatic adjustment just by clicking through the console. And it's free. However, I should mention upfront that automatic adjustment doesn't support all quotas. In this article, I'll share the specifications and constraints I discovered through actual testing! Update Timeline Date Content October 2025 Automatic management feature added. At launch, only Notify Only mode was GA. Automatic adjustment mode was announced November 2025 Notify and Adjust mode was added Official announcements: AWS Service Quotas の自動クォータ管理の一般提供を開始 - AWS AWS Service Quotas now supports automatic quota adjustment What Makes This Great Before (Traditional Method) To implement quota monitoring, you needed an architecture like this: https://aws.amazon.com/solutions/implementations/quota-monitor/ Source: AWS Solutions Library Monitor metrics with CloudWatch Alarms Lambda functions to call Service Quotas API and send quota increase requests EventBridge trigger configuration SNS for notifications Amazon DynamoDB for managing monitored quotas This resulted in quite a complex architecture that was difficult to build and maintain. After (Automatic Management Feature) Setup complete with just a few clicks in the console Automatic notifications at 80%/95% Automatic Adjustment mode automatically sends quota increase requests No charges for resources that were previously needed for quota monitoring Compared to the previous method, there's no complex configuration. It seems much easier to adopt. Before After Setup effort Required building Lambda/EventBridge/SNS/DynamoDB etc. Just a few clicks in the console Notification timing Set thresholds yourself Automatic notifications at 80%/95% (fixed) Quota adjustment Self-implemented with Lambda etc. Handled by automatic adjustment mode Cost Charges for each resource Free Feature Specifications Notification Timing According to the official documentation , notifications are sent at the following thresholds: When 80% utilization is reached When 95% utilization is reached Important: These thresholds are fixed. When configuring in the console, I thought "Hmm, where do I set the threshold?" but it turns out it's not configurable by design. Customizations like "I want notifications at 70%" aren't possible, so you'd still need to use CloudWatch Alarms for that. Automatic Management Modes Mode Description Notify Only (NotifyOnly) Sends notifications at 80% / 95% Notify and Adjust (NotifyAndAdjust) In addition to notifications, automatically sends quota increase requests Notification Destinations It's integrated with AWS User Notifications, and you can configure the following notification destinations: Email (via SES; events from unsupported regions are sent via Virginia) AWS Console Mobile Application (requires prior app installation and push notification enablement) Chat channels (delivered to Slack/Teams via Amazon Q Developer; requires prior chat client configuration) Pricing It's free to use. There are no additional charges for the automatic management feature itself. AWS User Notifications used for notifications is also free, but if you use SES, mobile push, or Amazon Q Developer behind the scenes, or if you set up custom monitoring with CloudWatch Alarms separately from the automatic management feature, additional charges may apply. Configuration Method Note : As of November 2025, this feature is not yet supported in Terraform Console Configuration Open the Service Quotas console Select Automatic management from the left menu Click Start automatic management Select the automatic management mode (Notify Only or Notify and Adjust) Configure notification settings (optional) Configure exception settings (optional) Review and submit Super easy. CLI Configuration Here's an example configuration for the us-west-2 (Oregon) region. # When specifying User Notifications destination and automatic adjustment aws service-quotas start-auto-management \ --opt-in-level ACCOUNT \ --opt-in-type NotifyAndAdjust \ --notification-arn arn:aws:notifications::xxxxxxxxxxxx:configuration/xxxxx \ --region us-west-2 Official documentation Note : Configuration is required for each region. Setting it in the Oregon region doesn't apply to the Tokyo region. If you want to configure all regions via CLI, you'll need to write a script or similar. Internal Mechanism (Event Pattern) When you configure automatic management, internally an event pattern like the following is set as a detailed filter in AWS User Notifications: { "source": ["aws.health"], "detail-type": ["AWS Health Event"], "detail": { "service": ["SERVICEQUOTAS"], "eventTypeCode": [ "AWS_SERVICEQUOTAS_THRESHOLD_BREACH", "AWS_SERVICEQUOTAS_INCREASE_REQUEST_FAILED", "AWS_SERVICEQUOTAS_APPROACHING_THRESHOLD" ], "eventTypeCategory": ["accountNotification"] } } Meaning of each event type ( official documentation ): eventTypeCode Meaning AWS_SERVICEQUOTAS_APPROACHING_THRESHOLD An adjustable quota is approaching the threshold. In automatic adjustment mode, a quota increase request is sent here AWS_SERVICEQUOTAS_THRESHOLD_BREACH A non-adjustable quota has exceeded the threshold. Since the quota cannot be increased, you need to optimize usage AWS_SERVICEQUOTAS_INCREASE_REQUEST_FAILED The quota increase request failed Actual Testing Test Environment Region: us-west-2 (Oregon) Automatic management mode: Notify and Adjust Required Permissions The permissions required to use the automatic management feature and view permissions are as follows. Permissions required to use: ServiceQuotasFullAccess AWSHealthFullAccess Permissions required to view: AWSHealthFullAccess Checking Supported Quotas I checked from View supported quotas in the console, but perhaps because it was just after release, the coverage was more limited than I expected. I hope the supported resources will expand in the future. Examples of supported services: AWS Systems Manager Amazon EC2 WAF (Regional only) ELB Lambda Route53 IAM Examples of unsupported services: VPC API Gateway EventBridge Amazon Simple Email Service (SES) For global services like Route53 and IAM, it seems only notifications are available and automatic adjustment is not supported Verifying Automatic Adjustment Behavior I tested with AWS WAF's Maximum regex pattern sets per account in WAF for regional. This quota has a default value of 10, so creating 8 would reach 80%. Test Procedure 1. Preparation First, configure automatic management in Service Quotas. Enable automatic management in Service Quotas with Notify and Adjust mode (I didn't capture the screen when setting up in the Oregon region, so this is the settings screen from the Virginia region) Move to notification settings. Here you configure AWS User Notifications. This time, I set up Amazon Q Developer to send notifications to a Slack channel. Note : You can select the event source region, but since you can only receive events from regions where automatic management is enabled, you need to configure automatic management for each region you want to monitor (it's a bit confusing because automatic management and AWS User Notifications are separate settings) You can select services to exclude from automatic management, but this time I created it without any settings 2. Create Regex Pattern Sets Next, create regex pattern sets to trigger the threshold. WAF console -> Regex pattern sets -> Create regex pattern set Region: us-west-2 (Oregon) *Select Regional Create 8 with arbitrary names 3. Check Utilization Service Quotas -> AWS WAF -> Maximum regex pattern sets per account in WAF for regional Confirmed that utilization was at 80% 4. Wait for Notification/Automatic Adjustment Wait a few minutes... Test Results Time until notification/automatic adjustment: Not confirmed precisely, but completed in a few minutes Quota value: Changed from 10 to 11. You can't specify the quota value after automatic adjustment, but it seems to update to a quota that falls below 80%. Slack notifications are hard to read Newline codes ( \n ) are displayed as-is, making long text appear as one block. Also, the notification body doesn't include specific information about which quota is approaching the threshold, so you need to check the Affected resources tab in the AWS Health Dashboard via the link attached to the notification. As a notification, you can tell something is approaching the threshold, but it takes extra effort to check the details. Notes and Constraints 1. Limited Supported Quotas Honestly, this is the biggest constraint I felt at the moment. It's disappointing that quotas for basic services like VPC and SES aren't supported. Currently, automatic management of Service Quotas alone won't handle all quota-related issues. We'll have to wait for the supported quotas to expand. 2. Thresholds Cannot Be Customized The 80%/95% thresholds are fixed. Requirements like "I want early notifications at 50%" or "No notifications needed until 100%" cannot be accommodated. 3. AWS Organizations Support Not Implemented As of November 2025, bulk configuration at the Organizations level is not supported, so you need to configure each account individually. There's an --opt-in-level option in the CLI command, so I hope it will be supported eventually. 4. Automatic Adjustment Approval Is Not Guaranteed Automatic adjustment is merely a feature that automatically sends quota increase requests. Whether the request is approved by AWS is a separate matter, and it may be rejected. 5. Notifications/Automatic Increases May Take Time Right after the quota was raised to 11, I added 3 more regex patterns for a total of 11, bringing utilization to 100%. However, this time there was no notification and no automatic adjustment. But several hours later, I confirmed that automatic adjustment had occurred, so it seems that notifications and automatic adjustments may take time in some cases. Conclusion The automatic management feature for Service Quotas is personally a really great update that significantly lowers the barrier to quota monitoring. It's free to start and can be configured with just a few clicks from the console. There are still constraints like limited supported quotas and no IaC (Terraform) support, but I found that for supported quotas, it can actually reduce the effort required for quota expansion work. At our company, we also operate a custom-built quota management tool, and we plan to continue using it for quotas that aren't supported by the automatic management feature. I hope you found this article helpful.
アバター
This article is the 12th entry in the KINTO Technologies Advent Calendar 2025 . Introduction I'm Uehara ( @penpen_77777 ), a backend engineer in the FACTORY E-commerce Development Group at KINTO Technologies. I participated in Techbook Fest 19 as part of the KINTO Technologies Writing Club, a circle (a small creator group) formed by volunteer engineers at KINTO Technologies. In this article, I'll share our journey of creating a technical book with company volunteers. Here's the introduction to the new book we created! It's free. If you're interested, please download the digital version. https://blog.kinto-technologies.com/posts/2025-10-31-techbookfest19-announcement/ https://techbookfest.org/product/qCPrJpWLmKnLt7eWVd9zJ6 The Beginning I had written technical books before and had been wanting to write one again after a long break. While tech blogs and presentations are sufficient for getting your writing read by others, there's something deeply satisfying about seeing your writing become a physical book. Since our company had never organized a circle of employee volunteers to write technical books, I decided to take on this challenge. Building the Team Finding Supportive People I started working on this in June, about six months before participating in Techbook Fest. Finding supportive people early on is extremely helpful when moving tasks forward. Our company has a Developer Relations Group that can provide consultation for employees' external technical communications. I truly believe we were able to accomplish this thanks to the Developer Relations Group. I'm very grateful. Finding People Interested in Writing Since participating in Techbook Fest was a first-time endeavor, I was worried about whether we could actually gather participants. Announcing a call for participants company-wide out of the blue felt like a high hurdle. So I decided to reach out to people who seemed interested and gather those who were highly likely to participate in advance. At our company, many people use times (personal update channels) on Slack, which is great for casually expressing your thoughts. By hinting at my desire to exhibit at Techbook Fest, I was able to know who might be interested. About five people gathered at this point, so I felt reassured that even if a company-wide announcement didn't attract more participants, we could still make the project work. Making the Announcement I created a simple slide to recruit writers company-wide. It summarized information about Techbook Fest and the benefits of writing, designed to encourage participation. The official sponsorship materials were helpful for introducing the scale of the event. https://techbookfest.org/assets/tbf18/for-sponsors.pdf Selecting a Printing Company Since we were creating a physical book, we needed to select a printing company. Techbook Fest has designated backup printing companies, and by submitting your manuscript to one of them, they handle everything from printing to delivering it to the venue. It’s a very convenient system. The backup printing companies are Nikko Kikaku and Neko no Shippo, and we chose Nikko Kikaku for this project. Selecting and Configuring the Typesetting System A typesetting system converts manuscripts into a print-ready format. Re:VIEW is commonly used as a typesetting system for technical books. By processing text files written in the proprietary Re:VIEW format through Re:VIEW, they are converted into formats commonly used for e-books such as EPUB and PDF. The benefit is that the separation of page style settings from content allows writers to focus on the essential task of writing without worrying about appearance. For this project, we used Vivliostyle^[It reads "kumihan," but I always mistakenly read it as "soban." https://ja.wikipedia.org/wiki/%E7%B5%84%E7%89%88] as our typesetting system. https://vivliostyle.org/ja/ Vivliostyle's distinguishing feature is the ability to change appearance using CSS, so anyone familiar with frontend technologies should be able to use it without difficulty. Since setting everything up from scratch would be challenging, we utilized a template distributed by YUMEMI. We're very grateful for the distribution of such a template. Thank you! https://github.com/yumemi-inc/daigirin-template Based on the above template, we made the following modifications: Updated the title, publisher, and colophon for our technical book Changed the paper size to B5^[This is when I learned that B5 comes in both JIS B5 and ISO B5. Be careful, as they have different dimensions despite both being called B5.] Enabled automatic table of contents output and adjusted the template for sections that weren't outputting correctly Registering Your Circle for Techbook Fest While there's a lot to prepare, don't forget to submit your circle participation application. It might be a good idea to add it to your calendar. Having Writers to Write I created and shared guidelines so writers wouldn't struggle with the writing process. Overall schedule and what to do in each phase Writing methods (Vivliostyle Flavored Markdown^[A notation that extends common markdown to express book-specific structures. https://vivliostyle.github.io/vfm/#/] syntax, PDF preview methods, etc.) Manuscript Management We managed manuscripts on GitHub, with each writer branching off from the main branch to write. Having each writer create a PR is convenient for tracking progress. Using Slack Lists To prevent topic overlap within the book, I asked writers to add their topics to a Slack list once decided. It's also helpful to include other information you want to track, such as self-introductions for the appendix and writing status. While we could have managed this with tables in Confluence, I personally check Slack more frequently, so I managed it using Slack lists, which can be used similarly to Notion databases. Getting the Book Cover Created When I was wondering whether to create the book cover myself, one of the participants suggested asking designers from the Creative Office for help. Since we wanted to create it in a fun, collaborative way, we decided to hold a Generative AI × Live Visual Creation event where designers would create the cover using generative AI. The event held to create this technical book: Vibe Painting Hour #01 Five designers joined the event and, while participants watched, used generative AI to create covers within a one-hour time limit. Despite my vague request to create a cover with a sense of mobility and futuristic feel, all five final cover proposals were of such high quality that choosing only one seemed like a waste! Through participant voting and my judgment, the cover for this technical book was selected. ![表紙](/assets/blog/authors/uehara/2025-10-24-techbookfest19-announcement/cover.webp =300x) The cover of our new book, TECH BOOK By KINTO Technologies Vol.01. Setting Manuscript Deadlines This is important. The submission deadline is absolute, so you should set it with plenty of buffer time. Also, it's best to assume that manuscripts won't be ready on the first try. You should set not just one deadline but two or three backup deadlines, with minimum requirements for each deadline. Having Writers Review Each Other's Work We had writers review each other's work. The review items followed our external communication review guidelines, while also keeping in mind that the final product would be a physical book. Since you can't even start reviewing without all manuscripts being submitted, I recommend setting the second deadline early. Proofreading After compiling all manuscripts, we adjusted the overall page layout. After noticing the font size was too small, I made it slightly larger. The table of contents had grown to 10 pages, so I narrowed down the items to include. We also had to adjust the page count to be a multiple of four, or the submission wouldn't be accepted. This caused display issues in some chapters, so we asked writers to make corrections. Since we were working under time pressure, we decided to set the third deadline early. Submission Once the PDF file for submission was ready, we submitted it to the printing company. With Nikko Kikaku, we paid in advance and then sent the cover and body data via a form. If there were any data issues, they would point them out and we'd need to resubmit. This time there were no issues and submission went smoothly. Booth Setup Simulation With help from a Developer Relations team member who was experienced with booth setup, we carried out a simulation the day before. By visualizing the booth in advance and identifying what we needed, I think we avoided the situation where we'd look at the actual booth on the day and feel like "hmm, this isn't quite what I imagined..." The Day of the Offline Event When I first saw the finished book at the offline venue, I thought it was thicker than expected. Since we distributed this thick book for free, we heard surprised reactions from attendees. We printed about 300 copies and distributed them all, so I think it was a great result for our first participation! https://x.com/KintoTech_Dev/status/1989983294059168095 Depositing at the National Diet Library The day after Techbook Fest, we deposited the book at the National Diet Library. Apparently, publications issued for distribution within Japan are generally subject to legal deposit, and even technical doujinshi like ours can be deposited. https://www.ndl.go.jp/jp/collect/deposit/deposit.html Publications issued for distribution within Japan are, in principle, all subject to legal deposit (see "Overview of the Legal Deposit System"). When you deposit publications with the National Diet Library, their bibliographic data becomes searchable as the "National Bibliography" through the NDL Search. Additionally, they are widely used as library materials, preserved as cultural assets shared by the nation, and passed down to future generations as records of the Japanese people's intellectual activities. I also referenced the following article for the deposit process. https://qiita.com/mitsuharu_e/items/850ae6688a94ea3d67f3 : Off to Deposit Being a central government location, various train lines converge here, including the Ginza, Marunouchi, and Hanzomon lines. Exit 2 is the closest to the National Diet Library, so depending on your line, you may need to walk a bit. Area directory near the station. Exit 2 is the closest. I took the Ginza Line, so I had to walk quite a bit. National Diet Library sign. There's a notice that those depositing materials should go to the service entrance (west gate). Enter through the National Diet Library's service entrance (west gate) and tell the security guard at the building entrance that you want to deposit books, and they'll handle the procedure. National Diet Library service entrance (west gate) At the deposit counter, hand over the book and fill out the paperwork. Once the procedure is complete, they'll give you a receipt. Material receipt After depositing, the book appears in National Diet Library Search results and becomes available to read as a resource at the National Diet Library. https://ndlsearch.ndl.go.jp/books/R100000002-I034410569 Reflections After Completion Don't Try to Do Everything Alone; Reach Out for Help Even creating just one book involves many decisions and tasks, and handling everything alone is quite difficult. It's better to delegate tasks that others can do, or that others can do better than you. The Technical Book Expanded Our Connections As well as interacting with attendees at the Techbook Fest offline venue, I believe the connections among company volunteers deepened through creating the technical book. Set Multiple Early Deadlines Even though I thought I had set deadlines with plenty of buffer, I still ended up feeling short on time. Next time, I plan to build in an even larger margin. Setting multiple deadlines is important. Summary While there were many challenges on the road to participating in Techbook Fest 19, looking back, we gained a lot and it was truly enjoyable. If this article has piqued your interest, please try taking on the challenge of creating a technical book. We'll keep working hard so that we can show up even stronger at future Techbook Fests! https://techbookfest.org/product/qCPrJpWLmKnLt7eWVd9zJ6
アバター
この記事は KINTOテクノロジーズ Advent Calendar 2025 の12日目の記事です🎅🎄 はじめに KINTOテクノロジーズのFACTORY EC開発グループでバックエンドエンジニアをやっている、うえはら( @penpen_77777 )です。 技術書典19に、KINTOテクノロジーズの有志エンジニアによるサークル「KINTOテクノロジーズ執筆部」として参加してきました。 この記事では社内有志で技術書を作り上げるまでの道のりをご紹介します。 ちなみに今回作った新刊の紹介はこちらになります!無料なのでもしご興味があれば電子版のダウンロードよろしくお願いします。 https://blog.kinto-technologies.com/posts/2025-10-31-techbookfest19-announcement/ https://techbookfest.org/product/qCPrJpWLmKnLt7eWVd9zJ6 始まり 私はこれまでに技術本の執筆をしたことがあり、久々に技術本を書きたいなという思いがありました。 文章を他人に読んでもらうだけなら技術ブログや登壇でも十分なのですが、やっぱり自分の書いた文章が本になるのは感慨深いものがあります。 弊社では社員有志でサークルを組んで技術書を書くということがなかったため、今回チャレンジしてみることにしました。 仲間を作る サポートしてくれそうな人を見つける 技術書典へ参加する約半年前の6月くらいから動き出し始めました。 早めにサポートしてくれそうな人を見つけておくとタスクを進めておく上で非常に心強いです。 弊社には技術広報グループがあり社員の技術的な外部発信の相談に乗ってもらえます。 やり遂げることができたのも技術広報のおかげだなと思っています。本当に感謝しています。 執筆に興味がありそうな人を見つける 技術書典への参加は初めての試みということもあって、本当に参加者が集まるのかが不安なところでした。 いきなり全社に参加者募集の告知をして、参加者を集めるのはハードルが高いと感じていました。 そこで興味がありそうな人に声をかけてあらかじめ参加する確度の高い人を集めることにしました。 弊社ではSlack上でtimes(分報チャンネル)を活用する人も多く、気軽に自分の気持ちを表明できるのが良いところです。 技術書典への出展したい気持ちを匂わせることで、興味がありそうな人が誰か知ることにしました。 ここで5人くらい集まったので、最悪全社告知して集まらなくても企画ができそうだなと思い、安心して進めることができました。 告知する 全社で執筆者を募集できるよう簡単なスライドを作りました。 技術書典について、執筆に対するメリット等をまとめていて参加を訴求する内容となってます。 イベントの規模を紹介するのに公式から出ている協賛資料が参考になりました。 https://techbookfest.org/assets/tbf18/for-sponsors.pdf 印刷所の選定をする 物理本を作るため印刷所の選定が必要になります。 技術書典ではバックアップ印刷所が設定されており、このバックアップ印刷所に入稿することで印刷から会場への納品までやっていただける非常に便利な仕組みとなっています。 バックアップ印刷所には日光企画・ねこのしっぽがあるのですが、今回は日光企画さんを選択しました。 組版システムを選定する・設定を整える 組版システムとは印刷向けの見た目に変換するものを言います。 技術書向けの組版システムとしてはRe:VIEWがよく使用されます。 独自の「Re:VIEWフォーマット」で記述されたテキストファイルをRe:VIEWに通すことによって、電子書籍としてよく用いられるEPUB、PDFなどに変換されます。 紙面上のスタイルの設定と内容が分離していることで、執筆者が見た目を意識せずどんな内容の文章を書くかという本質的な営みに集中できるのがメリットです。 今回は組版システム^[読み方は「くみはん」らしいです。毎回そばんと読んでしまいます。 https://ja.wikipedia.org/wiki/%E7%B5%84%E7%89%88]として「Vivliostyle」を使用しました。 https://vivliostyle.org/ja/ VivliostyleはCSSを使って見た目を変えられるのが特徴で、フロントエンド技術に詳しい方であれば難なく使いこなせるかと思います。 ゼロから設定を整えるのは大変なので、今回はゆめみさんが配布されているテンプレートを活用させていただきました。 このようなテンプレートを配布いただき大変感謝しております。ありがとうございました! https://github.com/yumemi-inc/daigirin-template 上記のテンプレートを元に以下の修正を入れました タイトル・発行者・奥付けを今回の技術書向けの内容に修正 紙面サイズをB5へ変更^[ここでB5にはJIS B5とISO B5があることを知りました。同じB5でもサイズが異なるのでご注意を。] 目次の自動出力を有効化、うまく出力できていない箇所はテンプレートを調整 技術書典へサークル登録する 色々準備がある中で忘れそうにはなりますが、サークル参加申込は忘れずに行いましょう。 カレンダーに予定を入れたりする方が良いかもですね。 執筆者に書いてもらう 執筆者が執筆に困らないようガイドラインを作成し、共有しました。 全体的なスケジュールとそれぞれのフェーズでやること 執筆方法(Vivliostyle Flavored Markdown^[一般的なmarkdownを書籍特有の構造も表現できるよう拡張した記法。 https://vivliostyle.github.io/vfm/#/]の記法 , PDFのプレビュー方法等) 原稿管理 原稿管理はGitHubで実施し、mainブランチからそれぞれ執筆者ごとにブランチを切ってもらい執筆作業を行ってもらいました。 執筆者ごとにPRを出しておくと進捗確認ができて便利です。 Slackリストを活用する 書籍内でテーマが被らないようテーマが決まったらSlackのリストにまとめてもらうようにお願いしました。 他にも巻末に入れる自己紹介文や執筆状況等、自分で把握しておきたい内容を入れておくと見通しが良いです。 Confluenceで表を使って管理しても良かったのですが、個人的にはSlackの方が見る頻度が高いのとNotionのデータベースっぽく使えるSlackリストで管理していました。 表紙を作成してもらう 技術書の表紙を自分で作るか悩んでいたところ、参加者の一人から「クリエイティブ室のデザイナーさんに協力をお願いしてみては?」と提案がありました。 せっかくなら人を集めてワイワイしながら作っていこうということで、デザイナーが生成AIを駆使して表紙を作成する「生成AI × ライブペインティング」イベントの開催が決まりました。 今回の技術書を作るのに開催されたイベント「Vibe Painting Hour #01」 イベントでは5人のデザイナーの方に来ていただき、参加者が見守る中、1時間という制限時間で生成AIを駆使して表紙を作っていただきました。 「モビリティ感があって未来感のある表紙を作る」という、うえはらからの中身がふわふわした依頼にもかかわらず、最終的に上がってきた表紙の5案はどれもクオリティが高く1つに決めるのが勿体無いくらいでした! 参加者の多数決とうえはらの判断によって、今回の技術書の表紙が選ばれました。 ![表紙](/assets/blog/authors/uehara/2025-10-24-techbookfest19-announcement/cover.webp =300x) 新書「TECH BOOK By KINTO Technologies Vol.01」の表紙。 原稿の締切を設ける こちらは重要です。入稿期限は絶対的な締切なので、それに合わせて余裕を持って設定した方が良いです。 また一発で原稿が揃うのはなかなかないと思った方が良いでしょう。 締切は1個だけではなくバックアップのためさらに2、3個設け、それぞれの締切で達成してほしい最低ラインを設定した方が良いでしょう。 執筆者間でレビューしてもらう 執筆者間でレビューしてもらいました。 レビュー項目は社外への外部発信時のレビュー項目に準じつつ、最終的には物理本にすることを意識して項目を設定しておくと良いでしょう。 原稿が出揃わないとレビューすらできないので、締切は早めに設定しておくことをお勧めします(2回目)。 校正 全員分の原稿を取りまとめた上で、全体の紙面の見栄えを調整していきました。 文字サイズが小さいことに気づいたため少し大きくしたり、目次だけで10ページと多くなってしまったので、目次に出す項目を絞ったりしました。 ページ数を4の倍数に調整しておかないと入稿を受け付けてくれないので、うまいことページ数の調整もしていきました。 この影響で表示が崩れてしまった章もあったので、執筆者に修正をお願いしていました。 時間がない中での作業だったので、締め切りは早めに設定しておきましょう(3回目)。 入稿 入稿用のPDFができたら印刷所に入稿していきます。 日光企画さんでは先に入金しておき、入稿用の表紙と本文データをフォームで送信すればOKでした。 ここでデータの不備があれば指摘があり再提出することになりますが、今回は特に不備もなく無事入稿できました。 ブース設営のシミュレーション ブースの設営に詳しい技術広報の方に協力してもらいながら、前日にシミュレーションを行いました。 事前にブースのイメージを膨らませておきつつ必要なものも洗い出せたので、当日ブースを見て何となく思ってたのと違う...みたいなことにはならなかったと思います。 オフライン会場当日の様子 オフライン会場で出来上がった本を初めてみた時、思ったより分厚いなと感じました。 この分厚い本を無料で頒布したので、参加者からは驚きの声も聞かれました。 約300部印刷したのですが全て頒布できたので、初回参加の結果としては上々なのではないかと思っています! https://x.com/KintoTech_Dev/status/1989983294059168095 国会図書館へ納入 技術書典の翌日、国会図書館へ納本しました。日本国内で頒布を目的として発行した出版物は原則納本の対象になるらしく、今回のような技術同人誌でも納本できるようです。 https://www.ndl.go.jp/jp/collect/deposit/deposit.html 日本国内で頒布を目的として発行された出版物は、原則として、すべて納本の対象となります(「納本制度の概要」参照)。 国立国会図書館に出版物を納本いただくと、その書誌データが「全国書誌」として国立国会図書館サーチで検索できるようになります。また、図書館資料として広く利用されるとともに、国民共有の文化的資産として永く保存され、日本国民の知的活動の記録として後世に継承されます。 納本には以下の記事も参考にさせていただきました。 https://qiita.com/mitsuharu_e/items/850ae6688a94ea3d67f3 いざ納本へ 国の中枢ということもあり、銀座線、丸の内線、半蔵門線といった様々な路線が乗り入れています。 2番出口が国会図書館の最寄りのため、路線によっては多少歩くことになりそうです。 駅周辺の案内。出口2が一番最寄りです。私は銀座線で向かったため、歩く量が多かった。 国立国会図書館の案内。納本の方は通用口(西口)へという案内がある。 国立国会図書館の通用口(西口)から入って、建物の入り口にいる警備員さんに納本したい旨伝えると手続きをしてくれます。 国立国会図書館の通用口(西口) 納本の窓口に着いたら、納本する書籍を渡して書類に記入します。手続きが終わったら受領書を渡してくれます。 資料受領書 納本すると以下のように国立国会図書館サーチの結果に表示されるようになり、また国会図書館で資料として読めるようになります。 https://ndlsearch.ndl.go.jp/books/R100000002-I034410569 終わってみて感じたこと 一人で抱え込まず、助けを借りよう 書籍一冊作るだけでも決めることややるべきタスクが多く、一人だけで全て捌き切るのはだいぶ大変です。 他の人でもできる、むしろ他の人の方がうまくやれるタスクはお願いしていった方が良いです。 技術本によって繋がりが増えた 技術書典のオフライン会場での参加者との交流はもちろん、技術本の制作を通して社内有志で繋がりが深まったと思っています。 締切は多重に早めに入れておく 余裕を持って締切を設定したつもりがやってみると意外と時間がないなという気持ちになったので、次はもう少し余裕を持たせていこうと思ってます。多重で締切を設定することは大事です。 まとめ 技術書典19への参加の道のりには大変なことも多かったですが、終わってみると得られるものも多く本当に楽しかったです。 もしこの記事を読んで興味が湧いた方はぜひ技術本制作にチャレンジしてみてください。 また今後の技術書典でパワーアップした姿を見せられるよう頑張っていきます。 https://techbookfest.org/product/qCPrJpWLmKnLt7eWVd9zJ6
アバター
こんにちは、Engineering Officeの守谷(emim)です。 この記事は KINTOテクノロジーズ Advent Calendar 2025 の11日目のものです。 2日目に、 アクセシビリティについての記事 を投稿しましたが、私の主領域はプロダクトデザインです。主軸では、 Engineering Office のメンバーとしてデザイナーの立場でKINTOテクノロジーズ(以下KTC)の状況をとらえ、組織力を上げるための取り組みを行っています。 KTCでは2025年の注力テーマとして、副社長の景山より、2つのテーマ「AIファースト」「リリースファースト」とともに、それを下支えする「ユーザーファースト」と「組織インテンシティ」が掲げられました。 https://blog.kinto-technologies.com/posts/2024-12-25-LookBack2024/ 私はこのうちデザイナーとして、「ユーザーファースト」推進活動に関わっています。私自身は6月入社ですが、このユーザーファーストについての活動は、今年のはじめから様々な方向での組織内の取り組みがおこなわれています。 今回は2025年の総括として、我々の実行した内容をまとめて行きます。 はじめに着手した社内調査から、社内での「ユーザー」の認知にブレがあることがわかった まず初めに行われたのが、ユーザーファースト推進において主軸となる「ユーザー」についての組織内での認知調査です。 ひと口に「ユーザー」と言っても、全員が同じ対象をイメージできているのか?という確認からです。ユーザーが一般的な用語だからゆえの解釈の違いを明確にした後に、具体の推進方法を検討するための調査です。 様々な部署、様々なロールのメンバーを全社から招集し、グループディスカッションを通し現状を把握しました。オンラインホワイトボードツールでの実施や、オンサイトでの付箋でのワークなど、開催形態は様々です。 調査が一通り終わったところで私が参画したこともあり、次に、ビジネスモデルと照らし各階層のユーザーからエンドユーザーまでと製品との関係性を、 Jeff Patton氏の提唱するThe onion model のような形での整理しました。 そこから見えてきたのは、我々の向かう製品とユーザーとの間にかなり距離があることでした。またその距離の遠さからか、事業の複雑さからか、ステークホルダー(チーム内で例えば上下関係のある別職域の人や、取り引きをしている関係会社/グループ会社の担当者、依頼主など)をユーザーと捉えている人も居そうなことがわかりました。 ![ビジネスモデルと照らし各階層のユーザーからエンドユーザーまでとシステムの関係性を表す図と、サービスとユーザーとの距離を表した図](/assets/blog/authors/emim/2025-12-11-userfirst2025/2025-12-11-userfirst2025_img02.png =600x) 「ユーザーのことが見えていない」という課題感からユーザーファーストというテーマが上がってきましたが、開発組織構造も関係していることがわかりました。開発者とユーザーに距離がある場合、どのようにステークホルダーを巻き込み意識付けを行い、ユーザーの要求事項を聞き出すのか、が次のステップになる、と考えました。 これらの情報は、この活動のオーナーである副社長にも共有し、齟齬なく活動を推進していけることの確認にも利用できました。 「UXの成熟度モデル」を参考にした現状分析と推進の次の一手の「共有」 組織課題が明らかになったところで、次に我々が着目したのが 「ユーザー」というワードが開発の現場で出てくるための意識付け 「ユーザー理解」のためのメンバーの巻き込み という2点です。前者については、プロダクト/サービス開発をする以上当たり前のことだと感じるかもしれませんが、全開発者がユーザーに向き合えているかというとまだまだだ不十分という状況です。 このあたりの肌感を探る為、 The 6 Levels of UX Maturity (UXの成熟度モデル)を参考にしながら、現状分析を行いました。このドキュメントには後半に自身で組織の状態を評価(推定)のできるテストが用意されています。 内容及びテストの結果からして、まだ我々は「Stage 2: Limited(限定的)」にいます。現在地が明らかになることで、次レベルの「Stage 3: Emergent(新興)」へ向かうために何をすべきか、という観点の確認が可能となります。 幸いなことに、一般的な組織で次に課題となる「会社側の理解がない(予算がつかない)」という状況にはありません。トップダウンで課題提起がなされている分、動きやすいと感じます。 組織の情報共有の仕組みとしては、他の注力テーマと定期的に情報共有をする機会(定例会議)が設定されています。それにより、例えばリリース分脈でユーザーについての相談をもらえるような関係にあったり、我々からも今後の取り組みとしてAI活用についての相談を上げたりしています。 ただしこれだけでは、限定的な範囲での情報共有となってしまいます。そこで次に、広く全社に向けての情報共有会を行いました。 UXが孤立しないための取り組み 我々の推進活動の共有 まず取り組んだのは、月に一度全社に向けて行われる情報共有会での活動報告です。 事前に各所と合意を得た「現在地」についての改めての報告と、開発者の多い現場でどうしたら「ユーザーの価値」に着目できるのか?という点に絞ってプレゼンを行いました。 「ユーザーの価値」を中心に据えた開発手法として、アジャイル開発と人間中心デザイン(Human Centered Design 、以後HCD)の類似性を引用しながら説明を行いました。 アジャイルの図はよく目にするエンジニアでも、HCDについては初めて耳にしたというリアクションが出ていました。HCDの各プロセスには具体の手法が提供されていることも合わせて提示したことで、この1度の発表だけでエンジニアからでも具体の相談の上がりやすい状況に転換できました。 社内の先行事例の発掘(勉強会の実施) 次に着手したのが、先行事例として取り組まれている方たちをクローズアップし、改めて社内にその活動を共有する勉強会を開催しました。勉強会を通し、「自分達でもできそう」という感覚を持ってもらうことを目的としています。 この勉強会では、具体のHCDプロセスをプロジェクト内で回している事例と、兄弟会社のKINTOの主催のイベントに赴き、ユーザーのサービス利用の状況把握に努めた事例について、改めて発表をしてもらいました。 後者については、過去にこのブログでも本人が記事を起こしてくれています。 https://blog.kinto-technologies.com/posts/2025-08-22-FACTORY_ReportOfRealEvent/ さらに、エンジニアの多い会社であることをふまえ、前述の取り組みをしたフロントエンドのエンジニアや、インタビューを実行したバックエンドのエンジニアを招聘し、パネルディスカッションを通して、具体の心境の変化などを共有してもらいました。 この勉強会以降、具体のユーザーインタビューやカスタマージャーニーマップなど、ユーザーニーズを掘り下げるような具体手法についての相談が上がってくる、という変化が起きました。最近は半月に1件くらいのペースで相談をいただいています。 今後の我々の活動について 現在、この取り組みは私ともう一人、クリエイティブGの大金とで行っています。暫定的に、ユーザーファースト推進活動の社内プロモーションや色々なプロセスの型化/横展開を行う守谷と、プロジェクト内に入ってHCDプロセスを実行していく大金と、という役割分担にしてはいますがもちろん手が足りてはいません。 前述のように、具体のプロセスを実行できる仲間を増やしたり、近い領域の人たちに声を掛け協力を仰いで、この活動を止めない事が最重要ではないかと考えています。また、今回こういった活動を改めて発表をおこなったことで、これまで各領域で埋もれていた活動(=いわゆるサイロ化現象が起きていた)なども、情報として表面化するようになってきました。 冒頭紹介の通り「2025年の」注力テーマのひとつではありますが、ユーザーのことを考えるのはプロダクトデザインの基礎の基礎。せっかくのこの取り組みの火を絶やさないよう、来年以降も研鑽をし続けようと考えています。 最後に。12月23日には KINTOテクノロジーズ Advent Calendar 2025 にて、ともにこの活動を行う大金から彼女自身の挑戦についての記事が公開されます。お楽しみに!
アバター