Apply cache for beginner#1

21
Apply Cache For Beginner #1 [email protected]

description

 

Transcript of Apply cache for beginner#1

Page 1: Apply cache for beginner#1

Apply Cache For Beginner #1

[email protected]

Page 2: Apply cache for beginner#1

Key and Value

KEY

User_ID

Value Profile - LastLoginTime - UserName - ETC

Page 3: Apply cache for beginner#1

Key and Value 1. Check Cache Server -> Read Cache

2. Read DB -> Write Cache

Page 4: Apply cache for beginner#1

Key and Value – Easy to Read

1. Check Cache Server -> Read Cache

2. Read DB -> Write Cache

Page 5: Apply cache for beginner#1

Key and Value – Hard to Update

1. Update To DB

2. Update to Cache

Page 6: Apply cache for beginner#1

What is Hard?

Page 7: Apply cache for beginner#1

Key and Value – SYNC Easy

1. Update To DB

2. Fail To Transaction

Fail!!!

Page 8: Apply cache for beginner#1

Key and Value – SYNC HARD

1. Update To DB

2. Update to Cache Fail!!!

Page 9: Apply cache for beginner#1

Key and Value – How

1. Update To DB

2. Update to Cache Fail!!!

RETRY BATCH

Page 10: Apply cache for beginner#1

Data! The most important thing

Page 11: Apply cache for beginner#1

If data is not important

Cache Updating is not important

Login Count

Last Login Time

ETC

Page 12: Apply cache for beginner#1

BUT!

Page 13: Apply cache for beginner#1

If data is important

Cache Updating is important

Server Address

Data Path

ETC

Page 14: Apply cache for beginner#1

HOW!

Page 15: Apply cache for beginner#1

RETRY! Retry, Retry, Retry Solve Over 9x%.

Page 16: Apply cache for beginner#1

Batch! Queuing Service

Page 17: Apply cache for beginner#1

Error Log Queue

Error Log

Error Log

Error Log

Error Log

Batch Processor

Cache Server

Page 18: Apply cache for beginner#1

Error Log Queue

Error Log

Error Log

Error Log

Error Log

Batch Processor

Cache Server

Page 19: Apply cache for beginner#1

Error Log Queue

Error Log

Error Log

Error Log

Error Log

Batch Processor

Cache Server

UPDATE

Page 20: Apply cache for beginner#1

GEARMAN BEANSTALKD

Page 21: Apply cache for beginner#1

Thank you!