SlideShare a Scribd company logo
1 of 64
Download to read offline
re:G
ene

AWS  マイスターシリーズ  

rate

Amazon  ElastiCache
2013.10.30
アマゾンデータサービスジャパン株式会社
ソリューションアーキテクト  松尾  康博
ソリューションアーキテクト  蒋  逸峰

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アジェンダ
!
!
!
!
!
!

  メモリキャッシュとは
  Amazon  ElastiCacheの概要
  ElastiCache  for  Memcached
  ElastiCache  for  Redis
  ユースケース
  まとめ

2
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
メモリキャッシングとは
!   目的
•  アプリを高速化する手法の一つ
•  消えても良いデータを格納してDBアクセス・負荷を低減
•  メモリにキャッシュしたデータを再利用し 低遅延化・負荷低減

!   用途
•  クエリ結果を再利用 (DBサーバの負荷低減、高速化)
•  揮発性の高いデータを格納 (セッション情報管理)
•  複雑な計算結果・二次データを再利用 (APPサーバの負荷軽減)

3
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Web+DBアプリとメモリキャッシュ
!   典型的な構成
App

RDBMS

1. クライアントからのリクエスト
2. Appサーバが、DBサーバに問い合わせ
3. DBサーバが結果を戻す
4. Appサーバがレスポンスをクライアントに返す

4
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Web+DBアプリとメモリキャッシュ
!   トラフィックが増えると
App

RDBMS

App

RDBMS

5. Appサーバ,DBサーバをスケール
6. 効果・効率・コスト的な面、DBをスケールさせる難易度は?
5
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Web+DBアプリとメモリキャッシュ
!   DB負荷を軽減するためにキャッシュにデータを載せる
•  アプリケーション側で、DBとキャッシュを使い分ける
App

RDBMS

App

キャッシュ

6
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Web+DBアプリとメモリキャッシュ
!   データ参照時の操作
データがキャッシュにあるか?
あるなら取得して完了

キャッシュ

なければDBへクエリ
App

クエリ結果を取得

RDBMS

クエリ結果をキャッシュ

繰り返し
7
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Web+DBアプリとメモリキャッシュ
!   更更新時の操作
キャッシュ
Insert / Update
App

RDBMS

オブジェクト書き込み

繰り返し
8
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Webアプリとメモリキャッシュ(セッション)
!   共有キャッシュとして使った構成
§  複数のAppサーバで共有するセッション用メモリ空間を実現
§  多くの言語やフレームワークが対応済み
§  セッションレプリケーションやロードバランサに依存しない構成が可能
App

キャッシュ

LB

App
9
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アジェンダ
!
!
!
!
!
!

  メモリキャッシュとは
  Amazon  ElastiCacheの概要
  ElastiCache  for  Memcached
  ElastiCache  for  Redis
  ユースケース
  まとめ

10
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
AWSの様々なサービス
お客様のアプリケーション
ライブラリ  &  SDKs
Java,  PHP,  .NET,  
Python,  Ruby,  
node.js

IDEプラグイン
Eclipse
Visual  Studio

メッセージ

Amazon  SNS
Amazon  SQS
Amazon  SES

コンテンツ配信

Amazon  CloudFront

コンピュータ処理理
  Amazon  EC2
Auto  Scale

Web管理理画⾯面
Management  
Console

認証
  AWS  IAM

デプロイと⾃自動化

モニタリング
Amazon  
CloudWatch  

検索索エンジン  
Amazon  Cloud  Search

分散処理理

AWS  Elastic  Beanstalk
AWS  Cloud  Formation
AWS  OpsWorks

Development &
Administration

ワークフロー管理理
Amazon  SWF

トランスコード

Elastic  MapReduce

Amazon  Elastic  Transcoder

ストレージ
  Amazon  S3

Application
Service

データベース

Amazon  EBS
Amazon  Glacier
AWS  Storage  Gateway

Amazon  RDS
Amazon  DynamoDB
Amazon  ElastiCache
Amazon  Redshift

Infrastructure
Service

ネットワーク  &  ルーティング

Amazon  VPC  /  Amazon  Elastic  Load  Balancer  /  Amazon  Route  53  /AWS  Direct  Connect

Region

11

AZ

AWS  グローバルインフラ

Geographical  Regions,  Availability  Zones,  Points  of  Presence

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
AWS  が提供するデータベースサービス
Amazon  RDS

完全マネージド型で、セットアップ、運⽤用、拡張が
容易易なリレーショナル・データベースサービス
完全マネージド型で、⾼高速なパフォーマンス、シ
ームレスな拡張性と信頼性をNoSQLサービス

Amazon  DynamoDB

⾼高速で管理理も万全なペタバイト規模のデータウェ
アハウスサービス
Amazon  Redshift

完全マネージド型で、セットアップ、運⽤用、拡張
が⽤用意なキャッシュサービス

Amazon  ElastiCache

12
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
典型的Webアーキテクチャ(他のサービスとの組み合わせ)
CloudFront
(コンテンツ
      配信)

Amazon  Route  53
(ドメイン名割り当て)
東京リージョン

ELB
(ロードバランサ)
AZ-‐‑‒1c

AZ-‐‑‒1a

EC2

EC2

S3
静的コンテンツ

RDSマスタ

⾃自動同期

RDSスレーブ

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Amazon ElastiCacheとは	
!   構築
•  キャッシュクラスタを数クリックで起動
•  EC2同様、初期費用無し、時間単位の従量課金	

!   移行
•  2種類のエンジン(memcached, redis)をサポート
•  既存アプリケーションの変更不要

!   運用
•  可用性を向上させる機能
•  モニタリング、自動障害検出、復旧、拡張、パッ
チ管理機能を提供

!   セキュリティ
•  セキュリティグループ、VPC対応

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Memcached/Redis on EC2 との相違点
!   導入
§ 
§ 
§ 
§ 

ノード用インスタンスのOSセットアップ 不要
memecached/ Redisのインストール・セットアップ 不要
複数キャッシュノードへのコンフィグファイル配布・同期不要
Management Console/CLI/APIから数分で起動・ノード追加

!   運用
§  監視・高可用性の作り込み不要
§  ノードリカバリ、パッチ適用 自動
§  Firewallの用意、詳細設定不要

!   AWS独自の用語・概念
§  セキュリティ関連
§  クラスタ関連

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
キャッシュノードタイプ
128

Hi-Mem 2XL 33.4 GB
13 EC2 Compute Units
4 virtual cores

64
Memory  (GB)

Hi-Mem 4XL 68 GB
26 EC2 Compute Units
8 virtual cores

	
  

32

	
  

16

	
  

8

	
  

4

	
  

	
  

	
  

	
  

	
  

Medium 3.35 GB
2 EC2 Compute Unit
1 virtual core

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

	
  

1

	
  

	
  

	
  

16

	
  

	
  

2

1

2

4

8

16

Hi-Compute 6.6 GB
20 EC2 Compute Units
8 virtual cores

	
  

Large 7.1 GB
	
  
4 EC2 	
   Compute Units
2 virtual cores

Micro 213 MB
	
  
Up 	
   to 2 ECUs
(for short bursts)

Enhanced XL 14.6 GB
13 EC2 Compute Units
4 virtual cores

Extra Large 14.6 GB
8 EC2 Compute Units
4 virtual cores
	
  

	
  

Small 1.3 GB
1 EC2 Compute Unit
1 virtual core

Enhanced 2XL 29.6 GB
26 EC2 Compute Units
8 virtual cores

	
  

	
  

Hi-Mem XL 16.6 GB
6.5 EC2 Compute Units
2 virtual cores
	
  
	
  

	
  

	
  

	
  

	
  

32

64

128

EC2  Compute  Units  (ECU)

http://aws.amazon.com/jp/elasticache/features-and-benefits/ 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
キャッシュノードタイプとキャッシュサイズ
Cache  Node  Type

memcached

(max_̲cache_̲memory)

redis

(maxmemory)

cache.t1.micro

213  MB

136  MB

cache.m1.small

1.3  GB

900  MB

3.35  GB

2.95  GB

7.1  GB

6.7  GB

cache.m1.xlarge

14.6  GB

14.2  GB

cache.m3.xlarge

14.6  GB

※

cache.m3.2xlarge

29.6  GB

※

cache.m2.xlarge

16.7  GB

16.3  GB

cache.m2.2xlarge

33.8  GB

33.4  GB

cache.m2.4xlarge

68  GB

67.6  GB

6.6  GB

6.2  GB

cache.m1.medium
cache.m1.large

cache.c1.xlarge

※ memcached のみサポート	
http://aws.amazon.com/jp/elasticache/features-and-benefits/ 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
CloudWatch対応	
!   各種メトリクスを60秒間隔で取得・確認可能
•  ホスト層のメトリクス( CPUUtilization, etc. )
•  キャッシュエンジン固有のメトリクス(Evict, CurrConnections, etc.) 	

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheMetrics.html 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
イベント通知  (Cache  Event)
!   ElastiCacheで発生した10以上のイベントをSNS経由でPush通知
•  再起動、ノード追加、ノードリプレイス、設定変更、メンテナンス終了、etc

!   監視システムと組み合わせることで運用自動化が容易に

Queue

Cache
Event	

Message

