Slide 1

Slide 1 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 2

Slide 2 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスの未来 〜The Key to Simplifying Everything〜 川路 義隆 Solutions Architect 2

Slide 3

Slide 3 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3 川路 義隆(かわじ よしたか) アマゾンウェブサービスジャパン合同会社 ソリューションアーキテクト ⼩売業のお客様向けのAWS導⼊・アーキテクチャ⽀援 アジャイル・サーバーレス 好きな AWS サービス Amazon API Gateway, AWS Lambda, AWS Step Functions ࣗݾ঺հ 3 AWS Lambda Amazon API Gateway AWS Step Functions @kawaji_scratch

Slide 4

Slide 4 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 複雑さを制御してシンプルにする 4

Slide 5

Slide 5 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5 Simplexity 複雑さとシンプルさの間に 相補的な関係がある可能性を⽰唆する造語

Slide 6

Slide 6 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスサービスの変遷 6

Slide 7

Slide 7 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. History 7 AWS Lambda 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 Amazon SNS Lambda統合 Amazon API Gateway AWS Step Functions LambdaのイベントソースとしてSQS対応 Amazon EventBridge Amazon CognitoからLambda関数実行可能に AWS AppSync Amazon Aurora Serverless AWS Lambdaを中⼼にサーバーレスアプリケーション開発に必要なサービス提供期

Slide 8

Slide 8 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. History 8 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 Amazon Aurora DSQL AWS AppSync Events Amazon Bedrock より多くのワークロードをサーバーレスでシンプルに実現可能に

Slide 9

Slide 9 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. データベースの複雑さをシンプルにする 13

Slide 10

Slide 10 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora DSQLの概要 14

Slide 11

Slide 11 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 既存データベースの課題 15 従来のデータベースの 容量制限により、 ワークロードのサイズを 適正化するには膨⼤な 時間がかかる 拡張性 機能的な課題 運⽤的な課題 障害による予期しない ダウンタイムは データベースの可⽤性に 影響を及ぼす インフラ管理、パッチ適⽤、 アップグレードなどの メンテナンスに多⼤な⼯数 が必要になる インフラの設定、 データベースの構築、 チューニング、管理は 複雑で⼿間がかかる 可⽤性 管理性 複雑性

Slide 12

Slide 12 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16 事実上無制限の スケーラビリティ コンピューティング、読み取り、 書き込み、ストレージのリソースを 個別に即座にスケールアップ/ スケールダウン ビジネス継続性 マルチリージョンクラスターの アクティブ-アクティブアクセスで 99.999% の可⽤性を実現 インフラ管理の排除 サーバーのプロビジョニング、 パッチ適⽤、管理が不要。また、 ソフトウェアのインストール、 保守、運⽤も不要 すぐに使えて簡単 PostgreSQLに慣れていれば、 1分以内にデータベースを 作成してクエリーを 実⾏可能 Amazon Aurora DSQL 事実上無制限のスケーラビリティと⾼い可⽤性を備えたクラウドネイティブなサーバーレス分散SQLデータベース

Slide 13

Slide 13 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. コアコンポーネントに関して 17 Region Customer VPC Customer Application DSQL Cluster AZ1 AZ2 AZ3 エンドポイント (VPC不要) シングルリージョンの例 リレーと接続 クライアントとの接続はエンドポイントを経由して、⼀旦 接続レイヤーで管理されます。セッションやトランザクション の状況により下位のQuery Processorに接続します。 コンピュートとデータベース(Query Processor) サーバーレスとして実⾏されるデータベースエンジンであり 現在PostgreSQL 16をベースとしています。PostgreSQL 16の 機能のサブセットをサポートしています。 トランザクションログ、同時実⾏制御と分離 Query Processorからの書き込み(コミット)処理は、AZ間、 リージョン間に分散したトランザクションログを書き込みます。 ここで分離レベルにあった整合性が保証されます。また、ログ はグローバルでマージされ順序づけられます。 ストレージ グローバルに順序づけられたログは分散ストレージ(レプリカを 含む)に同期的に書き込まれます。読み込み処理は Query Processorから直接分散ストレージにリクエストされます。 コンピュートと データベース トランザクションログ、 同時実⾏制御と分離 ストレージ リレーと接続 (*) https://docs.aws.amazon.com/aurora-dsql/latest/userguide/what-is-core-components.html (*) https://aws.amazon.com/jp/blogs/database/concurrency-control-in-amazon-aurora-dsql/ 従来のデータベースを 細かいコンポーネント に分割し、分散させる ことで、⾼い拡張性を 実現しています

Slide 14

