layers yelp s mission
play

Layers Yelps Mission Connecting people with great local - PowerPoint PPT Presentation

Layers Yelps Mission Connecting people with great local businesses. (Abstraction) Layers (related: separation of concerns) Abstractions? "Being abstract is something profoundly different from being vague The purpose of


  1. Layers

  2. Yelp’s Mission Connecting people with great local businesses.

  3. (Abstraction) Layers (related: separation of concerns)

  4. Abstractions? "Being abstract is something profoundly different from being vague … The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise." - Edsger Dijkstra All non-trivial abstractions, to some degree, are leaky. - Joel Spolsky Any problem in computer science can be solved with another layer of indirection. But that usually will create another problem - David Wheeler

  5. Danger: I don’t know as much as Rich Hickey

  6. Identify the Author’s Purpose A. Persuade the audience that his/her design recommendations are better than the current status quo B. Inform others about the history of architecture decisions in computer science C. Inspire engineers to think outside the box when designing systems D. Entertain the audience with historic anecdotes E. None of the above

  7. DevOps

  8. DevOps Est. 2009

  9. Let’s Talk About Devops PM Features Wireframes UX Lead Dev Tasks Devs Code / Unit Tests QA | Acceptance Tests QA Release Engineering Build + Release Operations Deployment | Monitoring | Alerting

  10. “What if we got rid of some of the layers?”

  11. ?

  12. Let’s Talk About PM Features Devops (no-ops?) Wireframes UX Tasks Code / Unit Tests Separation Of QA | Acceptance Tests Devs Concerns Build + Release Deployment | Monitoring | Alerting

  13. Why? ● Increased “Performance” (deploys per day) Better ownership of issues ● ● Harder to hire ● Massive increase in developer complexity ● Large inter-team communication overhead

  14. Filesystems

  15. Let’s talk about /mnt/stuff/foo files filesystems ext4 /mnt/stuff /dev/mapper/luks-17c8... dm-crypt /dev/mapper/lv0 LVM Software Raid /dev/md0 /dev/sd{a,b} Raw Block Devices

  16. “What if we got rid of some of the layers?”

  17. Let’s talk about zfs /mnt/stuff/foo files /mnt/stuff zfs Separation (zraid) (encryption) Of (checksums) Concerns (pools) (vdevs) /dev/sd{a,b} Raw Block Devices

  18. Now What? ● Better error detection/recovery We can deduplicate things ● ● More efficient snapshots / Repair ● All new tooling is not interoperable

  19. New Concept: “Sympathetic Abstraction” ● “Opposite” of “Leaky”? https://mechanical-sympathy.blogspot.com/ ●

  20. ~ $ ssh -vv leb1.xkyle.com -- true OpenSSH_7.7p1 Ubuntu-4ubuntu0.1, OpenSSL 1.0.2n 7 Dec 2017 debug1: Reading configuration data /home/kyle/.ssh/config debug1: /home/kyle/.ssh/config line 1: Applying options for leb1.xkyle.com debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: resolving "leb1.xkyle.com" port 4242 debug2: ssh_connect_direct: needpriv 0 debug1: Connecting to leb1.xkyle.com [2607:8b00:0:96::d0eb:ec0a] port 4242. ... debug1: Entering interactive session. debug1: pledge: network debug2: channel_input_open_confirmation: channel 0: callback start debug2: fd 3 setting TCP_NODELAY debug2: client_session2_setup: id 0 debug1: Sending environment. debug1: Sending env LANG = en_US.UTF-8 debug2: channel 0: request env confirm 0 debug1: Sending command: true ... Transferred: sent 2696, received 2516 bytes, in 0.1 seconds Bytes per second: sent 23959.5, received 22359.8 debug1: Exit status 0

  21. https://docs.datastax.com/en/cassandra/3.0/cassandra/configuration/configCassandra_yaml.html?hl=commitlog_sync commit_failure_policy (Default: stop ) Policy for commit disk failures: ● die ● Shut down gossip and Thrift and kill the JVM, so the node can be replaced. ● stop ● Shut down gossip and Thrift, leaving the node effectively dead, available for inspection using JMX. ● stop_commit ● Shut down the commit log, letting writes collect but continuing to service reads (as in pre-2.0.5 Cassandra). ● ignore ● Ignore fatal errors and let the batches fail. disk_optimization_strategy (Default: ssd ) The strategy for optimizing disk reads. Possible values: ssd or spinning . disk_failure_policy (Default: stop ) Sets how Cassandra responds to disk failure. Recommend settings: stop or best_effort . Valid values: ● die ● Shut down gossip and Thrift and kill the JVM for any file system errors or single SSTable errors, so the node can be replaced. ● stop_paranoid

  22. Kyle’s Abstraction Law: “Over time, layers tend toward becoming more sympathetic (or merged) in the pursuit of performance.”

  23. HTTP(S)

  24. OSI Layer Model History ● Published in 1984 under ISO7498 (35 years ago) Mostly by Charles Bachman from his experience with ARPANET, etc ● ● Written with the purpose of giving protocol designers a Map to follow

  25. HTTPS in HTTP (Hypertext Transfer Protocol) Layer 7: Application the OSI SSL Layer 6: Presentation Network Model Layer 5: Session N/A (Right? HTTP is “stateless”) TCP (Transmission Control Protocol) Layer 4: Transport IP (Internet Protocol) Layer 3: Network Layer 2: Data link 802.11 (Wi-Fi?) 802.11 (Wi-Fi?) Layer 1: Physical

  26. https://en.wikipedia.org/wiki/Internet_protocol_suite#Comparison_of_TCP/IP_and_OSI_layering The IETF protocol development effort is not concerned with strict layering . Some of its protocols may not fit cleanly into the OSI model, although RFCs sometimes refer to it and often use the old OSI layer numbers. The IETF has repeatedly stated that Internet protocol and architecture development is not intended to be OSI-compliant . RFC 3439, addressing Internet architecture, contains a section entitled: " Layering Considered Harmful ".

  27. RFC 1122, Cisco Kurose,[29] Comer,[31] Stallings[33] Arpanet Reference OSI model Internet STD 3 Academy[28] Forouzan[30] Kozierok[32] Model (RFC 871) (1989) Four layers Four layers Five layers Four+one layers Five layers Three layers Seven layers "Internet model" "Internet model" "Five-layer Internet "TCP/IP 5-layer "TCP/IP model" "Arpanet reference OSI model model" or "TCP/IP reference model" model" protocol suite" Application Application Application Application Application Application/Process Application Presentation Session Transport Transport Transport Transport Host-to-host or Host-to-host Transport transport Internet Internetwork Network Internet Internet Network Link Network interface Data link Data link (Network Network access Network interface Data link interface) Physical (Hardware) Physical Physical

  28. HTTP in HTTP (Hypertext Transfer Protocol) Layer 7: Application the OSI SSL Layer 6: Presentation Network Model Layer 5: Session N/A (Right? HTTP is “stateless”) TCP (Transmission Control Protocol) Layer 4: Transport IP (Internet Protocol) Layer 3: Network Layer 2: Data link 802.11 (Wi-Fi?) 802.11 (Wi-Fi?) Layer 1: Physical

  29. “What if we got rid of some of the layers?”

  30. QUIC in Application Layer (OSI 5,6,7) the IP Separation QUIC Encryption Of (Quick UDP Internet Connections) Sessions Model Concerns Multiplexing Error Correction UDP (User Datagram Protocol) Transport Layer (OSI 4) IP (Internet Protocol) Internet Layer (OSI 3) Link Layer (OSI 1,2) 802.11 (Wi-Fi)

  31. Now What? ● Roaming sessions 0-RRT Handshakes ● ● Better throughput ● Better loss recovery ● You can’t debug via tcpdump anymore! Only a few companies has dared to ship this! ● ● Very poor tooling / ecosystems around it! ● Must have faith in QUIC-crypto!

  32. (Micro) Services

  33. Users Rails App Controller Model View Mysql

  34. “What if we ADDED some more layers?”

  35. Users API Gateway Users Timeline Ads Tweets Search Moments Followers Service Ads Search User Mysql Infra Graph Mysql Moments DB Tweets SQL NoSQL

  36. Now What? ● No more atomic cross-cutting changes Simplified deploy process? (Simple for who?) ● ● Polyglot stack (easy to hire for) ● No more unified tooling ● You scale out components (scale to millions of rps) You scale out development (1000 engineers) ●

  37. k8s

  38. Traditional Cloud Deployment Java Jar Layer 3: Application Code Ubuntu x86_64 Layer 2: OS Layer 1: IaaS VM c5.xlarge N/A Layer 0: IaaS Provider Bare Metal

  39. “What if we ADDED EVEN MORE layers?”

  40. Layers of a k8s Infra java -jar Layer 6: Process docker Layer 5: Container Layer 4: Pod pod-foo kublet Layer 3: Container Orchestration Ubuntu x86_64 Layer 2: OS Layer 1: IaaS VM c5.xlarge N/A Layer 0: IaaS Provider Bare Metal

  41. K8s Layers Prod k8s federation Layer 5: k8s federation Layer 4: k8s cluster uswest1-prod Frontend replicaset Layer 3: Deployment / ReplicaSet myapp-pod Layer 2: Pod Layer 1: Docker Container FROM apache2 httpd Layer 0: Process

  42. “What if we got rid of some of the layers?”

  43. AWS Metal Instances

  44. Future Layers Hardware Layer 0/1: IaaS Provider Bare Metal

Recommend


More recommend