Amazon SNS

ElastiCache
Cache Node

Alarm

Email
Notification

HTTP
Notification

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ElastiCacheSNS.html 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
VPC対応	
!   VPC内部の任意のサブネットで起動可能
•  起動するサブネットを、Cache Subnet Groupで事前に定義しておく
•  Default VPCでは定義済み

!   注意
•  起動するノードに適用する Security Groupを事前に定義しておく
•  Public IPはつかない(プライベートIPのみ)
•  起動先のサブネットは、クラスタが起動するに十分なCIDRブロックを
用意しておく。

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ElastiCacheAndVPC.html 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アクセス制御	
!   Security Groupで実現
•  EC2インスタンスからキャッシュノードへのアクセス制御を実現
•  アクセス元 EC2 インスタンスに適用しているSecurity Groupとの紐付けによりア
クセス可能になる

!   注意事項
•  ElastiCacheの起動場所によって設定対象が異なる
•  VPC Default環境では Cache Security Groupが無い(不要なため)
•  Cache Security Groupでは、アクセス元としてSecurity Groupのみ指定可能	

起動場所	

設定対象	

EC2 Classic

Cache Security Group	

EC2 VPC	

VPC Security Group	

VPC Default	
 VPC Security Group	
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/
CacheSecurityGroup.html 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
ソフトウェアメンテナンス	
!   ElastiCache標準機能
•  メンテナンスウインドウで指定した曜日・時間帯に自動実施

!   メンテナンス内容
•  安全性・堅牢性の関わるソフトウェアパッチを自動適用
•  Rebootを伴う場合も
•  自動アップグレードも、メンテナンスウインドウ内で実施

!   TIPS
•  アプリケーション側で、キャッシュノードへアクセスできない場合のハンドリン
グを実装しておく。
•  メンテナンス中は、DBの参照負荷が一時的に上がる可能性が高いため、ト
ラフィックが少ない曜日・時間帯を指定しておく。
•  Cache Event 通知を運用監視に組み込んでおく 	
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/VersionManagement.htmll
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/
ManagingCacheClusters.html#ManagingCacheClusters.MaintWindow 	
 in part without the express consent of Amazon.com, Inc.
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or
設定パラメータのカスタマイズ	
!   パラメータグループ
•  複数のキャッシュノードに一括適用可能なパラメータ群
•  キャッシュエンジンごとにデフォルト設定を用意。

!   カスタマイズ
•  新たにパラメータグループを作成・編集し、キャッシュクラスタに適用
することでカスタマイズ可能

!   制約事項
•  一部パラメータは、変更不可
•  memcached: max_cache_memory, num_threads
•  redis: maxmemory
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/
CacheParameterGroups.html 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
ElastiCacheの料料⾦金金体系
!   キャッシュノード利用時間 ($/時間)
•  オンデマンド、リザーブドの2種類の価格モデル

!   ネットワーク
•  ElastiCache 側では、データ転送課金は発生しません。
•  ElastiCacheと通信するEC2側で発生します
•  同一 AZの EC2インスタンスとのデータ転送 : 無料
•  異なるAZのEC2インスタンスとのデータ転送 : $0.01/GB
東京リージョン

$0.01/GB	
Availability Zone - a

$0	

App

Availability Zone - b

http://aws.amazon.com/jp/elasticache/pricing/
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
2つの価格モデル
!   オンデマンド キャッシュノード
•  EC2と同様の、初期費用無し、時間単位の従量課金モデル

!   リザーブド キャッシュノード
•  予約金を支払うことで時間当たり価格を割引(最大70%節減)
•  memcached, redis共に対応
•  購入時に以下を指定
•  キャッシュノードクラス (例 cache.m1.xlarge)
•  キャッシュエンジン ( memcached or redis)
•  利用率(軽度、中度、重度)
•  リージョン (注: アベイラビリティゾーンの指定は不要)
•  期間(1年 or 3年)
http://aws.amazon.com/jp/elasticache/pricing/
http://aws.amazon.com/jp/elasticache/reserved-cache-nodes/
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Simple Monthly Calculator
!   Webフォームで概算費用を試算できます
§  http://calculator.s3.amazonaws.com/calc5.html?lng=ja_JP

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
AWS無料料試⽤用枠
!   AWSでは、無料試用枠を用意しています
•  http://aws.amazon.com/jp/free/ 

!   ElastiCache も対応しています
•  http://aws.amazon.com/jp/elasticache/free/
•  1年間、cache.t1.micro を 750時間/月 まで無料で利用可能です

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アジェンダ
!
!
!
!
!
!

  メモリキャッシュとは
  Amazon  ElastiCacheの概要
  ElastiCache  for  Memcached
  ElastiCache  for  Redis
  ユースケース
  まとめ

28
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Memcachedとは
!   インメモリ key-value ストアキャッシュサーバ
§  2003年にDanga Interactiveが開発(BSDライセンス)
§  ブログサービス「Live Journal」の負荷対策用に作られたもの
§  多くのサイトで採用 (YouTube, Wikipedia, mixi, etc. )

!   特徴
§  KVSのデファクトスタンダードプロトコル
•  Key-valueのシンプルなデータ構造
•  Telnetでも操作可能
§  主要機能のみのシンプルな機能
•  アクセス制御などのセキュリティ機能無し
•  マスタノード、シャーディング、レプリケーションなどの機構無し
•  データ削除は明示的、期限、LRUの3方式

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Amazon  ElastiCache  for  memcached
!   特徴

•  対応バージョン  1.4.5、1.4.14  (2013.10.30現在)
•  memcached  プロトコル準拠
•  Cache  Clusterという論論理理グループに、Cache  Nodeを複数台起動

!   注意

•  複数のアベイラビリティゾーンにまたがった  Cache  Clusterは作れな
い。ゾーン毎に  Cache  Clusterを⽤用意する
CacheCluster A	

Availability Zone - a

CacheCluster B	

Availability Zone - b

30
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Auto Discovery for memcached 	
!   従来のクライアント側の設定
• 

Cache Clusterの全エンドポイントを接続先として設定する。

!   Auto Discoveryクライアント(Java, PHP)
• 

Cache ClusterのConfiguration Endpointを接続先として設定すると、全エンドポイントを自動
取得・設定し、接続する

!   注意
•  Configuration Endpointは、Cache Clusterの ロードバランサー( Proxy) ではなく、
あくまでもメタデータを取得するEndpointとなる	
CacheCluster	

App
通常のクライアントライブラリ	

xxx.0001.apne1.cache.amazonaws.com	

App
Auto Discovery クライアントライブラリ	

xxx.0002.apne1.cache.amazonaws.com	
Configuration Endpoint
xxx.cfg.apne1.cache.amazonaws.com	

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html 	

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
CloudWatchによるmemcached の監視	
!   監視項目
•  http://docs.aws.amazon.com/AmazonElastiCache/latest/
UserGuide/CacheMetrics.Memcached.html

!   主に監視する項目
• 
• 
• 
• 
• 

CPUUtilization (CPU使用率)
Evictions ( キャッシュメモリ不足によるキャッシュアウト発生回数)
SwapUsage
CurrConnections
http://docs.aws.amazon.com/AmazonElastiCache/latest/
UserGuide/CacheMetrics.WhichShouldIMonitor.html 	

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アジェンダ
!
!
!
!
!
!

  メモリキャッシュとは
  Amazon  ElastiCacheの概要
  ElastiCache  for  Memcached
  ElastiCache  for  Redis
  ユースケース
  まとめ

33
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Redisとは?
!   In-‐‑‒memory  Key-‐‑‒Value  Store
!   ⾼高機能なデータ構造、データ操作
•  List,  Set,  Sorted  Set,  Hash

!   永続化機構

•  Snapshot,  Append  only  File

!   冗⻑⾧長化機構

•  Replication

!   Pub/Sub機能
!   Lua  scripting
http://redis.io/ 	
34
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
高度なデータ構造
•  Key-‐‑‒ValueのValueに様々なデータ構造を利利⽤用可能
•  Valueに対し、⾼高レベルの操作が可能

35

http://redis.io/commands 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
嬉しい機能
Pub/Sub
•  チャンネル  /  パターン
•  メッセージング
subscribe
deliver

msg

Client 1

Client 2
msg

publishe
subscribe

Channels / Patterns

36

deliver

Client 3
msg

http://redis.io/topics/pubsub 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
ElastiCache for Redis	
!   特徴
• 
• 
• 
• 

対応バージョン: 2.6.13 (2013.10.30現在)
Replication構成 も数クリックで構築可能
S3上のスナップショット(RDB)プリロード機能
Redisの特徴をほぼサポート
•  Lua Scripting
•  Pub/Sub
•  Append Only File

!   対応しない機能
•  CONFIG, SLAVEOFなど一部コマンドのみ無効
•  パスワード (アクセス制御はセキュリティグループにて実施)

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
リードレプリカ (Replication)	
!   以下の用途に利用可能
•  耐障害性向上(ただし、非同期レプリケーション)
•  Read性能のスケーリング

!   構成
•  Replication Group内に、マスター1台、レプリカ 最大5台
•  Replica of Replica は未対応	
Replication Group	
CacheCluster	

CacheCluster	

Availability Zone - a

CacheCluster	

