rethinking thinking models for event driven programming
play

RETHINKING THINKING MODELS FOR EVENT-DRIVEN PROGRAMMING @cdavisafc - PowerPoint PPT Presentation

CORNELIA DAVIS SR. DIRECTOR OF TECHNOLOGY PIVOTAL RETHINKING THINKING MODELS FOR EVENT-DRIVEN PROGRAMMING @cdavisafc function SumToN(n : INTEGER): INTEGER; var i : INTEGER; s : INTEGER; begin i := 0; s := 0; while (i <= n) do begin


  1. CORNELIA DAVIS SR. DIRECTOR OF TECHNOLOGY PIVOTAL RETHINKING THINKING MODELS FOR EVENT-DRIVEN PROGRAMMING @cdavisafc

  2. function SumToN(n : INTEGER): INTEGER; var i : INTEGER; s : INTEGER; begin i := 0; s := 0; while (i <= n) do begin s := s + i; i := i + 1; end; SumToN := s; end; @cdavisafc

  3. (define sumToN (lambda (n) (if (= n 1) 1 (+ n (sumToN (- n 1))) ))) @cdavisafc

  4. function SumToN(n : INTEGER): INTEGER; var i : INTEGER; VARIABLE s : INTEGER; begin i := 0; ASSIGNMENT s := 0; (SIDE EFFECT) while (i <= n) do begin START TO FINISH s := s + i; START TO FINISH ITERATION i := i + 1; end; SumToN := s; end; @cdavisafc

  5. CONDITIONAL (define sumToN BASE CASE (lambda (n) (if (= n 1) 1 (+ n (sumToN (- n 1))) ))) GENERAL CASE (INCLUDES A LEAP OF FAITH) @cdavisafc

  6. function SumToN(n : INTEGER): INTEGER; var i : INTEGER; s : INTEGER; begin RECURSION IS HARD!! i := 0; s := 0; while (i <= n) do begin s := s + i; i := i + 1; (define sumToN end; (lambda (n) SumToN := s; (if (= n 1) end; 1 (+ n (sumToN (- n 1))) ))) RECURSION IS NATURAL @cdavisafc

  7. WHAT ARE THE PRIMITIVES, PATTERNS AND PLATFORMS THAT WILL MAKE EVENT-DRIVEN PROGRAMMING EASY?

  8. FUNCTIONS AND EVENTS?

  9. MAYBE I HONESTLY HAVEN’T GOT A CLUE

  10. SERVICE THE “IMPERATIVE” MODEL? APP APP ▸ Cloud-Native App DATA (yup, the microservices) ▸ Cloud-Native Services SERVICE SERVICE (yup, some are apps SERVICE APP APP APP … and other are other types of services) ▸ Cloud-Native Data (a distributed data fabric) ? DATA DATA ▸ The Cloud-Native Collective (implicit and explicit connections) CLOUD-NATIVE SOFTWARE @cdavisafc

  11. http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html 11

  12. APP WE’VE BEEN THINKING CLIENT/SERVER FOR SO LONG CONFIG ▸ HA & Scaling SERVICES ▸ → Multiple Instances ▸ → Load Balancing SERVICE SERVICE ▸ → Externalize Config ROUTER SERVICE APP APP APP APP APP ▸ Resilience ▸ → Statelessness DATA ▸ → Retries ▸ → Circuit Breaker @cdavisafc

  13. SERVICE APP + … ▸ Autonomy and Agility SERVICE DISCOVERY ▸ → Versioning ▸ Dynamic Environment SERVICE SERVICE SERVICE ROUTER CLIENT APP ▸ → Service Discovery APP APP ▸ → Resource Bindings DATA @cdavisafc

  14. DATA SERVICE IN SERVICE TO “SERVICES” APP SERVICE ▸ Agility and Autonomy DATA APP ▸ → Services get their own DB ▸ → MDM? (eeh) SERVICE APP ▸ Resilience DATA ▸ → Caches ▸ → Cache miss ? DATA ▸ → Expiry @cdavisafc

  15. THE COLLECTIVE WE’VE BEEN THINKING CLIENT/SERVER FOR SO LONG ▸ Managability SERVICE APP SERVICE ▸ → Distributed Tracing APP SERVICE ▸ Act locally - who’s thinking globally? APP APP SERVICE APP SERVICE APP @cdavisafc

  16. DISTRIBUTED SYSTEMS CONCERNS ▸ HA & Scaling ▸ Dynamic Environment ▸ Resilience ▸ Autonomy and Agility ▸ Managability @cdavisafc

  17. RESILIENCE … TO PROMISES FROM RETRIES… CLIENT CLIENT RETRY PROMISE GENERAL CASE (INCLUDES A LEAP OF FAITH) SERVICE EVENT … ENSURING EVENTS ARE NOT LOST FROM CIRCUIT BREAKERS… @cdavisafc

  18. AUTONOMY … TO MATERIALIZED VIEWS FROM CACHE EXPIRY… SERVICE SERVICE EVENT CONSUMER GENERAL CASE VIEW CACHE (INCLUDES A LEAP OF FAITH) EXPIRY … ENSURING EVENTS ARE NOT LOST @cdavisafc

  19. RESILIENCE & SCALE … TO FUNCTIONS FROM SERVICES… FUNCTION LOAD BALANCING SERVICE FUNCTION FUNCTION A BIT LIKE THE STACK FRAME WITH EACH RECURSIVE CALL … TO FUNCTIONS FROM LOAD BALANCING… @cdavisafc

  20. SCALE … DATA PARTITIONING FROM DATA BOTTLENECK… SERVICE SERVICE SERVICE SERVICE SERVICE SERVICE DATA DATA DATA DATA … AND PARTITION RESOLVERS @cdavisafc

  21. AUTONOMY … EVENT SOURCING FROM SHARED DATABASES… SERVICE C SERVICE A SERVICE B SERVICE A SERVICE B SERVICE C VIEW VIEW VIEW DATA EVENT EVENT EVENT CONSUMER CONSUMER CONSUMER EVENT STORE @cdavisafc

  22. SERVICE C SERVICE A SERVICE B EVENT EVENT PRODUCER PRODUCER ALSO, EVENT PRODUCERS VIEW VIEW VIEW EVENT EVENT EVENT CONSUMER CONSUMER CONSUMER EVENT STORE @cdavisafc

  23. MANY QUESTIONS ▸ Programming the “Collective” ▸ Justifying the “leap of faith” ▸ … @cdavisafc

  24. CLOUD-NATIVE - IMPERATIVE MODEL ▸ Data ▸ Cloud-native Apps ▸ Scale out ▸ Breaking the Data monolith ▸ Statelessness ▸ Data APIs ▸ Externalize configuration ▸ Caching ▸ Implications from changes in the application lifecycle ▸ Polyglot Persistence ▸ Retries ▸ Event sourcing ▸ Services ▸ Versioned services (autonomy) ▸ Service Discovery ▸ Distributed tracing @cdavisafc

  25. CLOUD-NATIVE - EVENT-DRIVEN MODEL ▸ Promises ▸ Event Consumers ▸ Event Producers ▸ Distributed Data Fabric: Data Partitioning and Partition Resolvers ▸ Event Sourcing and Materialized Views ▸ Health check (are producers & consumers functioning?) @cdavisafc

  26. FROM QUORA: WHAT IS CALL/CC IN LAYMAN TERMS? Hard to explain in layman terms in just a sentence. I'll try to make it as layman as possible. Suppose you have a function f which takes one argument which is supposed to be a continuation. Then call/cc is a special function that takes f as an argument and calls f passing it, as its argument, the current continuation, which is the continuation in which call/cc itself was called

  27. THANK YOU

Recommend


More recommend