Backend: CRUD on Distributed System • CRUD on Distributed System • 寫的 code 變成跑在多台 server 上 • 不同 server 間彼此需要緊密溝通 • 需要考慮的事情變多 • Race condition • Unreliable connection
Resilliency: Unreliable connection • Be careful with Input & Output. • Retry: • What happened when requested service is temporarily unavailable? • Timeout: • What happened when requested service is unresponsive? • Rate limit: • In-bound: Restrict others from accessing service too frequently. • Out-bound: Restrict request frequency to other service.
Efficiency: System Design • Usage of Cache and Why ? • Memory access is faster than disk. • No need to do complex computation again. • Real world example: Human Brain • In-memory cache Problem • Cache stored in server S1 can't be accessed by server S2. • Try In-memory database • E.g. Redis