Availability Zone - b

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Replication.html
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ManagingReplication.html 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アベイラビリティゾーンをまたいだReplication構成
リードレプリカを複数のアベイラビリティゾーンにデプロイ可能
•  同⼀一AZのリードレプリカを参照し⾼高速なデータ取得が可能に
•  プライマリノード側のAZ障害時のデータ保全が可能に

東京リージョン

App

GET

SET

SET

⾮非同期レプリケーション

Availability Zone - a

App

GET

Availability Zone - b

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
リードレプリカ昇格
リードレプリカをプライマリに昇格可能
昇格は数分が必要

•  ダウンが発⽣生するため、クライント側でエラーハンドリングは必要

•  アプリ修正不不要(プライマリのendpointが変わらない)

①

①  unlink

② SYNC

③ DNS  change

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
ノード障害時の挙動と影響	
リードレプリカあり

リードレプリカなし

障害

プライマリ障害

ノード障害

挙動

1.  キャッシュイベントをSNSで通
1.  キャッシュイベントをSNSで通
知を受取る
知を受取る
2.  再起動を試みる
2.  新しいノードを立ち上げ
3.  再起動失敗した場合手動FOが 3.  DNS切替
必要
4.  FO後プライマリDNS自動切替

影響

•  FO完了まで書込不可
•  FO中一定の時間(秒単位)RR
読込不可

キャッシュデータロスト

対策

•  SNS通知を設定する
•  クライント/アプリでエラーハンド
リング(retry, DBから取得など)

•  SNS通知を設定する
•  キャッシュ喪失時の対策も織り
込む

http://aws.amazon.com/jp/elasticache/faqs/#rf7
http://aws.amazon.com/jp/elasticache/faqs/#rf8 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Sentinel vs. ElastiCache(Redis)
Redis  Sentinel
•  Redis本家のHAソリューション
Sentinel

ElastiCache

△

△

(自動昇格、endpoint
変更あり)	

(手動昇格、endpoint
変更なし)	

モニタリング
通知(アラート)
フェールオーバー

アプリ改修不要
管理不要

http://redis.io/topics/sentinel 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
RDBデータのプリロード	
!   既存のRedisからのデータ移行に
•  既存のRedisで取得したRDBファイルをS3に保存
•  キャッシュノード起動時に S3上のRDBファイルを読み込み

!   注意点
•  RDBファイルのバージョン互換性を確認
•  保存したS3に対して、ElastiCacheが参照可能なパーミッションが必要
•  キャッシュノードタイプがサポートするメモリサイズを超えるRDBは読み込み不可。
(起動時にエラーが発生)

Redis	
 
EC2	
 

RDB	
 copy	
 

S3	
 

ElastiCache	
 
for	
 Redis	
 

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/
ManagingCacheClusters.html#ManagingCacheClusters.SeedingRedis 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
データのプリロード
S3からスナップショットをプリロード
• 

プライマリノード起動時にS3パスを指定(例例:  mybacket/path/data.rdb)

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
プリロードの応用: バックアップ&リストア
•  EC2上のRedisをslaveとして  マスタに接続可能
•  EC2上のRedis  slave側でRDBファイルをS3へバックアップしてお
くことで、クラスタ起動時にS3からプリロード可能

slaveof	
 

Redis	
 

restore	
 

RDB	
 copy	
 

EC2	
 

S3	
 

http://redis.io/topics/persistence 	
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/
ManagingCacheClusters.html#ManagingCacheClusters.RedisSnapshots 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Append-Only Files(AOF)について	
!   AOFとは
•  受信した全コマンド(操作)をローカルストレージ上のAOFに追記
•  キャッシュノードreboot時にキャッシュデータの復元が可能
•  メンテナンス時のreboot時にデータを保持可能

!   デフォルトでは off
•  パラメータグループで appendonly をyesに変更し有効化
•  cache.t1.microは未対応( appendonly=yesでも無視される)

!   注意点
•  ノード障害によるノード入れ替えが発生した場合はAOFが喪失する
•  データ保全のためには最低1台のリードレプリカ構成を推奨
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/
CacheParameterGroups.Redis.html#CacheParameterGroups.Redis.AOF 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
CloudWatchによるRedis の監視	
!   主に監視する項目
• 
• 
• 
• 

CPUUtilization (CPU使用率)
Evictions ( キャッシュメモリ不足によるキャッシュアウト発生回数)
CurrConnections
Replica Lag ( レプリケーション遅延)

!   CPU 使用率を監視する際の注意点
• 
• 
• 
• 

Redisは シングルスレッドなので、1コアで動作
cache.m1.xlarge(4コア)だと、 25% (100% / 4) が最大値となる
Alert設定時には、上記点に注意する
http://docs.aws.amazon.com/AmazonElastiCache/latest/
UserGuide/CacheMetrics.WhichShouldIMonitor.html 	

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheMetrics.html 	
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アジェンダ
!
!
!
!
!
!

  メモリキャッシュとは
  Amazon  ElastiCacheの概要
  ElastiCache  for  Memcached
  ElastiCache  for  Redis
  ユースケース
  まとめ

48
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
ユースケース
!   memcached  ,  redis
•  データキャッシュ
•  セッションストア

!   redis
• 
• 
• 
• 
• 

分散カウンター  (atomic  counter)
リアルタイム・メトリック  (bitmaps)
キュー  (lists)
メッセージング  (pub/sub)
リーダーボード,スコアランキング  (sorted  sets)

49
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
ブロードキャスト
リアルタイム位置ゲーム	
 (broadcast	
 with	
 Redis	
 pub/sub)	
 

*Image from:
https://geoloqi.com/blog/2011/09/building-a-real-time-location-based-urban-geofencing-game-with-socket-io-redisnode-js-and-sinatra-synchrony/

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
メモリキャッシュを利利⽤用する際の注意点
!   システムの性質を考える
• 
• 
• 
• 

一般的なWebシステムは、参照:更新≒9:1
更新クエリの割合が大きいシステムでは効果薄
キャッシュミス時のペナルティ対策(定期更新等)
キャッシュ喪失時の対策も織り込む
•  ログインし直し、DB負荷増、等への対策

!   キャッシュするデータの性質を考えてキャッシュする
§  有効期限の短いデータは不向き
§  参照頻度の低いデータは、メモリ効率が悪い

!   トランザクション・コヒーレンシを考える
§  一貫性が必要なデータは、慎重に設計・実装する
§  DBより古いキャッシュを使わない工夫
51
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
キャッシュのクラスタ化について
!   単一キャッシュノード構成の課題
•  障害時のデータ喪失による影響は少ない(はず)
§  ただしDBが過負荷になり、システムスローダウンやダウンも
§  キャッシュ容量増強のためにはスケールアップ(容易ではない)

App

RDBMS

キャッシュ
App

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
キャッシュのクラスタ化(Consistent Hashing)
!   Consistent Hashingの特徴
• 
§ 
§ 
§ 

Appサーバ側でConsistent Hashingアルゴリズムで振り分ける
ノード障害時のキャッシュ喪失が限定的
ノード追加で総キャッシュ容量を増やしやすい
ノード数変更時のリバランスコストが限定的
APPサーバ

キャッシュ

ライブラリ
CHアルゴリズム
ノードリスト
キャッシュ

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
クラスタリングの方法	
!   クライアントライブラリにて
•  PHPなどで使うlibmemcachedは標準でdistribution アルゴリズム実装済み

!

Twemproxy
• 
• 
• 
• 

Twitter社が開発したMemcached/Redis⽤用のproxy
複数サーバーのシャーディング  (consistent  hashing)
キャッシュサーバーの接続管理理
⼀一部未サポートのコマンドもあり

!   参考
§  Consistent hashing - Wikipedia, the free encyclopedia
§  http://en.wikipedia.org/wiki/Consistent_hashing

§  memcachedを知り尽くす:第4回 memcachedの分散アルゴリズム|
gihyo.jp … 技術評論社
§  http://gihyo.jp/dev/feature/01/memcached/0004?page=3

§  Partitioning: how to split data among multiple Redis instances.
§  http://redis.io/topics/partitioning

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Twemproxyの構成例例
TwemproxyがSPOFとならないように、各アプリサーバ上
Twemproxyを起動し、アプリケーションはローカルホストの
twemproxyにアクセスする

Redis	

memcached	
App	
 
+	
 
Twemproxy	
 

App	
 
+	
 
Twemproxy	
 

App	
 
+	
 
Twemproxy	
 

RG1	
 

App	
 
+	
 
Twemproxy	
 

RG2	
 

55
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
アジェンダ
!
!
!
!
!
!

  メモリキャッシュとは
  Amazon  ElastiCacheの概要
  ElastiCache  for  Memcached
  ElastiCache  for  Redis
  ユースケース
  まとめ

56
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Amazon  ElastiCache  の利利点
!   構築・運⽤用が⾮非常に容易易

•  Management  Console  やAPIからクラスタの作成が可能
•  性能監視、⾃自動復復旧機能、⾼高可⽤用性機能、パッチ機能
•  レプリケーション(redis)

!   セキュリティ

•  セキュリティグループによるアクセス制御
•  VPC内部でも利利⽤用可能

57
© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
参考資料
!   Amazon ElastiCache 概要
•  http://aws.amazon.com/jp/elasticache/

