scalin ling s servic ices w it it h dis ist rib ibut ed
play

Scalin ling s servic ices w it it h Dis ist rib ibut ed In-Mem - PowerPoint PPT Presentation

Scalin ling s servic ices w it it h Dis ist rib ibut ed In-Mem em ory Ca Caches SATURN 201 8 | Plano, Texas Divya Nagar and Chirag Aggarw al 900K+ Drivers 10 0 M+ Mon th ly Ord e rs 261M+ P e op le Im p acte d - 18+ P rod u cts -


  1. Scalin ling s servic ices w it it h Dis ist rib ibut ed In-Mem em ory Ca Caches SATURN 201 8 | Plano, Texas Divya Nagar and Chirag Aggarw al

  2. 900K+ Drivers 10 0 M+ Mon th ly Ord e rs 261M+ P e op le Im p acte d

  3. - 18+ P rod u cts - 3M+ Ord e rs Daily - Exp on e n tial g row th sin ce first ap p lau n ch

  4. Slick User Experience Low Re sp on se Tim e s Hig h Availab ility

  5. - Hig h th rou g h p u t Car - Hig h Availab ility Bike

  6. Acce p tab le Con siste n cy Surge He at Map s

  7. Diffe re n t Re q u ire m e n ts Surge He at Map s

  8. - Em b e d d e d & In -Me m ory - Distrib u te d - Re p licate d - Horizon tally Scalab le

  9. Prat t l t t l e github.com /gojekfarm /prattle

  10. MEM EMBER ERSHIP CA CACH CHE RE REPLICA CATION

  11. 1 2 8 Mem bership 7 3 6 4 5

  12. 3 2 UDP Multicast 4 1 5 6

  13. 1 6 2 - Less Nodes - Less Congestion 5 3 4

  14. 1 2 9 3 Quadratic Increase in Netw ork 8 4 Congestion 7 5 6

  15. (1,2,3,5,6) 4 is dead 1 6 2 False Positives 6 is dead 5 3 (1,2,3,4,5) 4

  16. Reduce Netw ork Congestion 1 2 1 9 3 4 2 3 8 4 7 5 5 6 7 8 6

  17. SW IM IS A MEM EMBER ERSHIP PROT OTOC OCOL OL

  18. FAILURE DETECTION

  19. N1 N2 func (m *Member) Ping(nodeAddress net.Addr) error { pingRequest := NewPingRequest{ NodeAddress: nodeAddress, } ackChannel := make(chan ackMessage, 1) defer close(ackChannel) m.sendMessageUdp(&pingRequest, ackChannel) select { case ackMessage := <-ackChannel: logger.info(“ack message: + ackMessage) return nil case <-time.After(m.config.AckTimeout): return m.ProbeNode(nodeAddress) } }

  20. N1 N2 func (m *Member) Ping(nodeAddress net.Addr) error { pingRequest := NewPingRequest{ NodeAddress: nodeAddress, } ackChannel := make(chan ackMessage, 1) defer close(ackChannel) m.sendMessageUdp(&pingRequest, ackChannel) select { case ackMessage := <-ackChannel: logger.info(“ack message: + ackMessage) return nil case <-time.After(m.config.AckTimeout): return m.ProbeNode(nodeAddress) } }

  21. N1 N2 func (m *Member) Ping(nodeAddress net.Addr) error { pingRequest := NewPingRequest{NodeAddress: nodeAddress} ackChannel := make(chan ackMessage, 1) defer close(ackChannel) err := m.sendMessageUdp(nodeAddress.String(), &pingRequest, ackChannel) if err != nil { return err } select { case ackMessage := <-ackChannel: logger.info(“ack message:” + ackMessage) return nil case <-time.After(m.config.AckTimeout): return m.ProbeNode(nodeAddress) } }

  22. N1 N2 func (m *Member) Ping(nodeAddress net.Addr) error { pingRequest := NewPingRequest{NodeAddress: nodeAddress} ackChannel := make(chan ackMessage, 1) defer close(ackChannel) err := m.sendMessageUdp(nodeAddress.String(), &pingRequest, ackChannel) if err != nil { return err } select { case ackMes sage := <-ackChannel: logger.info(“ack message:” + ackMessage) return nil case <-time.After(m.config.AckTimeout): return m.ProbeNode(nodeAddress) } }

  23. N1 N2 N3 func (m *Member) ProbeNode(nodeAddress net.Addr) error { members := m.KRandomMembers() ackChannel := make(chan ackMessage, count(members)) for _, member := range members { pingRequest := NewPingRequest{NodeAddress: nodeAddress} member.sendMessageUdp(&pingRequest, ackChannel) } defer close(ackChannel) select { case ackMessage := <-ackChannel: logger.info(“ack message:” + ackMessage) return nil case <-time.After(m.config.AckTimeout): return errors.New(“timed out while probing”) } }

  24. N1 N2 N3 func (m *Member) ProbeNode(nodeAddress net.Addr) error { members := m.KRandomMembers() ackChannel := make(chan ackMessage, count(members)) for _, member := range members { pingRequest := NewPingRequest{ NodeAddress: nodeAddress, } member.sendMessageUdp(&pingRequest, ackChannel) } defer close(ackChannel) select { case ackMessage := <-ackChannel: logger.info(“ack message:” + ackMessage) return nil case <-time.After(m.config.AckTimeout): return errors.New(“timed out while probing”) } }

  25. N1 N2 N3 func (m *Member) ProbeNode(nodeAddress net.Addr) error { members := m.KRandomMembers() ackChannel := make(chan ackMessage, count(members)) for _, member := range members { pingRequest := NewPingRequest{ NodeAddress: nodeAddress, } member.sendMessageUdp(&pingRequest, ackChannel) } defer close(ackChannel) select { case ackMessage := <-ackChannel: logger.info(“ack message:” + ackMessage) return nil case <-time.After(m.config.AckTimeout): return errors.New(“timed out while probing”) } }

  26. N1 N2 N3 func (m *Member) ProbeNode(nodeAddress net.Addr) error { members := m.KRandomMembers() ackChannel := make(chan ackMessage, count(members)) for _, member := range members { pingRequest := NewPingRequest{ NodeAddress: nodeAddress, } member.sendMessageUdp(&pingRequest, ackChannel) } defer close(ackChannel) select { case ackMessage := <-ackChannel: logger.info(“ack message:” + ackMessage) return nil case <-time.After(m.config.AckTimeout): return errors.New(“timed out”) } }

  27. REPLIC ICATIO ION

  28. 1 Initial Im plem entation 4 2 3 w ith Prattle 5 6 7 8

  29. prattle := NewPrattle(siblingAddr string) prattle.SetViaGossip(key, value)

  30. Problem s w ith Gossip Based Re p lication - In fe ction Style Disse m in ation

  31. 3 2 UDP m ulticast 4 based 1 replication 5 6

  32. prattle := NewPrattle(siblingAddr string) prattle.SetViaMulticast(key, value)

  33. Thank you

Recommend


More recommend