Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Startupゼミ よくある課題シリーズ 2022秋期講習編
Search
Kouki Kishida
November 11, 2022
Technology
0
44
Startupゼミ よくある課題シリーズ 2022秋期講習編
2022 AWS DevDayにて登壇した際の資料です
Kouki Kishida
November 11, 2022
Tweet
Share
More Decks by Kouki Kishida
See All by Kouki Kishida
ビジネスを加速するSnowflake×AWSの活用のすゝめ
kishidak
0
130
~スタートアップから学ぶ~ ビジネスを成長させるQuickSightの賢い使い方
kishidak
0
160
シード期のスタートアップに知ってほしい技術のこと
kishidak
0
29
Other Decks in Technology
See All in Technology
Tableau API連携の罠!?脱スプシを夢見たはずが、逆に依存を深めた話
cuebic9bic
2
170
テキストからの実世界知能の実現に向けて
sumoai
0
110
人と生成AIの協調意思決定/Co‑decision making by people and generative AI
moriyuya
0
220
From Live Coding to Vibe Coding with Firebase Studio
firebasethailand
1
330
Datasets for Critical Operations by Dataform
kimujun
0
130
GMOペパボのデータ基盤とデータ活用の現在地 / Current State of GMO Pepabo's Data Infrastructure and Data Utilization
zaimy
2
120
AWS表彰プログラムとキャリアについて
naoki_0531
1
150
LLMをツールからプラットフォームへ〜Ai Workforceの戦略〜 #BetAIDay
layerx
PRO
0
220
完璧を目指さない小さく始める信頼性向上
kakehashi
PRO
0
130
Perlアプリケーションで トレースを実装するまでの 工夫と苦労話
masayoshi
0
250
公開初日に個人環境で試した Gemini CLI 体験記など / Gemini CLI実験レポート
you
PRO
3
1.2k
金融サービスにおける高速な価値提供とAIの役割 #BetAIDay
layerx
PRO
0
190
Featured
See All Featured
Embracing the Ebb and Flow
colly
86
4.8k
Unsuck your backbone
ammeep
671
58k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
182
54k
YesSQL, Process and Tooling at Scale
rocio
173
14k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
Balancing Empowerment & Direction
lara
1
510
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Gamification - CAS2011
davidbonilla
81
5.4k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Designing for humans not robots
tammielis
253
25k
Transcript
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. よくある課題を⼀気に解説︕ 〜御社の技術レベルがアップする2022 秋期講習 〜 Kouki Kishida D - 5 - 1 Startup Solutions Architect Noguchi Shingo Startup Solutions Architect
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. [AWS Startup ゼミ] よくある課題シリーズ • AWS のスタートアップチームは、 ⽇々受けている技術相談から スタートアップにおける技術的な課 題と傾向を把握 • このスライドは2022年秋時点の 「あるある」をまとめたもの • 詳細な解説を全てこのセッション・ 資料で⾏うのではなく、 「こうしたい」に対して、 「どの様に考えていけばよいか」 を⽰す逆引き辞典となっている
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. [AWS Startup ゼミ]これまでの発表 2019 秋期講習 2021 春期講習 h +)+)% 5 MeZY HQN FQ]a OQ % YO Z] MRR W M Q 5WW ] ST ]Q Q]aQP K5HF F M] [ L y o +)+) Q O T ) q q q q 2019 春期講習 © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. 春期講習 2020 のアジェンダはこちら 1. プロダクトにチャット機能をつけたい 2. コストを抑えたい 3. 静的サイトのホスティングを簡単にしたい 4. キャッシュしないなら CDN は不要︖ 2021 秋期講習
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 1. 今の構成をIaC化してインフラ管理を⾃動化したい 2. 何かしら検索したい 2022 秋期講習のアジェンダはこちら
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 今の構成をIaC化してインフラ管理を ⾃動化したい
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 今の構成をIaC化してインフラ管理を⾃動化したい • よくいただく課題 😂 • 開発環境と本番環境が⼀緒になっているので、別アカウントで本番環境を⽴てたい • ただ最初はコンソール上で構築したため⼿間かかりすぎる • 現状の構成を管理するためにドキュメントを更新してたけど、形骸化してる • 本当にしたいことは何︖ 😳 • サービスの構成の定義づけを習慣化して、かんたんに複製したい • 環境を構築する際に、デプロイフローも考慮して安全かつ⾃動にデプロイしたい • 思考フロー 😌 1. とりあえずIaCを書いて⼩さくはじめてみよう 2. サービスを付け⾜して⾃分好みにする 3. 既存の環境と合わせてBlue/Greenデプロイする
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. とりあえずIaCを書いて⼩さくはじめてみよう IaCといえば・・・︖ 😇
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. とりあえずIaCを書いて⼩さくはじめてみよう まず⾃分やチームの相性にあったサービスをつかってみよう AWS CloudFormation AWS Cloud Development Kit (AWS CDK) Terraform
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. • ⾼⽔準⾔語を利⽤していることで、表現が よりコンパクトにできる • ⾔語ごとの標準のエディタを利⽤した補完 機能を利⽤可能 • 普段慣れている開発⾔語があればこちらが おすすめ 向いてる⼈・組織︓ ・チームで慣れている開発⾔語が 1つに統⼀できる組織 ・普段からコードベースで管理 している⼈ とりあえずIaCを書いて⼩さくはじめてみよう それぞれのメリットを各メンバーの相性にそって検討してみる • YAML、JSONフォーマットを利⽤した項⽬ ベースでリソースを指定する • 開発⼒に依存せず、ドキュメントを参照 しながらルールに沿って作成する • 標準化されている分、保管機能や冗⻑表現 があるため、書きやすさ的なところは劣る 向いてる⼈・組織︓ ・YAML、JSONでの設定管理に 慣れている⼈ ・それぞれ得意な開発⾔語が バラバラな組織 AWS CDK CloudFormation
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ⼀度構築したらあまり変更がおきない VPCあたりをやってみるか 最近DynamoDBつかってるし試しに書いてみるか〜 とりあえず1つのサービスから初めて⾒る とりあえずIaCを書いて⼩さくはじめてみよう
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. とりあえずIaCを書いて⼩さくはじめてみよう Cloudformationで書くなら ・テンプレートリファレンスや サンプルを参照する CDKで書くなら ・⾃分に得意な⾔語の リファレンスをさがす --- AWSTemplateFormatVersion: '2010-09-09’ Description: Import test Resources: ServiceTable: Type: AWS::DynamoDB::Table DeletionPolicy: Retain ・・・ ・試しに書いてみる Java ・試しに書いてみる
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. とりあえずIaCを書いて⼩さくはじめてみよう CloudFormationのテンプレートがぐっと書きやすくなるTools • cfn-lint (サイト) ⼊⼒した値の整合性チェックをできるコマンドラインツール • CloudFormation template schema (サイト) Visual Studio Code/PyCharm で利⽤可能でリソースタイプと必須プロパティのリストの⾃動 補完 • Former2(サイト) 既存の AWS リソースを CloudFormation テンプレートとして出⼒できる
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ベースを付け⾜して好みのコードにする • 元のファイルができたらGitなどにソースコードとして管理 • 更新が必要になったらアップデートし検証できるフローを構築する 次はEC2まわりだけ いじったから、そこ だけコードでデプロ イしてみよう テンプレートの アップロード スタックの 作成 リソースの 作成と管理 コードの更新 テンプレートの編集 GitHubなどに コミット GitHub Actions等で裏側で⾃動化す るなどもOK
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 既存の環境と合わせてBlue/Greenデプロイする • GitHub ActionsやAWS CodeBuildを⽤いてCI/CDフローを書きスタックの更新フローを構築する • デプロイにはAWS CodeDeployを利⽤することで現環境と新バージョン環境を両⽴した検証を⾏う スタック AWS CodeDeploy EC2 instance 現環境 EC2 instance 新バージョン環境 変更セット Build Test Deploy CI/CDフロー cdk deploy Traffic 80% Traffic 20% ALB Deploy
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 実装時の参考資料/参考になる事例集 AWS Black Belt Online Seminar • AWS CloudFormation (資料|動画) • AWS CloudFormation Deep Dive (資料|動画) • AWS Cloud Development Kit (資料|動画) AWS Summit / DevDay / その他資料 • AWSで始める Infrastructure as Code(2021)(資料|動画) • AWS CloudFormationでGreenDeploy(サイト) • AWS Hands-on for Beginners AWS環境のコード管理 AWS CloudFormationでWebシステムを構築する(サイト) • AWS CloudFormation テンプレートリファレンス(サイト) • AWS CloudFormation テンプレートサンプル(サイト)
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. なにかしら検索をしたい
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. なにかしら検索をしたい • よくいただく課題 • 全⽂検索をどのようにやるべきかわからない • とりあえずLIKE検索を⾏なっている • 本当にしたいことは何︖ • データを素早く検索したい • 多くの検索リクエストを処理したい • 適切なソリューションを利⽤したい • 思考フロー 1. 検索要件を確認する 2. 同期する⽅法を考える 3. データを作り直すことを考慮する
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 検索要件を確認する どのような検索シチュエーションなのか考える • 公開WEBアプリケーション上での検索 • データ分析⽤途での検索 • カスタマーサポートで必要 • 秒間何回くらい検索される︖ • 検索対象のデータ量は何件くらい︖ • 求められる検索のレイテンシはどのくらい︖ シチュエーションからわかることは 検索される条件は • 全⽂検索が必要なのか • 複雑な条件の指定が必要なのか • タグ検索のようなものが必要なのか
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 検索要件を確認する 出来るだけマネージドサービスを利⽤しよう マネージドサービスを活⽤して運⽤をオフロードしていきましょう。 Amazon OpenSearch Service OpenSearch, OpenSearch Dashboard を簡単 にデプロイ・管理し,スケールさせることが 可能なフルマネージドサービス ソリューションの選択
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 検索要件を確認する 特にPMF前のスタートアップにとって アーキテクチャ変更のタイミングは重要 • 要求される返答時間が⼗分に⻑いのでBatch処理⽤RDBMSにクエリすればいい • インデックスの⾒直しで⼗分要件を満たすことができる • FULLTEXT INDEXで⼗分要件を満たす • ⾮正規化したテーブルがあればそれで⼗分検索要件を満たす 例えば元々のデータストアにRDBMSを利⽤している場合 etc… 上記のような場合でも利⽤規模が⼤きい、検索部分がコアバリュー等でアーキテクチャ変更をした⽅が よいこともあります。 アーキテクチャを変更するタイミングを意識することが⼤切です。 PMF後は規模拡⼤に耐えるアーキテクチャが最重要となってきます。 要件次第ではこのタイミングでアーキテクチャ変更の必要はないかも
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 同期する⽅法を考える データの同期はビジネスロジックと分離する • AWS Database Migration Service(DMS) • AWS Glue • Amazon Kinesis Data Streams との連携 • O/R Mapperのcallback + Queue • バッチ処理で新しいデータをimport マネージドサービスで⾏う場合 アプリケーションレベルで⾏う場合も出来るだけ疎結合に RDS AWS DMS OpenSearch Service
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. データを作り直すことを考慮する プライマリのデータストアを明確にする • 何かが発⽣した際に正とするデータからの再⽣成が⾏える状態を意識する • 更新や削除におけるインデックスの劣化に対する対策としてインデックスの最適化だけでなく インデックスの作り直しを選択肢としてとれる状態を意識する アプリケーションのバグに対する対応や 運⽤上のトラブルに対する対応が容易になり システムの回復性を⾼く保つことが可能になります
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 参考資料 AWS Black Belt Online Seminar • Amazon OpenSearch Service(資料|動画) • AWS Database Migration Service (資料|動画) • Amazon Kinesis (資料) • AWS Glue -Glue Studioを使ったデータ変換のベストプラクティス(資料 | 動画 ) その他 • Amazon OpenSerch Serviceでのインデックス管理(サイト) • コマンドクエリ責任分離(CQRS)パターン (サイト)
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 今回は以下を解説しました 1. 今の構成をIaC化したインフラ管理を⾃動化したい 2. 何かしら検索したい まとめ
© 2022, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Thank you! © 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. Noguchi Shingo Startup Solutions Architect Kouki Kishida Startup Solutions Architect