!   料金
•  http://aws.amazon.com/jp/elasticache/pricing/
•  http://aws.amazon.com/jp/elasticache/reserved-cache-nodes/

!   FAQ
•  http://aws.amazon.com/jp/elasticache/faqs/

!   ドキュメント
•  http://aws.amazon.com/jp/documentation/elasticache/

!   Amazon ElastiCache フォーラム
•  https://forums.aws.amazon.com/forum.jspa?forumID=127

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
APPENDIX

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Appendix: Redis で制限されているコマンド
!   以下のコマンドは実行不可(unknown command扱い)
• 
• 
• 
• 

設定系 (config, slaveof)
データ制御系 ( save, bgsave, bgrewriteof, migrate)
プロセス制御系( shutdown)
debug

!   参考
•  http://redis.io/commands
•  http://docs.aws.amazon.com/AmazonElastiCache/latest/
UserGuide/ClientConfig.html#ClientConfig.RestrictedCommands 

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Appendix: Redis で変更不可パラメータ
!   以下のパラメータは変更不可
• 
• 
• 
• 
• 

activerehashing=Yes
databases=16
lua-time-limit
maxclients
maxmemory ( maxmemory-policyは変更可能)

!   参考
•  http://redis.io/topics/config
•  http://docs.aws.amazon.com/AmazonElastiCache/latest/
UserGuide/CacheParameterGroups.Redis.html 

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Appendix: Scale-up vs. Scale-out
Scale-up

Scale-out

性能アップ
運用しやすい
開発しやすい

△
Library/proxyが必要

障害時影響が少ない

△
RedisはFOで影響を抑える

スケール

△
ノード一台のメモリ上限(68GB)まで ノード追加でスケール

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Appendix: メモリGB単価
m2シリーズは
メモリ単価が安い

メモリ単価
0.16
0.14

Case  Study
•  4GBが必要なら
•  m1.large

•  32GBが必要なら

•  m2.2xlarge  (scale-‐‑‒up)
•  m2.xlarge  X  2  (Hybrid)
•  m1.large  X  6  (scale-‐‑‒out)

0.12
0.1
0.08
0.06

$/h/GB

0.04
0.02
0

*Y軸:  1GBメモリの単価
*memcachedの  max_cache_memory を基準で計算
Redis も同じトレンド

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
Appendix: コストパフォーマンス
m1.medium⼀一台を
1時間使った場合:$0.206
Cost  /  Performance
のいいタイプ
•  t1.micro
•  m1.small
•  m1.medium
•  m1.large
•  m2.xlarge

Cost/Performance
1.2
1
0.8
0.6
0.4
0.2

相対CP

0

*Y軸:  m2.4xlargeのコストパフォーマンスを1とした場合の
相対値

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

More Related Content

What's hot

20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMR20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMRAmazon Web Services Japan
 
20190320 AWS Black Belt Online Seminar Amazon EBS
20190320 AWS Black Belt Online Seminar Amazon EBS20190320 AWS Black Belt Online Seminar Amazon EBS
20190320 AWS Black Belt Online Seminar Amazon EBSAmazon Web Services Japan
 
AWS Black Belt Techシリーズ Amazon Route53
AWS Black Belt Techシリーズ Amazon Route53AWS Black Belt Techシリーズ Amazon Route53
AWS Black Belt Techシリーズ Amazon Route53Amazon Web Services Japan
 
20190911 AWS Black Belt Online Seminar AWS Batch
20190911 AWS Black Belt Online Seminar AWS Batch20190911 AWS Black Belt Online Seminar AWS Batch
20190911 AWS Black Belt Online Seminar AWS BatchAmazon Web Services Japan
 
The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発Amazon Web Services Japan
 
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用Amazon Web Services Japan
 
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
AWS Black Belt Online Seminar 2017 Amazon ElastiCacheAWS Black Belt Online Seminar 2017 Amazon ElastiCache
AWS Black Belt Online Seminar 2017 Amazon ElastiCacheAmazon Web Services Japan
 
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / GlacierAmazon Web Services Japan
 
オンプレミスRDBMSをAWSへ移行する手法
オンプレミスRDBMSをAWSへ移行する手法オンプレミスRDBMSをAWSへ移行する手法
オンプレミスRDBMSをAWSへ移行する手法Amazon Web Services Japan
 
20190410 AWS Black Belt Online Seminar Amazon Elastic Container Service for K...
20190410 AWS Black Belt Online Seminar Amazon Elastic Container Service for K...20190410 AWS Black Belt Online Seminar Amazon Elastic Container Service for K...
20190410 AWS Black Belt Online Seminar Amazon Elastic Container Service for K...Amazon Web Services Japan
 
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.020191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0Amazon Web Services Japan
 
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築Amazon Web Services Japan
 
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQLAmazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon Kinesis
AWS Black Belt Online Seminar 2017 Amazon KinesisAWS Black Belt Online Seminar 2017 Amazon Kinesis
AWS Black Belt Online Seminar 2017 Amazon KinesisAmazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic BeanstalkAWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic BeanstalkAmazon Web Services Japan
 
20210126 AWS Black Belt Online Seminar AWS CodeDeploy
20210126 AWS Black Belt Online Seminar AWS CodeDeploy20210126 AWS Black Belt Online Seminar AWS CodeDeploy
20210126 AWS Black Belt Online Seminar AWS CodeDeployAmazon Web Services Japan
 
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)Amazon Web Services Japan
 

What's hot (20)

20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMR20191023 AWS Black Belt Online Seminar Amazon EMR
20191023 AWS Black Belt Online Seminar Amazon EMR
 
20190320 AWS Black Belt Online Seminar Amazon EBS
20190320 AWS Black Belt Online Seminar Amazon EBS20190320 AWS Black Belt Online Seminar Amazon EBS
20190320 AWS Black Belt Online Seminar Amazon EBS
 
AWS Black Belt Techシリーズ Amazon Route53
AWS Black Belt Techシリーズ Amazon Route53AWS Black Belt Techシリーズ Amazon Route53
AWS Black Belt Techシリーズ Amazon Route53
 
20190911 AWS Black Belt Online Seminar AWS Batch
20190911 AWS Black Belt Online Seminar AWS Batch20190911 AWS Black Belt Online Seminar AWS Batch
20190911 AWS Black Belt Online Seminar AWS Batch
 
The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発The Twelve-Factor Appで考えるAWSのサービス開発
The Twelve-Factor Appで考えるAWSのサービス開発
 
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
 
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
 
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
AWS Black Belt Online Seminar 2017 Amazon ElastiCacheAWS Black Belt Online Seminar 2017 Amazon ElastiCache
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
 
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
 
AWS Black Belt online seminar 2017 Snowball
AWS Black Belt online seminar 2017 SnowballAWS Black Belt online seminar 2017 Snowball
AWS Black Belt online seminar 2017 Snowball
 
オンプレミスRDBMSをAWSへ移行する手法
オンプレミスRDBMSをAWSへ移行する手法オンプレミスRDBMSをAWSへ移行する手法
オンプレミスRDBMSをAWSへ移行する手法
 
20190410 AWS Black Belt Online Seminar Amazon Elastic Container Service for K...
20190410 AWS Black Belt Online Seminar Amazon Elastic Container Service for K...20190410 AWS Black Belt Online Seminar Amazon Elastic Container Service for K...
20190410 AWS Black Belt Online Seminar Amazon Elastic Container Service for K...
 
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.020191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
20191126 AWS Black Belt Online Seminar Amazon AppStream 2.0
 
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
 
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
AWS Black Belt Online Seminar 2016 AWS上でのActive Directory構築
 
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
 
AWS Black Belt Online Seminar 2017 Amazon Kinesis
AWS Black Belt Online Seminar 2017 Amazon KinesisAWS Black Belt Online Seminar 2017 Amazon Kinesis
AWS Black Belt Online Seminar 2017 Amazon Kinesis
 
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic BeanstalkAWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
 
20210126 AWS Black Belt Online Seminar AWS CodeDeploy
20210126 AWS Black Belt Online Seminar AWS CodeDeploy20210126 AWS Black Belt Online Seminar AWS CodeDeploy
20210126 AWS Black Belt Online Seminar AWS CodeDeploy
 
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
 

Similar to [AWSマイスターシリーズ] Amazon ElastiCache

Amazon ElastiCache - AWSマイスターシリーズ
Amazon ElastiCache - AWSマイスターシリーズAmazon ElastiCache - AWSマイスターシリーズ
Amazon ElastiCache - AWSマイスターシリーズSORACOM, INC
 
EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!-
EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!-EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!-
EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!-Yuta Imai
 
AWS Black Belt Techシリーズ Amazon ElastiCache
AWS Black Belt Techシリーズ Amazon ElastiCacheAWS Black Belt Techシリーズ Amazon ElastiCache
AWS Black Belt Techシリーズ Amazon ElastiCacheAmazon Web Services Japan
 
AWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block Store
AWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block StoreAWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block Store
AWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block StoreAmazon Web Services Japan
 
AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)
AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)
AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)Amazon Web Services Japan
 
AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)
AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)
AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)Amazon Web Services Japan
 
