Internet Scale Service [email protected]
About Me•KakaoStory Backend Engineer
•Redis Contributor
•Apache Tajo Committer
Internet Scale Service
High Scale Service
Mass Traffic
Huge Users
Many IDCs
BuildInternet Scale Service
Paperhttps://www.usenix.org/legacy/event/lisa07/tech/full_pape
rs/hamilton/hamilton_html/
Check Listhttps://gist.github.com/acolyer/95ef23
802803cb8b4eb5
What should be considered?
Your Service is Elastic?
ShardingShared Nothing
Shared Nothing
Stateless
StatelessLoad Balancer
Storage Layer
API Servers
API Servers
API Servers
API Servers
StatelessLoad Balancer
Storage Layer
API Servers
API Servers
API Servers
API Servers
Need Log Collector
Sharding
Database Partitioning
Vertical Partitioning
Horizontal Partitioning
Sharding = HorizontalPartitioning
But Not only DB
Searching Key
Range
User #1
User #10
User #1000000
User #1000001
User #1000100
User #2000000
User #2000001
User #2000200
User #3000000
User #1000005
Moduler
User #1
User #4
User #7
User #2
User #5
User #8
User #3
User #6
User #9
User #0
#0 / 3 = 0
IndexedUser #5000 Index Server
User #1
User #2000
User #1000000
User #2
User #2001
User #10000
User #3
User #6
User #5000
#5000 is in Server2
Searching Keywith
Coordinator
Clustering
Don’t need Search Key
HbaseCassandraMongoDB
etc
MatureBut
Not Mature
Cache Solution
Memcached/Redis
Memcached
ChunkSlab Algorithm
Redis
CollectionsReplication
Redis is Single Threaded
Redis
150,000 TPSIn commodity server
Redis
Must manage Redis Memory(RSS)
Redis
Don’t execute long-timeSpend Commands.
Cache is Storage
Server
Cache #1
Cache #2
Cache #3
Cache #4
Searching Key
Client Side Load Balancing
Server
Cache #1
Cache #2
Cache #3
Cache #4
Searching Key
Cache #1Cache #2Cache #3Cache #4
Coordinator
Server Side Load Balancing
proxy
Cache #1
Cache #2
Cache #3
Cache #4
Searching Key
Server
Circuit Breaker
How many API Calls?
If one call fails?
Fast FailBackand Background Check
Netflix Hystrix
Using Coordinator
ZookeeperConsulEtcd
Get ConfigurationFrom Coordinator
Servers ListFeature Flags
Failover
VIPDynamic DNS
VIP
Server
DB Master192.168.0.10
DB Slave192.168.0.11
VIP 192.168.0.12
VIP
Server
DB Master192.168.0.10
DB Slave192.168.0.11
VIP 192.168.0.12
Dynamic DNS
Server
DB Master192.168.0.10
DB Slave192.168.0.11
db1-master.a.com
Dynamic DNS
Server
DB Master192.168.0.10
DB Slave192.168.0.11
db1-master.a.com
Must Check Environments
For Dynamic DNS
JVM DNS Cache Issue
Latency #1
Latency #1
IDC 1 IDC 2
API Server DB ServerLatency 50ms
What Happen?
Latency #1
IDC 1 IDC 2
API Server DB Server
Select * from posts where id=123;
results
Select member from members where id=poster.group;
results
Latency #1
IDC 1 IDC 2
API ServerDB Server
getMembersList()
results
Logic Server
Latency #2
QnA
Thanks