Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Amazon ElastiCache (Dan Zamansky) - AWS DB Day

1,502 views

Published on

2016년 4월 27일 DB Day 에서 Dan Zamansky 시니어 PM 께서 발표하신 “Amazons ElistiCache “ 발표자료입니다.

Published in: Technology
  • Be the first to comment

Amazon ElastiCache (Dan Zamansky) - AWS DB Day

  1. 1. Amazon ElastiCache AWSIn-Memory DataStore Dan Zamansky Senior Product Manager Time : 11:30 – 12:00
  2. 2. Amazon ElastiCache AGENDA • Why In-Memory? • ElastiCache • Understanding Key Features • Redis - Common Use Cases
  3. 3. Why In-Memory?
  4. 4. Modern Applications Require Real-Time Performance • We live in a connected world (IoT) • Phones, Tablets, Cars, Air Conditioners, Toasters • Experiences are increasingly contextual • Apps need to provide real-time responses • Database performance is frequently the bottleneck • Load is spikey and unpredictable
  5. 5. Businesses Need To Be Ready For Success!
  6. 6. What is ElastiCache?
  7. 7. Amazon RDS Amazon DynamoDB Amazon Redshift Amazon ElastiCache Compute Storage AWS Global Infrastructure Database Application Services Deployment & Administration Networking AWS Database Services High Performance In-Memory Key- Value Store in the Cloud
  8. 8. In-Memory Key-Value Store High-performance Redis and Memcached Fully managed; Zero admin Hardened by Amazon Amazon ElastiCache
  9. 9. Fully managed service = Automated Operations Redis/Memcached Datastore hosted on Amazon EC2 Amazon ElastiCache
  10. 10. Amazon RDS Request Rate High Low Cost/GB High Low Latency Low High Data Volume Low High Amazon Glacier Amazon CloudSearch Structure Low High Amazon DynamoDB Amazon ElastiCache
  11. 11. Memcached Slab allocator In-memory key-value datastore very popular as a caching solution Supports strings, objects Multi-threaded Insanely fast! Very established No persistence Patterns for sharding
  12. 12. Redis – the in-memory king Powerful ~200 commands In-memory key-value datastore Supports data types strings, lists, hashes, sets, sorted sets, bitmaps & HyperLogLogs Single-threaded Atomic operations supports transactions has ACID properties Ridiculously fast! <1ms latency for most commands Read replicas Persistence snapshots or append-only log Pub/sub functionality
  13. 13. Amazon ElastiCache Redis Multi-AZ Easy Monitoring via CloudWatch Fully Managed Enhanced Redis Engine Easy to Deploy & Use ElastiCache vs. Self-Managed Redis No Cross-AZ Data Transfer Costs Engineered For Cloud Scale
  14. 14. Amazon ElastiCache Enhanced Redis Engine – Hardened by Amazon RDB Without Fork • Mitigate the risk of increased swap usage during syncs and snapshots. Dynamic write throttling • To improve output buffer management when the node’s memory is close to being exhausted Smoother failovers • Clusters recover faster as replicas will avoid flushing their data to do a full re-sync with the primary.
  15. 15. Mitigating Swap During Redis Fork
  16. 16. Primary Availability Zone A Availability Zone B Replica Replica writes Use Primary Endpoint reads Use Read Replicas Auto-Failover  Chooses replica with lowest replication lag  DNS endpoint is same ElastiCache for Redis Multi-AZ ElastiCache for Redis ElastiCache for Redis ElastiCache for Redis Automatic Failover to a read replica in case of primary node failure ElastiCache Automates snapshots for persistence
  17. 17. ElastiCache with Redis Multi-AZ Region Availability Zone A Availability Zone B Auto Scaling group ElastiCache cluster
  18. 18. ElastiCache with Redis Multi-AZ Region Availability Zone A Availability Zone B Auto Scaling group ElastiCache cluster
  19. 19. ElastiCache with Redis Multi-AZ Region Availability Zone A Availability Zone B Auto Scaling group ElastiCache cluster
  20. 20. ElastiCache with Redis Multi-AZ Region Availability Zone A Availability Zone B Auto Scaling group ElastiCache cluster
  21. 21. Mitigating Replica Flushing – Enhanced Engine Master Replicas
  22. 22. Alarms Monitoring with CloudWatch • Easily Accessible via the ElastiCache console • Track health of your nodes • Set alarms to act when need to address running into limitations
  23. 23. What apps can ElastiCache power?
  24. 24. We Run The Most Demanding Real-Time Workloads Thousands of Customers Implementing Large Scale Caching, Leaderboards, Session Management, Messaging, Queuing and more Gaming AdTech Media Mobile Other
  25. 25. Let’s Talk Redis. Key Use Cases
  26. 26. Use Case #1 - Caching Elastic Load Balancing EC2 App Instances RDS MySQL DB Instance ElastiCache Database Writes App Reads Clients Cache Updates Database Reads
  27. 27. Amazon ElastiCache Eliminate database hotspots Predictable Performance Cut Load on Backend Increase Read Throughput Reduce App Latency Caching Will Make Your Database More Efficient Reduce Database Cost
  28. 28. Adding Caching to Your Application is Easy Common Caching Technique #1 – Lazy Caching:
  29. 29. IGA Works Uses ElastiCache to Power Real-Time App Monetization By using RDS we saved on operations cost for our relational databases. Using ElastiCache we could boost the read performance of RDS and offload the massive request rate Jeongsang Baek VP Engineering, IGA Works ” “ • IGA Works is Korea’s leading mobile business platform • Adpopcorn is an ad monetization platform for mobile applications that supports 130 million devices • Storing Ad Inventory in ElastiCache in front of RDS guaranteed real- time ad bidding and serving, while RDS provides the durable database layer
  30. 30. Expedia’s Real-time Analytics Application Uses Amazon ElastiCache Expedia is a leader in the $1 trillion travel industry, with an extensive portfolio that includes some of the world’s most trusted travel brands. With ElastiCache Redis as caching layer, the write throughput on DynamoDB has been set to 3500, down from 35000, reducing the cost by 6x. Kuldeep Chowhan Engineering Manager, Expedia ” “ • Expedia’s real-time analytics application collects data for its “test & learn” experiments on Expedia sites. • The analytics application processes ~200 million messages daily. • Re:invent talk: https://www.youtube.com/watch?v=ie4dWGT76LM
  31. 31. Not if I destroy it first! It’s mine! • Very popular for gaming apps • Need uniqueness + ordering • Easy with Redis Sorted Sets ZADD "leaderboard" 1201 "Gollum” ZADD "leaderboard" 963 "Sauron" ZADD "leaderboard" 1092 "Bilbo" ZADD "leaderboard" 1383 "Frodo” ZREVRANGE "leaderboard" 0 -1 1) "Frodo" 2) "Gollum" 3) "Bilbo" 4) "Sauron” ZREVRANK "leaderboard" "Sauron" (integer) 3 Use Case 2 - Real-time Leaderboard
  32. 32. TV Globo (Media) • Rede Globo is the second largest TV network in the world. • TV Globo used ElastiCache Redis for second screen application during the World Cup in Brazil in 2014. • ElastiCache was used for caching and leaderboards. • Massive spikes in usage during games and peak events.
  33. 33. Use Case 3 - Chat and Messaging • PUBLISH and SUBSCRIBE Redis commands • Game or Mobile chat, real-time comment streams • Server intercommunication SUBSCRIBE chat_channel:114 PUBLISH chat_channel:114 "Hello all" >> ["message", "chat_channel:114", "Hello all"] UNSUBSCRIBE chat_channel:114
  34. 34. • Popular for recommendation engines and message board ranking • Redis counters – increment likes/dislikes • Redis hashes – list of everyone’s ratings • Process with algorithm like Slope One or Jaccardian similarity • Ruby example - https://github.com/davidcelis/recommendable Use Case 4 – Ratings INCR item:38927:likes HSET item:38927:ratings "Susan" 1 INCR item:38927:dislikes HSET item:38927:ratings "Tommy" -1
  35. 35. • Ex: Throttling requests to an API • Leverages Redis Counters ELB Externally Facing A PI Reference: http://redis.io/commands/INCR FUNCTION LIMIT_API_CALL(APIaccesskey) limit = HGET(APIaccesskey, “limit”) time = CURRENT_UNIX_TIME() keyname = APIaccesskey + ":” + time count = GET(keyname) IF current != NULL && count > limit THEN ERROR ”API request limit exceeded" ELSE MULTI INCR(keyname) EXPIRE(keyname,10) EXEC PERFORM_API_CALL() END Use Case 5 - Rate Limiting
  36. 36. • Redis is a powerful in-memory data structure server that allows you to easily build high performance apps • ElastiCache provides the hardened, secure, highly-available, and performant platform to run in-memory data stores in the cloud Recap
  37. 37. Thank You

×