[AWSマイスターシリーズ] Instance Store & Elastic Block Store
[AWSマイスターシリーズ] Instance Store & Elastic Block Store[AWSマイスターシリーズ] Instance Store & Elastic Block Store
[AWSマイスターシリーズ] Instance Store & Elastic Block StoreAmazon Web Services Japan
 
[AWSマイスターシリーズ] Amazon Elastic MapReduce (EMR)
[AWSマイスターシリーズ] Amazon Elastic MapReduce (EMR)[AWSマイスターシリーズ] Amazon Elastic MapReduce (EMR)
[AWSマイスターシリーズ] Amazon Elastic MapReduce (EMR)Amazon Web Services Japan
 
[AWSマイスターシリーズ] AWS CloudFormation
[AWSマイスターシリーズ] AWS CloudFormation[AWSマイスターシリーズ] AWS CloudFormation
[AWSマイスターシリーズ] AWS CloudFormationAmazon Web Services Japan
 
20180704(20190520 Renewed) AWS Black Belt Online Seminar Amazon Elastic File ...
20180704(20190520 Renewed) AWS Black Belt Online Seminar Amazon Elastic File ...20180704(20190520 Renewed) AWS Black Belt Online Seminar Amazon Elastic File ...
20180704(20190520 Renewed) AWS Black Belt Online Seminar Amazon Elastic File ...Amazon Web Services Japan
 
[AWSマイスターシリーズ]AWS Storage Gateway
[AWSマイスターシリーズ]AWS Storage Gateway[AWSマイスターシリーズ]AWS Storage Gateway
[AWSマイスターシリーズ]AWS Storage GatewayAmazon Web Services Japan
 
[AWSマイスターシリーズ] AWS Elastic Beanstalk
[AWSマイスターシリーズ] AWS Elastic Beanstalk[AWSマイスターシリーズ] AWS Elastic Beanstalk
[AWSマイスターシリーズ] AWS Elastic BeanstalkAmazon Web Services Japan
 
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud HPC編
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud HPC編[AWSマイスターシリーズ] Amazon Elastic Compute Cloud HPC編
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud HPC編Amazon Web Services Japan
 
SAPでクラウドはじめてみませんか? AWS and Azure
SAPでクラウドはじめてみませんか? AWS and AzureSAPでクラウドはじめてみませんか? AWS and Azure
SAPでクラウドはじめてみませんか? AWS and AzureMasaru Hiroki
 
[AWSマイスターシリーズ] AWS Elastic Beanstalk -Python編-
[AWSマイスターシリーズ] AWS Elastic Beanstalk -Python編-[AWSマイスターシリーズ] AWS Elastic Beanstalk -Python編-
[AWSマイスターシリーズ] AWS Elastic Beanstalk -Python編-Amazon Web Services Japan
 
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信Amazon Web Services Japan
 
Amazon EC2を使った実践SaaS運用事例
Amazon EC2を使った実践SaaS運用事例Amazon EC2を使った実践SaaS運用事例
Amazon EC2を使った実践SaaS運用事例Yuuki Namikawa
 
cloudpack導入資料(20120302版)
cloudpack導入資料(20120302版)cloudpack導入資料(20120302版)
cloudpack導入資料(20120302版)iret, Inc.
 

Similar to [AWSマイスターシリーズ] Amazon ElastiCache (20)

Amazon ElastiCache - AWSマイスターシリーズ
Amazon ElastiCache - AWSマイスターシリーズAmazon ElastiCache - AWSマイスターシリーズ
Amazon ElastiCache - AWSマイスターシリーズ
 
EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!-
EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!-EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!-
EC2のストレージどう使う? -Instance Storageを理解して高速IOを上手に活用!-
 
AWS Black Belt Techシリーズ Amazon ElastiCache
AWS Black Belt Techシリーズ Amazon ElastiCacheAWS Black Belt Techシリーズ Amazon ElastiCache
AWS Black Belt Techシリーズ Amazon ElastiCache
 
AWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block Store
AWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block StoreAWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block Store
AWSマイスターシリーズ Instance Store(Ephemeral Disk) & Elastic Block Store
 
AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)
AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)
AWS Black Belt Techシリーズ Amazon Elastic Compute Cloud (Amazon EC2)
 
AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)
AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)
AWS Black Belt Techシリーズ Amazon Relational Database Service (RDS)
 
[AWSマイスターシリーズ] Instance Store & Elastic Block Store
[AWSマイスターシリーズ] Instance Store & Elastic Block Store[AWSマイスターシリーズ] Instance Store & Elastic Block Store
[AWSマイスターシリーズ] Instance Store & Elastic Block Store
 
20120117 13 meister-elasti_cache-public
20120117 13 meister-elasti_cache-public20120117 13 meister-elasti_cache-public
20120117 13 meister-elasti_cache-public
 
[AWSマイスターシリーズ] Amazon Elastic MapReduce (EMR)
[AWSマイスターシリーズ] Amazon Elastic MapReduce (EMR)[AWSマイスターシリーズ] Amazon Elastic MapReduce (EMR)
[AWSマイスターシリーズ] Amazon Elastic MapReduce (EMR)
 
[AWSマイスターシリーズ] AWS CloudFormation
[AWSマイスターシリーズ] AWS CloudFormation[AWSマイスターシリーズ] AWS CloudFormation
[AWSマイスターシリーズ] AWS CloudFormation
 
20180704(20190520 Renewed) AWS Black Belt Online Seminar Amazon Elastic File ...
20180704(20190520 Renewed) AWS Black Belt Online Seminar Amazon Elastic File ...20180704(20190520 Renewed) AWS Black Belt Online Seminar Amazon Elastic File ...
20180704(20190520 Renewed) AWS Black Belt Online Seminar Amazon Elastic File ...
 
Elastic beanstalk docker_support
Elastic beanstalk docker_supportElastic beanstalk docker_support
Elastic beanstalk docker_support
 
[AWSマイスターシリーズ]AWS Storage Gateway
[AWSマイスターシリーズ]AWS Storage Gateway[AWSマイスターシリーズ]AWS Storage Gateway
[AWSマイスターシリーズ]AWS Storage Gateway
 
[AWSマイスターシリーズ] AWS Elastic Beanstalk
[AWSマイスターシリーズ] AWS Elastic Beanstalk[AWSマイスターシリーズ] AWS Elastic Beanstalk
[AWSマイスターシリーズ] AWS Elastic Beanstalk
 
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud HPC編
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud HPC編[AWSマイスターシリーズ] Amazon Elastic Compute Cloud HPC編
[AWSマイスターシリーズ] Amazon Elastic Compute Cloud HPC編
 
SAPでクラウドはじめてみませんか? AWS and Azure
SAPでクラウドはじめてみませんか? AWS and AzureSAPでクラウドはじめてみませんか? AWS and Azure
SAPでクラウドはじめてみませんか? AWS and Azure
 
[AWSマイスターシリーズ] AWS Elastic Beanstalk -Python編-
[AWSマイスターシリーズ] AWS Elastic Beanstalk -Python編-[AWSマイスターシリーズ] AWS Elastic Beanstalk -Python編-
[AWSマイスターシリーズ] AWS Elastic Beanstalk -Python編-
 
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
[AWSマイスターシリーズ] Amazon CloudFront / Amazon Elastic Transcoderによるコンテンツ配信
 
Amazon EC2を使った実践SaaS運用事例
Amazon EC2を使った実践SaaS運用事例Amazon EC2を使った実践SaaS運用事例
Amazon EC2を使った実践SaaS運用事例
 
cloudpack導入資料(20120302版)
cloudpack導入資料(20120302版)cloudpack導入資料(20120302版)
cloudpack導入資料(20120302版)
 

More from Amazon Web Services Japan

202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)Amazon Web Services Japan
 
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFSAmazon Web Services Japan
 
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device Defender202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device DefenderAmazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...Amazon Web Services Japan
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Web Services Japan
 
20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したことAmazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用Amazon Web Services Japan
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdfAmazon Web Services Japan
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介Amazon Web Services Japan
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon Web Services Japan
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことAmazon Web Services Japan
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチAmazon Web Services Japan
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer ProfilesAmazon Web Services Japan
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨Amazon Web Services Japan
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介Amazon Web Services Japan
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介Amazon Web Services Japan
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...Amazon Web Services Japan
 

More from Amazon Web Services Japan (20)

202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
 
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
 
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device Defender202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
 
Infrastructure as Code (IaC) 談義 2022
Infrastructure as Code (IaC) 談義 2022Infrastructure as Code (IaC) 談義 2022
Infrastructure as Code (IaC) 談義 2022
 
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
 
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
 
20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと
 
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDD
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
 

