Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Software_Architecture_Patterns_for_Scale.pdf

 Software_Architecture_Patterns_for_Scale.pdf

Igbanam

March 04, 2018
Tweet

More Decks by Igbanam

Other Decks in Programming

Transcript

  1. Scaling Twitter Good • MVP to “Success” really fast •

    Rails prototyping power Bad • One tool mindset • Y-axis Scaling Lessons • Scale apps with people • Sometimes overhaul is good
  2. Scaling Shopify Good • Optimization • Sharding Bad • Originally

    did not understand the market — ”Flash Sales” Lessons • When scaling, do one thing at a time.
  3. Scaling IASD Good • Performance Benchmarking Bad • Windows Home

    Server • Government Project Lessons • Measure your performance • Layer your deployment
  4. Scaling Why is it hard? Reasons • Amdahl’s Law vs

    Moore’s Law • Business Constraints • Resource Constraints • Developer KPIs
  5. What is Software Architecture? The software architecture of a program

    or computing system is the structure or structures of the system, which comprise software elements, the externally visible properties of those elements, and the relationships among them. Architecture is concerned with the public side of interfaces; private details of elements—details having to do solely with internal implementation—are not architectural. ~ Wikipedia
  6. What is Software Architecture? In OOP, your class is the

    blueprint for an object at runtime. Similar to the architecture of your solution, it is the blueprint of your solution during its lifetime. One should be able to look at your architecture and immediately see the system built, the same way your classes should be self-explanatory. ~ @igbanam
  7. Layered Architecture USES • Model - View - Controller •

    Web Applications • Operating Systems Pros • Separation of concerns Cons • One tool fixes all • Often misused
  8. Client-Server USES • Web [App] Development • Network Topologies •

    Resource Sharing Pros • Simple Cons • Multiple bottlenecks
  9. Event–Driven Park the bus! • Channels on a “bus” •

    Publish - Subscribe • “Fire and Forget”
  10. Event Driven USES • Messaging Systems • Notifiers Pros •

    Resilient Cons • Orchestration is difficult • New skill required
  11. Broker USES • Load Balancing • Expert Systems Pros •

    Orchestration • Transparency • Interoperability — Broker of Brokers or P2P Cons • Lower fault tolerance • Restricted efficiency • Potential security hazard
  12. Scaling your development team Any organization that designs a system

    will produce a design whose structure is a copy of the organization's communication structure. ~ Conway’s Law
  13. Scaling your development team • Agile Methods: XP, DSDM, Scrum,

    Scrumban, Kanban, Lean, … • Scrum of scrums • Ubiquitous Language
  14. Scrum PROS • Holds developers accountable • Ceremonies which do

    health check on teams • Opens the development processes up to the business CONS • Ceremonies can become a bore — switch it up: Scrumban • The development team could become an assembly line
  15. Scaling your Application • Focus on the domain ◦ Focus

    on the “Domain” ◦ Bounded Contexts ▪ Islands (Independent Clusters) would begin to form in your models. • Code like an elite ◦ Structural Design Patterns ◦ Behavioural Design Patterns ◦ Creational Design Patterns ◦ SOLID, KISS, DRY • In Deployment ◦ More computing power — Moore’s Law vs. Amdahl’s Law [ | ] ◦ More computers — [ - ] ◦ More computes — [ \ ] Sharding. Breaking up similar things into inherent groups.
  16. Bounded Contexts 1. Focus on data and structure. 2. Print

    out the domain’s ERD. 3. Encircle similar entities. 4. Group these circles in code as modules (or folders) 5. [Optional] Define a facade for each module. 6. Transition module to service. 7. Scale. The Journey into Microservices
  17. Message Queues 1. Focus on communication. 2. Set up a

    message bus. In monolith, consider “observers” 3. Emit events for key actions 4. Subscribers should handle post-processing in parallel 5. Employ efficient brokers. 6. Scale underlying workers/subscribers. The Journey into Events
  18. Scaling Your Deployment • Multiple application servers • Multiple database

    servers • Broker Balancer Furthermore… • The application servers should be cached • The database access should serve as a cache.
  19. Conclusion • Try to see beyond the problem you’re trying

    to solve into the problem your solution creates; then solve that problem • The architect does not design for the codebase; that’s the job of the software designer. The architect designs the domain and her systems • Measure EVERYTHING!!! • Scale forward