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

Service Oriented Architecture - Learn from the ...

Service Oriented Architecture - Learn from the drug cartels

Do you want your app to allow scalability, failure resistance and fierce durability? learn how the real life service oriented organization did it successfully for years.

Elad Meidar

June 20, 2013
Tweet

Other Decks in Programming

Transcript

  1. Service Oriented Architecture • Discrete modules • "Islands of responsibility"

    • Consumer and Producer services • Unassociated, autonomous, Loosely coupled units.
  2. The Drug Cartel • Discrete modules • "Islands of responsibility"

    • Consumer and Producer services • Unassociated, autonomous, Loosely coupled units.
  3. The Medellín Cartel • The first cartel to use a

    "distributed" method of operations. • At peak, covered more than 30% of the entire Colombian national export. • Yes. Cocaine.
  4. The Service Oriented Drug Cartel • Each isolated unit had

    a specific role: ◦ Falcons (Halcons) ◦ Assassins (Sicarios) ◦ Lieutenants (Lugartenientes) ◦ Drug Lords (Capos) ◦ Overlords (Kingpins)
  5. Falcons - Messengers and Monitors • Considered the "eyes and

    ears" of the streets. • They carry messages between the other units. • Simple and and clear role in the system, an easily replaced and scalable unit.
  6. Assassins - pinpoint actions The armed group within the drug

    cartel that are responsible for carrying out assassinations, kidnappings, thefts, extortions and operating protections.
  7. Lieutenants - Territory Managers Responsible for supervising the assassins and

    falcons within their own territory. They are allowed to carry out low-profile executions without permission from their bosses.
  8. Drug Lords - Operations Managers Territory overlords, control the entire

    operation of a specific organization interest and a sizeable amount of people. responsible on all the procedures and activities within their territory.
  9. Kingpins Kings are the source of everything. They determine what

    and who goes where and how. Usually there are several kingpins to assure continuity in case of early departure.
  10. • Messaging Systems ◦ Apollo ◦ RabbitMQ • Monitoring Tools

    ◦ Collectd ◦ NewRelic ◦ Organization Specific dashboards SOA's Falcons: Messaging and Monitoring
  11. • Specific action driven workers • Wait on a specific

    message queue and process the request gracefully (Not so much in the case of real assassins). SOA's Assassins: Queue Workers
  12. • Specific service back end stacks with a designated role

    and responsibility in the application flow. SOA's Lieutenants: Logical Business Units
  13. • Front end layers that serve a complete response based

    on the results of a number of internal operations. SOA's Drug Lords
  14. Partitioning Guidelines • Iteration Speed • Logical Function • R/W

    Frequency • Join Frequency and the evil brother: • Data Replication
  15. Iteration Speed Extracting services from a monolithic application as they

    become mature and stable enough. Probably the easiest partitioning method, but it can become complicated when your grasp the big picture as more and more parts of the system become "service-ready".
  16. Logical Functionality Extract each logical element of your system into

    a specific service. • Pretty easy to identify logical domains and encapsulated operations. • Orchestration is a PITA. • Probably more costly than others
  17. Read/Write Frequency Partitioning based on Read/Write frequency of services. Some

    services are made more simple than others based on need for caching or fast data layer. Defining the data access approach can lead to easier implementation of services (ex: you don't have to bother to expire frequently refreshing cache)
  18. Join Frequency This method is about joining a few services

    that repeatedly talk to each other and by that to save expensive time doing expensive joins.
  19. Data Replication is not EVIL! Data replication, made carefully, allows

    the application services to skip expensive joins for so called meta data - but makes the process of keeping data integrity complicated.
  20. The Cartel - Partitioning example • By Iteration - The

    more the cartel grows, new pandillas are created. • Logical functionality - The members knows what they need to do. • Join Frequency - Top ranked members always have a Falcon nearby.