[AWSマイスターシリーズ] Amazon ElastiCache

  • 1. re:G ene AWS  マイスターシリーズ   rate Amazon  ElastiCache 2013.10.30 アマゾンデータサービスジャパン株式会社 ソリューションアーキテクト  松尾  康博 ソリューションアーキテクト  蒋  逸峰 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 2. アジェンダ ! ! ! ! ! !   メモリキャッシュとは   Amazon  ElastiCacheの概要   ElastiCache  for  Memcached   ElastiCache  for  Redis   ユースケース   まとめ 2 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 3. メモリキャッシングとは !   目的 •  アプリを高速化する手法の一つ •  消えても良いデータを格納してDBアクセス・負荷を低減 •  メモリにキャッシュしたデータを再利用し 低遅延化・負荷低減 !   用途 •  クエリ結果を再利用 (DBサーバの負荷低減、高速化) •  揮発性の高いデータを格納 (セッション情報管理) •  複雑な計算結果・二次データを再利用 (APPサーバの負荷軽減) 3 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 4. Web+DBアプリとメモリキャッシュ !   典型的な構成 App RDBMS 1. クライアントからのリクエスト 2. Appサーバが、DBサーバに問い合わせ 3. DBサーバが結果を戻す 4. Appサーバがレスポンスをクライアントに返す 4 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 5. Web+DBアプリとメモリキャッシュ !   トラフィックが増えると App RDBMS App RDBMS 5. Appサーバ,DBサーバをスケール 6. 効果・効率・コスト的な面、DBをスケールさせる難易度は? 5 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 6. Web+DBアプリとメモリキャッシュ !   DB負荷を軽減するためにキャッシュにデータを載せる •  アプリケーション側で、DBとキャッシュを使い分ける App RDBMS App キャッシュ 6 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 8. Web+DBアプリとメモリキャッシュ !   更更新時の操作 キャッシュ Insert / Update App RDBMS オブジェクト書き込み 繰り返し 8 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 9. Webアプリとメモリキャッシュ(セッション) !   共有キャッシュとして使った構成 §  複数のAppサーバで共有するセッション用メモリ空間を実現 §  多くの言語やフレームワークが対応済み §  セッションレプリケーションやロードバランサに依存しない構成が可能 App キャッシュ LB App 9 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 10. アジェンダ ! ! ! ! ! !   メモリキャッシュとは   Amazon  ElastiCacheの概要   ElastiCache  for  Memcached   ElastiCache  for  Redis   ユースケース   まとめ 10 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 11. AWSの様々なサービス お客様のアプリケーション ライブラリ  &  SDKs Java,  PHP,  .NET,   Python,  Ruby,   node.js IDEプラグイン Eclipse Visual  Studio メッセージ Amazon  SNS Amazon  SQS Amazon  SES コンテンツ配信 Amazon  CloudFront コンピュータ処理理  Amazon  EC2 Auto  Scale Web管理理画⾯面 Management   Console 認証  AWS  IAM デプロイと⾃自動化 モニタリング Amazon   CloudWatch   検索索エンジン   Amazon  Cloud  Search 分散処理理 AWS  Elastic  Beanstalk AWS  Cloud  Formation AWS  OpsWorks Development & Administration ワークフロー管理理 Amazon  SWF トランスコード Elastic  MapReduce Amazon  Elastic  Transcoder ストレージ  Amazon  S3 Application Service データベース Amazon  EBS Amazon  Glacier AWS  Storage  Gateway Amazon  RDS Amazon  DynamoDB Amazon  ElastiCache Amazon  Redshift Infrastructure Service ネットワーク  &  ルーティング Amazon  VPC  /  Amazon  Elastic  Load  Balancer  /  Amazon  Route  53  /AWS  Direct  Connect Region 11 AZ AWS  グローバルインフラ Geographical  Regions,  Availability  Zones,  Points  of  Presence © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 12. AWS  が提供するデータベースサービス Amazon  RDS 完全マネージド型で、セットアップ、運⽤用、拡張が 容易易なリレーショナル・データベースサービス 完全マネージド型で、⾼高速なパフォーマンス、シ ームレスな拡張性と信頼性をNoSQLサービス Amazon  DynamoDB ⾼高速で管理理も万全なペタバイト規模のデータウェ アハウスサービス Amazon  Redshift 完全マネージド型で、セットアップ、運⽤用、拡張 が⽤用意なキャッシュサービス Amazon  ElastiCache 12 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 13. 典型的Webアーキテクチャ(他のサービスとの組み合わせ) CloudFront (コンテンツ      配信) Amazon  Route  53 (ドメイン名割り当て) 東京リージョン ELB (ロードバランサ) AZ-‐‑‒1c AZ-‐‑‒1a EC2 EC2 S3 静的コンテンツ RDSマスタ ⾃自動同期 RDSスレーブ © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 14. Amazon ElastiCacheとは !   構築 •  キャッシュクラスタを数クリックで起動 •  EC2同様、初期費用無し、時間単位の従量課金 !   移行 •  2種類のエンジン(memcached, redis)をサポート •  既存アプリケーションの変更不要 !   運用 •  可用性を向上させる機能 •  モニタリング、自動障害検出、復旧、拡張、パッ チ管理機能を提供 !   セキュリティ •  セキュリティグループ、VPC対応 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 15. Memcached/Redis on EC2 との相違点 !   導入 §  §  §  §  ノード用インスタンスのOSセットアップ 不要 memecached/ Redisのインストール・セットアップ 不要 複数キャッシュノードへのコンフィグファイル配布・同期不要 Management Console/CLI/APIから数分で起動・ノード追加 !   運用 §  監視・高可用性の作り込み不要 §  ノードリカバリ、パッチ適用 自動 §  Firewallの用意、詳細設定不要 !   AWS独自の用語・概念 §  セキュリティ関連 §  クラスタ関連 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 16. キャッシュノードタイプ 128 Hi-Mem 2XL 33.4 GB 13 EC2 Compute Units 4 virtual cores 64 Memory  (GB) Hi-Mem 4XL 68 GB 26 EC2 Compute Units 8 virtual cores   32   16   8   4           Medium 3.35 GB 2 EC2 Compute Unit 1 virtual core                                         1       16     2 1 2 4 8 16 Hi-Compute 6.6 GB 20 EC2 Compute Units 8 virtual cores   Large 7.1 GB   4 EC2   Compute Units 2 virtual cores Micro 213 MB   Up   to 2 ECUs (for short bursts) Enhanced XL 14.6 GB 13 EC2 Compute Units 4 virtual cores Extra Large 14.6 GB 8 EC2 Compute Units 4 virtual cores     Small 1.3 GB 1 EC2 Compute Unit 1 virtual core Enhanced 2XL 29.6 GB 26 EC2 Compute Units 8 virtual cores     Hi-Mem XL 16.6 GB 6.5 EC2 Compute Units 2 virtual cores             32 64 128 EC2  Compute  Units  (ECU) http://aws.amazon.com/jp/elasticache/features-and-benefits/ © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 17. キャッシュノードタイプとキャッシュサイズ Cache  Node  Type memcached (max_̲cache_̲memory) redis (maxmemory) cache.t1.micro 213  MB 136  MB cache.m1.small 1.3  GB 900  MB 3.35  GB 2.95  GB 7.1  GB 6.7  GB cache.m1.xlarge 14.6  GB 14.2  GB cache.m3.xlarge 14.6  GB ※ cache.m3.2xlarge 29.6  GB ※ cache.m2.xlarge 16.7  GB 16.3  GB cache.m2.2xlarge 33.8  GB 33.4  GB cache.m2.4xlarge 68  GB 67.6  GB 6.6  GB 6.2  GB cache.m1.medium cache.m1.large cache.c1.xlarge ※ memcached のみサポート http://aws.amazon.com/jp/elasticache/features-and-benefits/ © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 18. CloudWatch対応 !   各種メトリクスを60秒間隔で取得・確認可能 •  ホスト層のメトリクス( CPUUtilization, etc. ) •  キャッシュエンジン固有のメトリクス(Evict, CurrConnections, etc.) http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheMetrics.html © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 19. イベント通知  (Cache  Event) !   ElastiCacheで発生した10以上のイベントをSNS経由でPush通知 •  再起動、ノード追加、ノードリプレイス、設定変更、メンテナンス終了、etc !   監視システムと組み合わせることで運用自動化が容易に Queue Cache Event Message Amazon SNS ElastiCache Cache Node Alarm Email Notification HTTP Notification http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ElastiCacheSNS.html © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 20. VPC対応 !   VPC内部の任意のサブネットで起動可能 •  起動するサブネットを、Cache Subnet Groupで事前に定義しておく •  Default VPCでは定義済み !   注意 •  起動するノードに適用する Security Groupを事前に定義しておく •  Public IPはつかない(プライベートIPのみ) •  起動先のサブネットは、クラスタが起動するに十分なCIDRブロックを 用意しておく。 http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ElastiCacheAndVPC.html  © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 21. アクセス制御 !   Security Groupで実現 •  EC2インスタンスからキャッシュノードへのアクセス制御を実現 •  アクセス元 EC2 インスタンスに適用しているSecurity Groupとの紐付けによりア クセス可能になる !   注意事項 •  ElastiCacheの起動場所によって設定対象が異なる •  VPC Default環境では Cache Security Groupが無い(不要なため) •  Cache Security Groupでは、アクセス元としてSecurity Groupのみ指定可能 起動場所 設定対象 EC2 Classic Cache Security Group EC2 VPC VPC Security Group VPC Default VPC Security Group http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ CacheSecurityGroup.html © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 22. ソフトウェアメンテナンス !   ElastiCache標準機能 •  メンテナンスウインドウで指定した曜日・時間帯に自動実施 !   メンテナンス内容 •  安全性・堅牢性の関わるソフトウェアパッチを自動適用 •  Rebootを伴う場合も •  自動アップグレードも、メンテナンスウインドウ内で実施 !   TIPS •  アプリケーション側で、キャッシュノードへアクセスできない場合のハンドリン グを実装しておく。 •  メンテナンス中は、DBの参照負荷が一時的に上がる可能性が高いため、ト ラフィックが少ない曜日・時間帯を指定しておく。 •  Cache Event 通知を運用監視に組み込んでおく http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/VersionManagement.htmll http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ ManagingCacheClusters.html#ManagingCacheClusters.MaintWindow in part without the express consent of Amazon.com, Inc. © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or
  • 23. 設定パラメータのカスタマイズ !   パラメータグループ •  複数のキャッシュノードに一括適用可能なパラメータ群 •  キャッシュエンジンごとにデフォルト設定を用意。 !   カスタマイズ •  新たにパラメータグループを作成・編集し、キャッシュクラスタに適用 することでカスタマイズ可能 !   制約事項 •  一部パラメータは、変更不可 •  memcached: max_cache_memory, num_threads •  redis: maxmemory http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ CacheParameterGroups.html © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 24. ElastiCacheの料料⾦金金体系 !   キャッシュノード利用時間 ($/時間) •  オンデマンド、リザーブドの2種類の価格モデル !   ネットワーク •  ElastiCache 側では、データ転送課金は発生しません。 •  ElastiCacheと通信するEC2側で発生します •  同一 AZの EC2インスタンスとのデータ転送 : 無料 •  異なるAZのEC2インスタンスとのデータ転送 : $0.01/GB 東京リージョン $0.01/GB Availability Zone - a $0 App Availability Zone - b http://aws.amazon.com/jp/elasticache/pricing/ © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 25. 2つの価格モデル !   オンデマンド キャッシュノード •  EC2と同様の、初期費用無し、時間単位の従量課金モデル !   リザーブド キャッシュノード •  予約金を支払うことで時間当たり価格を割引(最大70%節減) •  memcached, redis共に対応 •  購入時に以下を指定 •  キャッシュノードクラス (例 cache.m1.xlarge) •  キャッシュエンジン ( memcached or redis) •  利用率(軽度、中度、重度) •  リージョン (注: アベイラビリティゾーンの指定は不要) •  期間(1年 or 3年) http://aws.amazon.com/jp/elasticache/pricing/ http://aws.amazon.com/jp/elasticache/reserved-cache-nodes/ © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 26. Simple Monthly Calculator !   Webフォームで概算費用を試算できます §  http://calculator.s3.amazonaws.com/calc5.html?lng=ja_JP © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 27. AWS無料料試⽤用枠 !   AWSでは、無料試用枠を用意しています •  http://aws.amazon.com/jp/free/  !   ElastiCache も対応しています •  http://aws.amazon.com/jp/elasticache/free/ •  1年間、cache.t1.micro を 750時間/月 まで無料で利用可能です © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 28. アジェンダ ! ! ! ! ! !   メモリキャッシュとは   Amazon  ElastiCacheの概要   ElastiCache  for  Memcached   ElastiCache  for  Redis   ユースケース   まとめ 28 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 29. Memcachedとは !   インメモリ key-value ストアキャッシュサーバ §  2003年にDanga Interactiveが開発(BSDライセンス) §  ブログサービス「Live Journal」の負荷対策用に作られたもの §  多くのサイトで採用 (YouTube, Wikipedia, mixi, etc. ) !   特徴 §  KVSのデファクトスタンダードプロトコル •  Key-valueのシンプルなデータ構造 •  Telnetでも操作可能 §  主要機能のみのシンプルな機能 •  アクセス制御などのセキュリティ機能無し •  マスタノード、シャーディング、レプリケーションなどの機構無し •  データ削除は明示的、期限、LRUの3方式 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 30. Amazon  ElastiCache  for  memcached !   特徴 •  対応バージョン  1.4.5、1.4.14  (2013.10.30現在) •  memcached  プロトコル準拠 •  Cache  Clusterという論論理理グループに、Cache  Nodeを複数台起動 !   注意 •  複数のアベイラビリティゾーンにまたがった  Cache  Clusterは作れな い。ゾーン毎に  Cache  Clusterを⽤用意する CacheCluster A Availability Zone - a CacheCluster B Availability Zone - b 30 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 31. Auto Discovery for memcached !   従来のクライアント側の設定 •  Cache Clusterの全エンドポイントを接続先として設定する。 !   Auto Discoveryクライアント(Java, PHP) •  Cache ClusterのConfiguration Endpointを接続先として設定すると、全エンドポイントを自動 取得・設定し、接続する !   注意 •  Configuration Endpointは、Cache Clusterの ロードバランサー( Proxy) ではなく、 あくまでもメタデータを取得するEndpointとなる CacheCluster App 通常のクライアントライブラリ xxx.0001.apne1.cache.amazonaws.com App Auto Discovery クライアントライブラリ xxx.0002.apne1.cache.amazonaws.com Configuration Endpoint xxx.cfg.apne1.cache.amazonaws.com http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.html © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 32. CloudWatchによるmemcached の監視 !   監視項目 •  http://docs.aws.amazon.com/AmazonElastiCache/latest/ UserGuide/CacheMetrics.Memcached.html !   主に監視する項目 •  •  •  •  •  CPUUtilization (CPU使用率) Evictions ( キャッシュメモリ不足によるキャッシュアウト発生回数) SwapUsage CurrConnections http://docs.aws.amazon.com/AmazonElastiCache/latest/ UserGuide/CacheMetrics.WhichShouldIMonitor.html © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 33. アジェンダ ! ! ! ! ! !   メモリキャッシュとは   Amazon  ElastiCacheの概要   ElastiCache  for  Memcached   ElastiCache  for  Redis   ユースケース   まとめ 33 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 34. Redisとは? !   In-‐‑‒memory  Key-‐‑‒Value  Store !   ⾼高機能なデータ構造、データ操作 •  List,  Set,  Sorted  Set,  Hash !   永続化機構 •  Snapshot,  Append  only  File !   冗⻑⾧長化機構 •  Replication !   Pub/Sub機能 !   Lua  scripting http://redis.io/ 34 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 35. 高度なデータ構造 •  Key-‐‑‒ValueのValueに様々なデータ構造を利利⽤用可能 •  Valueに対し、⾼高レベルの操作が可能 35 http://redis.io/commands © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 36. 嬉しい機能 Pub/Sub •  チャンネル  /  パターン •  メッセージング subscribe deliver msg Client 1 Client 2 msg publishe subscribe Channels / Patterns 36 deliver Client 3 msg http://redis.io/topics/pubsub © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 37. ElastiCache for Redis !   特徴 •  •  •  •  対応バージョン: 2.6.13 (2013.10.30現在) Replication構成 も数クリックで構築可能 S3上のスナップショット(RDB)プリロード機能 Redisの特徴をほぼサポート •  Lua Scripting •  Pub/Sub •  Append Only File !   対応しない機能 •  CONFIG, SLAVEOFなど一部コマンドのみ無効 •  パスワード (アクセス制御はセキュリティグループにて実施) © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 38. リードレプリカ (Replication) !   以下の用途に利用可能 •  耐障害性向上(ただし、非同期レプリケーション) •  Read性能のスケーリング !   構成 •  Replication Group内に、マスター1台、レプリカ 最大5台 •  Replica of Replica は未対応 Replication Group CacheCluster CacheCluster Availability Zone - a CacheCluster Availability Zone - b http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Replication.html http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ManagingReplication.html © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 40. リードレプリカ昇格 リードレプリカをプライマリに昇格可能 昇格は数分が必要 •  ダウンが発⽣生するため、クライント側でエラーハンドリングは必要 •  アプリ修正不不要(プライマリのendpointが変わらない) ① ①  unlink ② SYNC ③ DNS  change © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 41. ノード障害時の挙動と影響 リードレプリカあり リードレプリカなし 障害 プライマリ障害 ノード障害 挙動 1.  キャッシュイベントをSNSで通 1.  キャッシュイベントをSNSで通 知を受取る 知を受取る 2.  再起動を試みる 2.  新しいノードを立ち上げ 3.  再起動失敗した場合手動FOが 3.  DNS切替 必要 4.  FO後プライマリDNS自動切替 影響 •  FO完了まで書込不可 •  FO中一定の時間(秒単位)RR 読込不可 キャッシュデータロスト 対策 •  SNS通知を設定する •  クライント/アプリでエラーハンド リング(retry, DBから取得など) •  SNS通知を設定する •  キャッシュ喪失時の対策も織り 込む http://aws.amazon.com/jp/elasticache/faqs/#rf7 http://aws.amazon.com/jp/elasticache/faqs/#rf8 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 42. Sentinel vs. ElastiCache(Redis) Redis  Sentinel •  Redis本家のHAソリューション Sentinel ElastiCache △ △ (自動昇格、endpoint 変更あり) (手動昇格、endpoint 変更なし) モニタリング 通知(アラート) フェールオーバー アプリ改修不要 管理不要 http://redis.io/topics/sentinel © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 43. RDBデータのプリロード !   既存のRedisからのデータ移行に •  既存のRedisで取得したRDBファイルをS3に保存 •  キャッシュノード起動時に S3上のRDBファイルを読み込み !   注意点 •  RDBファイルのバージョン互換性を確認 •  保存したS3に対して、ElastiCacheが参照可能なパーミッションが必要 •  キャッシュノードタイプがサポートするメモリサイズを超えるRDBは読み込み不可。 (起動時にエラーが発生) Redis EC2 RDB copy S3 ElastiCache for Redis http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ ManagingCacheClusters.html#ManagingCacheClusters.SeedingRedis © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 44. データのプリロード S3からスナップショットをプリロード •  プライマリノード起動時にS3パスを指定(例例:  mybacket/path/data.rdb) © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 45. プリロードの応用: バックアップ&リストア •  EC2上のRedisをslaveとして  マスタに接続可能 •  EC2上のRedis  slave側でRDBファイルをS3へバックアップしてお くことで、クラスタ起動時にS3からプリロード可能 slaveof Redis restore RDB copy EC2 S3 http://redis.io/topics/persistence http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ ManagingCacheClusters.html#ManagingCacheClusters.RedisSnapshots © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 46. Append-Only Files(AOF)について !   AOFとは •  受信した全コマンド(操作)をローカルストレージ上のAOFに追記 •  キャッシュノードreboot時にキャッシュデータの復元が可能 •  メンテナンス時のreboot時にデータを保持可能 !   デフォルトでは off •  パラメータグループで appendonly をyesに変更し有効化 •  cache.t1.microは未対応( appendonly=yesでも無視される) !   注意点 •  ノード障害によるノード入れ替えが発生した場合はAOFが喪失する •  データ保全のためには最低1台のリードレプリカ構成を推奨 http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/ CacheParameterGroups.Redis.html#CacheParameterGroups.Redis.AOF © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 47. CloudWatchによるRedis の監視 !   主に監視する項目 •  •  •  •  CPUUtilization (CPU使用率) Evictions ( キャッシュメモリ不足によるキャッシュアウト発生回数) CurrConnections Replica Lag ( レプリケーション遅延) !   CPU 使用率を監視する際の注意点 •  •  •  •  Redisは シングルスレッドなので、1コアで動作 cache.m1.xlarge(4コア)だと、 25% (100% / 4) が最大値となる Alert設定時には、上記点に注意する http://docs.aws.amazon.com/AmazonElastiCache/latest/ UserGuide/CacheMetrics.WhichShouldIMonitor.html http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheMetrics.html  © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 48. アジェンダ ! ! ! ! ! !   メモリキャッシュとは   Amazon  ElastiCacheの概要   ElastiCache  for  Memcached   ElastiCache  for  Redis   ユースケース   まとめ 48 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 49. ユースケース !   memcached  ,  redis •  データキャッシュ •  セッションストア !   redis •  •  •  •  •  分散カウンター  (atomic  counter) リアルタイム・メトリック  (bitmaps) キュー  (lists) メッセージング  (pub/sub) リーダーボード,スコアランキング  (sorted  sets) 49 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 50. ブロードキャスト リアルタイム位置ゲーム (broadcast with Redis pub/sub) *Image from: https://geoloqi.com/blog/2011/09/building-a-real-time-location-based-urban-geofencing-game-with-socket-io-redisnode-js-and-sinatra-synchrony/ © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 51. メモリキャッシュを利利⽤用する際の注意点 !   システムの性質を考える •  •  •  •  一般的なWebシステムは、参照:更新≒9:1 更新クエリの割合が大きいシステムでは効果薄 キャッシュミス時のペナルティ対策(定期更新等) キャッシュ喪失時の対策も織り込む •  ログインし直し、DB負荷増、等への対策 !   キャッシュするデータの性質を考えてキャッシュする §  有効期限の短いデータは不向き §  参照頻度の低いデータは、メモリ効率が悪い !   トランザクション・コヒーレンシを考える §  一貫性が必要なデータは、慎重に設計・実装する §  DBより古いキャッシュを使わない工夫 51 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 52. キャッシュのクラスタ化について !   単一キャッシュノード構成の課題 •  障害時のデータ喪失による影響は少ない(はず) §  ただしDBが過負荷になり、システムスローダウンやダウンも §  キャッシュ容量増強のためにはスケールアップ(容易ではない) App RDBMS キャッシュ App © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 53. キャッシュのクラスタ化(Consistent Hashing) !   Consistent Hashingの特徴 •  §  §  §  Appサーバ側でConsistent Hashingアルゴリズムで振り分ける ノード障害時のキャッシュ喪失が限定的 ノード追加で総キャッシュ容量を増やしやすい ノード数変更時のリバランスコストが限定的 APPサーバ キャッシュ ライブラリ CHアルゴリズム ノードリスト キャッシュ © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 54. クラスタリングの方法 !   クライアントライブラリにて •  PHPなどで使うlibmemcachedは標準でdistribution アルゴリズム実装済み ! Twemproxy •  •  •  •  Twitter社が開発したMemcached/Redis⽤用のproxy 複数サーバーのシャーディング  (consistent  hashing) キャッシュサーバーの接続管理理 ⼀一部未サポートのコマンドもあり !   参考 §  Consistent hashing - Wikipedia, the free encyclopedia §  http://en.wikipedia.org/wiki/Consistent_hashing §  memcachedを知り尽くす:第4回 memcachedの分散アルゴリズム| gihyo.jp … 技術評論社 §  http://gihyo.jp/dev/feature/01/memcached/0004?page=3 §  Partitioning: how to split data among multiple Redis instances. §  http://redis.io/topics/partitioning © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 55. Twemproxyの構成例例 TwemproxyがSPOFとならないように、各アプリサーバ上 Twemproxyを起動し、アプリケーションはローカルホストの twemproxyにアクセスする Redis memcached App + Twemproxy App + Twemproxy App + Twemproxy RG1 App + Twemproxy RG2 55 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 56. アジェンダ ! ! ! ! ! !   メモリキャッシュとは   Amazon  ElastiCacheの概要   ElastiCache  for  Memcached   ElastiCache  for  Redis   ユースケース   まとめ 56 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 57. Amazon  ElastiCache  の利利点 !   構築・運⽤用が⾮非常に容易易 •  Management  Console  やAPIからクラスタの作成が可能 •  性能監視、⾃自動復復旧機能、⾼高可⽤用性機能、パッチ機能 •  レプリケーション(redis) !   セキュリティ •  セキュリティグループによるアクセス制御 •  VPC内部でも利利⽤用可能 57 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 58. 参考資料 !   Amazon ElastiCache 概要 •  http://aws.amazon.com/jp/elasticache/ !   料金 •  http://aws.amazon.com/jp/elasticache/pricing/ •  http://aws.amazon.com/jp/elasticache/reserved-cache-nodes/ !   FAQ •  http://aws.amazon.com/jp/elasticache/faqs/ !   ドキュメント •  http://aws.amazon.com/jp/documentation/elasticache/ !   Amazon ElastiCache フォーラム •  https://forums.aws.amazon.com/forum.jspa?forumID=127 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 59. APPENDIX © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 60. Appendix: Redis で制限されているコマンド !   以下のコマンドは実行不可(unknown command扱い) •  •  •  •  設定系 (config, slaveof) データ制御系 ( save, bgsave, bgrewriteof, migrate) プロセス制御系( shutdown) debug !   参考 •  http://redis.io/commands •  http://docs.aws.amazon.com/AmazonElastiCache/latest/ UserGuide/ClientConfig.html#ClientConfig.RestrictedCommands  © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 61. Appendix: Redis で変更不可パラメータ !   以下のパラメータは変更不可 •  •  •  •  •  activerehashing=Yes databases=16 lua-time-limit maxclients maxmemory ( maxmemory-policyは変更可能) !   参考 •  http://redis.io/topics/config •  http://docs.aws.amazon.com/AmazonElastiCache/latest/ UserGuide/CacheParameterGroups.Redis.html  © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 62. Appendix: Scale-up vs. Scale-out Scale-up Scale-out 性能アップ 運用しやすい 開発しやすい △ Library/proxyが必要 障害時影響が少ない △ RedisはFOで影響を抑える スケール △ ノード一台のメモリ上限(68GB)まで ノード追加でスケール © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 63. Appendix: メモリGB単価 m2シリーズは メモリ単価が安い メモリ単価 0.16 0.14 Case  Study •  4GBが必要なら •  m1.large •  32GBが必要なら •  m2.2xlarge  (scale-‐‑‒up) •  m2.xlarge  X  2  (Hybrid) •  m1.large  X  6  (scale-‐‑‒out) 0.12 0.1 0.08 0.06 $/h/GB 0.04 0.02 0 *Y軸:  1GBメモリの単価 *memcachedの  max_cache_memory を基準で計算 Redis も同じトレンド © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 64. Appendix: コストパフォーマンス m1.medium⼀一台を 1時間使った場合:$0.206 Cost  /  Performance のいいタイプ •  t1.micro •  m1.small •  m1.medium •  m1.large •  m2.xlarge Cost/Performance 1.2 1 0.8 0.6 0.4 0.2 相対CP 0 *Y軸:  m2.4xlargeのコストパフォーマンスを1とした場合の 相対値 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.