Más contenido relacionado La actualidad más candente (20) Similar a 높은 가용성과 성능 향상을 위한 ElastiCache 활용 팁 - 임근택, SendBird :: AWS Summit Seoul 2019 (20) Más de Amazon Web Services Korea (20) 높은 가용성과 성능 향상을 위한 ElastiCache 활용 팁 - 임근택, SendBird :: AWS Summit Seoul 2019 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ElastiCache
Software Engineer, SendBird
2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
•
• Infrastructure Engineer
•
3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SendBird
A market leader in chat and messaging API & SDK space.
A complete chat solution to provide premium messaging experiences to users of
online and mobile services.
Highly scalable
backend
infrastructure
Client-side SDK,
customizable UI
User-friendly Dashboard &
moderation tools
Messaging with Enterprise-grade security
COMPLIANT
Powering over 10,000 services worldwide
4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Key Milestones
Jan 2016
Dec 2017
$ 17 M Series A
Established Feb 2013
Pivots to SendBird, the B2B messaging
solution on Mar 2015
Serves customers in 150+ countries
Powers 10,000+ apps
Hosts 50M+ monthly chat users and
700M+ messages every month
Mar 2015
YC 2016W
Feb 2019
$ 52 M Series B
5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Our Mission
Premium messaging experience
for global products.
A fully managed chat platform for
B2B real-time messenger.
6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
• Redis @SendBird
• ElastiCache Scalability
• ElastiCache HA
• R5 & M5
7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis @SendBird
Software Engineer, SendBird
8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis @SendBird
Redis
• RDS
• Latency
• Rate limiting
9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis @SendBird
EC2 Redis
Redis
.
10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. check data in cache
3. if not in cache - Read
from RDS and save to
cache and return data
2. If in cache - return
data
Redis @SendBird
11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis @SendBird
Redis .
12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis @SendBird
• Redis
• DB CPU
• Latency
• Ratelimit
• ( )
13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis @SendBird
•
• EC2 system failure
• Out Of Memory
• Redis Snapshot
50%
14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Supports Redis
• High Performance
• Fully Managed; Zero admin
• High Available and Reliable
• Monitoring using CloudWatch
• Harden by Amazon
ElastiCache @SendBird
15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• RDS
• Latency
• Rate limiting
•
•
ElastiCache @SendBird
16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. check data in cache
3. if not in cache - Read
from RDS and save to
cache and return data
2. If in cache - return
data
ElastiCache @SendBird
17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ElastiCache Scalability
Software Engineer, SendBird
18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scalability
…
• ..
• ElastiCache …
• ElastiCache ..
19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
.
1. Read Replica
* Write workload .
2. Redis Cluster Mode
* Python .
Scalability
20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sharding
.
…
Scalability
21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Manually Sharding ElastiCache
1.Hash unique_key
based on number of
Shards
2. With hash key, route
to ElastiCache
1. Redis Hash table .
2. .
3. unique key
hash function .
4. Redis Node .
22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Super Node
•
•
• Reader Node
Scalability
…
23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Super Node Issue
Common Resource
…
EC2
Super Node Issue .
24. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use Embedded Cache
…
Common Resource
Common Resource
Common Resource
Application
Memory locally cache
.
25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ElastiCache HA
Software Engineer, SendBird
26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
HighAvailability
Redis Cluster
M
R
R
Reader#1 instance
Endpoint
Reader#2 instance
Endpoint
Master Primary Endpoint
Master AWS
Master Primary Endpoint
AWS HA
.
27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
HighAvailability
Redis Cluster
M
R
R
Reader#1 instance
Endpoint
Reader#2 instance
Endpoint
Master Primary Endpoint
Read Replica .
Instance endpoint Reader
Node Application
routing .
28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
HighAvailability
Redis Cluster
M
R
R
Reader#1 instance
Endpoint
Reader#2 instance
Endpoint
Master Primary Endpoint
Active Health Checker
Python Redis
health active
.
1.
2.
29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
HAProxy is a free, very fast and reliable solution
offering high availability, load balancing, and proxying for
TCP and HTTP-based applications.
HAPROXY opensource
..
1. Maintain .
2. Active health checking Node
3. .
Use HAPROXY
30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use HAPROXY
https://blog.sendbird.com/elasticache-for-python-production-payloads
31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
HighAvailability
Redis Cluster
M
R
R
Reader#1 instance
Endpoint
Reader#2 instance
Endpoint
Master Primary Endpoint
Active Health Checker
HAPROXY Instance
Node Application
.
32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use HAPROXY
Redis Cluster
M
R
R
HAproxy cluster
VS
HAPROXY
1. HAPROXY
2. Sidecar Pattern
33. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use HAPROXY (Side Car Pattern )
Redis Cluster
M
R
R
1.
* EC2, VPC
2. Single point of failure .
34. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Move to R5 & M5
Software Engineer, SendBird
35. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New instance ElastiCache M5 & R5
36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New instance type ElastiCache M5 & R5
New instance in 2018 R5 & M5
https://aws.amazon.com/blogs/compute/amazon-elasticache-performance-boost-
with-amazon-ec2-m5-and-r5-instances/
37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
We are hiring!