Slide 14 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18 Amazon Aurora DSQL シ ン グ ル リ ー ジ ョ ン ク ラ ス タ ー Region Customer VPC Customer Application DSQL Cluster Multi-AZ アクティブ-アクティブ AZ1 AZ2 AZ3 コンピュートと データベース トランザクションログ、 同時実⾏制御と分離 ストレージ 99.99%のデータベース可⽤性を実現する設計 3 つのアベイラビリティーゾーンへ アクティブ-アクティブのデータレプリケーション 1つのエンドポイントにアクセスすることで読み込み/ 書き込みのスケーリングを⾃動化し、読み込みは 強い⼀貫性(レプリケーションラグはゼロ)を提供します 完全に⾃動化された障害復旧機能により、AZ 全域で発⽣ したイベント中でもデータの強い⼀貫性(RPOはゼロ)が 保たれます

Slide 15

Slide 15 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19 Amazon Aurora DSQL マ ル チ リ ー ジ ョ ン ア ク テ ィ ブ - ア ク テ ィ ブ ク ラ ス タ ー Witness Region Replicated Journal Region Application DSQL <> Customer VPC Region Application DSQL Customer VPC シングルリージョンクラスターのメリットを 2 つの AWS リージョンに拡⼤ 99.999% のデータベース可⽤性を実現する設計 2つのリージョンにまたがってアクティブ – アクティブでのデータアクセス どちらのリージョンも同じで、プライマリもセカンダリもありません。 アプリケーションは、どのリージョンのエンドポイントからでも同じデータ にアクセスできる 完全に⾃動化された障害復旧機能により、リージョン全体で発⽣した イベント時でもデータの強い⼀貫性が保たれます ACIDトランザクションを満たすクロスリージョンでのレプリケーション 計画的なダウンタイムなしの柔軟なスケーリング コンピューティングとストレージは独⽴して拡張が可能 インスタンスのサイズ調整、拡張、配置、管理は不要 パッチ適⽤やメンテナンスウィンドウは不要

Slide 16

Slide 16 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20 Amazon Aurora DSQL リ ー ジ ョ ン 間 の レ イ テ ン シ ー : 書 き 込 み ト ラ ン ザ ク シ ョ ン Aurora DSQL Region 1 Aurora DSQL Region 2 START TRANSACTION; SELECT …; INSERT …; UPDATE …; アプリケーションが 1つのリージョンで トランザクションを開始し、そのリージョンに対して クエリーを実⾏します 個々のクエリーにはリージョン間のレイテンシーは 発⽣しません Aurora DSQLはコミット時にのみリージョン間で通信 します コミット時にはリージョン間で1.5 ラウンドトリップ 時間 (RTT) レイテンシー が追加で発⽣します 実際のレイテンシーはリージョン間の距離によって 異なります COMMIT シングルリージョン構成の場合は、”リージョン”を”AZ”と読み替えてもらって概ね問題ありません

Slide 17

Slide 17 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 21 Amazon Aurora DSQL リ ー ジ ョ ン 間 の レ イ テ ン シ ー : 読 み 込 み の み の ト ラ ン ザ ク シ ョ ン Aurora DSQL Region 1 Aurora DSQL Region 2 クエリーはローカルコピーから読み込まれます リージョン間のレイテンシーがなく、強い整合性を 持った読み取りが可能です START TRANSACTION; SELECT …; SELECT …; COMMT; シングルリージョン構成の場合は、”リージョン”を”AZ”と読み替えてもらって概ね問題ありません

Slide 18

Slide 18 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22 Amazon Aurora DSQL O P T I M I S T I C C O N C U R R E N C Y C O N T R O L ! 悲観的ロックではない デッドロックは存在しない トランザクションのコミット時に 競合を発⾒するプロトコル マルチリージョンで 同時実⾏保護 効率的なストレージレイヤー 同期レプリケーション 開発者にとっては新しい トランザクションパターン

Slide 19

Slide 19 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 23 Amazon Aurora DSQL O P T I M I S T I C C O N C U R R E N C Y C O N T R O L ! 悲観的ロックではない デッドロックは存在しない トランザクションのコミット時に 競合を発⾒するプロトコル マルチリージョンで 同時実⾏保護 効率的なストレージレイヤー 同期レプリケーション 開発者にとっては新しい トランザクションパターン

Slide 20

Slide 20 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. アプリケーション実装の注意点 24 update order =5 commit Transaction update order =5 wait Lockを利⽤して並列処理を待機させることが可能 従来のRDB update order =5 commit Transaction update order =5 Lockを利⽤しないことにより⾼速に処理 Aurora DSQL commit Error アプリケーションはバックオフとジッター実装 によるリトライが重要

Slide 21

Slide 21 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo 28

Slide 22

Slide 22 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. シンプルなクラスタ作成 29

Slide 23

Slide 23 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 複数リージョンからの書き込み 30

Slide 24

Slide 24 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 楽観的同時実⾏制御 (OCC)時のエラーケース 31

Slide 25

Slide 25 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスの未来 32

Slide 26

Slide 26 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Complexity can neither be created nor destroyed only moved somewhere else Dr. Werner Vogels 33 複雑さは、どこか別の場所に移動させることしかできない。

Slide 27

Slide 27 text

© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! Please complete the session survey in the mobile app Please complete the session survey in the mobile app 34