George Willis
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
      • Create new note
      • Create a note from template
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Write
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Save as template
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # "Event Thinking" -- The Hollywood Principle |![Wolfman Jack 1977](https://i.imgur.com/7uIHXLo.jpg =190x) | <iframe width="150" height="99" src="https://www.youtube.com/embed/i4njPe2_rho" frameborder="0"></iframe><p><p>Wolfman Jack says:<p/><p/>"Don't call us.<br/> &nbsp; &nbsp; &nbsp; &nbsp; We'll call you." | | -- | -- | >###### tags: `streaming` `actor` `EDA` `OpenEMIT` > >[name=Author: George Willis] [time=Thu, Apr 19, 2018] --- ### What is the Hollywood Principle? An **"Inversion of Invocation" design pattern** (for those familiar with the IoC design pattern.) ::: info :trophy: Transform "<u>**Explicit Invocations**</u>" into "<u>**Implicit Invocations**</u>" ::: ### Explicit Invocation "The way you do it now." **Tightly coupled: The caller specifies the target** * coupling to `add()` is hardcoded in all cases below ``` result = add(1,2) // Procedural style result = (int 1).add(2) // OOP style add(resultCallback(),1,2) // Async style ``` ### Explicit Invocation -- Deep Call Stacks ![Recursive Call Stack](https://ptrthomas.files.wordpress.com/2006/06/jtrac-callstack1.png?w=630&zoom=2 =600x) ### Explicit Invocation -- "Pass Back" * Results must be routed back, not forward * Inherent in recursive **orchestration** models ![Results backward vs Results forward](https://www.ebayinc.com/assets/Uploads/Blog/2017/08/request-stack-trace.png) * Context held "open" * deep stacks => large context * RMI => contextual locks by other hosts * **But those hosts could fail? What about hung context? How is that handled?** * Timeout Exceptions (Identify) * Recover to previous workflow "state" and restart from waypoint (Remediate) :::danger ### :rotating_light: &nbsp; "Wait -- we don't program around state transitions any more than we invoke asynchronously! #### We need to rethink distributed state from the ground up! ::: ### Software Evolution * **Embarrasing industry trends** * Majority of POs state: * (temporal) quality goes down with each release * (capacity) quality goes down as system grows (scaling) * Many IT shops adopt a "fair of failure" mentality and "sunset" systems based on refactoring not requirements :::info :key:Technical debt of refactoring and extending is too high ::: ### Implicit Invocation ("We'll call you") ::: info **A foundational shift -- what Gartner calls "*Event Thinking***". </br> **Publish/Listen** -- a cousin to **Pub/Sub**</br> Think "Hooks" for <u>loose coupling</u> &nbsp; :fishing_pole_and_fish: ::: * #### Hook ![Hook](https://upload.wikimedia.org/wikipedia/commons/f/f9/Grappling_hook_%28PSF%29.png =60x30): I'll use {--- in homage to markdown :smile: ``` myEvent.publish(aTopic): {--- aTopic.aListener1 // Listeners can filter (optional) {--- aTopic.anActor2 // Ingest/Emit Contract Queue Workers {--- aTopic.aListener3.anActor3 // Filtered Actor ========================================================================================= dataCollectedEvent = [...] dataCollectedEvent.publish(Users.Create) // Emit trigger event // Users.Create:dataCollectedEvent Listeners {--- addCredentialsToLDAP // Ingest into Active Directory // Emit Users.Create.Credentials:savedEvent {--- addEmailToMailgun // Ingest into User Notification domain {--- addToDiscus // Ingest into Social Engagement domain // Users.Create.Credentials:savedEvent Listeners {--- sendConfirmationEmailToUser // Users.Create Multi-Event "Merge" Listeners {--- EndProcess(span=2s) // Upon completion of several parallel Actors/subflows, Emit User.Create:endFlowEvent ``` ### Value Proposition :::info **Evolutionary Architectural Style -- <u>Achieves loose-coupling of autonomous execution bundles</u>** (container runtimes) by moving coupling from "callers" (a.k.a. Commanders, Orchestrators) to <u>autonomous listeners</u> known as Actors (Choreography, flocks of birds). Each Actor hooks into an event stream. &nbsp; :fishing_pole_and_fish: * Extend via new hooks to existing events without impacting existing workflows -- just like in ETL * Solves coupling isues where other approaches like Service Registry (ESBs) and Service Discovery solutions: * move the issue to a mediation layer (reduces impact of change, but does not remove the need to reconfigure) * add additional machinery, complexity, latency and resource utilization to an otherwise lean microprocess * #### Solves coupling issues at the fundamental and foundational level -- invocation. ::: * **Naturally Async()** -- no "blocking" * Foundationally faster and more efficient * Results move forward -- not back * Think "incredibly fast bucket brigades" * **Naturally Efficient** -- deep, resursive call stacks of locked, distributed context (resources) replaced with atomic, ephemeral Actor Lifecycle context * **Naturally Resilient** -- in contrast, **Orchestration is a <u>Resilience Antipattern</u>**, due to: * critical dependency of all services/steps/transformations on one component * locked context on multiple machine of the distributed call stack when a call fails to return (syncronous) * incremental state backups not available for instant recovery (remediation) -- not part of the "style" * incremental monitoring not a fundamental capability, and parked on most DevOps Roadmaps (alarming) * **Naturally Visible** -- Day 1 Monitoring of each state change, filtered by topic(s), subtopic, Domain Entities. They are called "listeners", and they are built into the runtime as a foundational component. * **Naturally Scalable** -- "'cause concurrency ain't easy, so stop sharing forks" -- employ **<u>Parallel Processing</u>** instead. * Scaling workload is all about distributing workload, and if workers keep sharing workspace resources, the result is predictively **Contention@Scale**. * An autonomous (atomically isolation) multi-tasking environment is required. This is why **Container Multitenancy** is another **"Pillar of Digital Transformation"** :::info * **Naturally BPM Aligned:** Naturally Decomposes Business Processes/Steps into Topics/Events ::: # Event-Driven Architecture :::success :dart: **"Event-Driven Architecture is the optimal and natural solution to Recovery, Scaling and Velocity -- Event Thinking, the foundation of true Digital Transformation."</br> ~-George~ ~Willis~** *[Event-Driven Architecture]: An Evolutionary Architectural Style based on Event Sourcing and CQRS design patterns. More to come... *[Event Thinking]: Gartner's term for the foundational concepts around Event-Driven Architectures ::: :::info **Recovery Axiom:** ## Tracking **"state transition of processing" is required** to enable recovery from prior recorded state -- like nautical waypoints. * ### Recovery is a key <u>Resiliency/Availability</u> concept. * ### Failures on commodity devices are a statistical certainty. * ### Must achieve <u>HADR-as-a-Service</u>. ### :key: "<u>Embrace Failure</u>" by deploying innate recovery of prior state. ::: :rotating_light: If the last state saved is hours old, you lose hours of processing. #### :rocket: If saved state is millaseconds old, you recover instantly! :::info <i class="fa fa-edit fa-fw"></i> **Events are** fine-grained, immutable <u>**state transition ledger entries**</u> recorded in a **Distributed Log**. ::: *[Distributed Log]: Distributed logs like Kafka "linearly scale" on commodity hardware and in cloud VMs (Open IaaS). Blockchain (think BitCoin) adds immutability support to the ledger through encryption, opening up B2B EDA. ### Deep Dive into Event-Driven Microservices <iframe width="560" height="315" src="https://www.youtube.com/embed/IR1NLfaq7PU" frameborder="0"></iframe> ### Summary Comparison of Invocational Styles | Properties | Explicit Invocation| Implicit Invocation| Notes | | ---------- | -------- | -------- | ----- | | Complexity | High | Low | Events are simple | Evolution | Low | High | POs currently report quality issues over releases. | Scaling</br>Multi-tasking | Concurrency | Parallelism | The key to Scalabinf workload. | Microservices <p/><p/> Execution Coupling (Flow) | Centralized Orchestration[^Choreo] | Independent Choreography with Oversight | Flocks are choreographed, independent actors.<p><p>What if orchestrator goes down? More dependency. |BPM Alignment | Low </br> No clear model | High | |Resilience@Scale | Low | High | Today's systems do not solve "First things First" -- **Resilience@Scale**. <p/> <p/> Foundational problems of lean scaling, host isolation, host failure, network partitioning, snd others are not solved by the platform -- "out-of-the-box". | Visibility</br>Monitoring | Extra. Add Monitoring Traffic, Infrastructure, and Integration Code | Foundational</br>Listeners | | Process Efficiency | Distributed Call Stacks[^stack], Synchronous "blocking" by default, Return to Caller ("Pass Back") | Actor Context, Async by design, notify/emit ("Pass Forward") | | Process Integrity | Currently, Ingestion throttling involves discarding invocations to maintain Transactional rates | Ingestion throttling involves backpressure on upstream event publishers to preserve all invocations | | Network Efficiency | WET[^DRY]. Requires client caching to be DRY, and that's extra | DRY[^DRY] "Don't Repeat Yourself", Content-Centric Networking (CCN) | Events are communicated "once", while in CPU cache! | Theorhetical Background | REST Dissertation[^REST] | Promise Theory[^PT1], Configuration Management (CM)[^PT2], Smalltalk MVC | "Events" have been around as long as Ethernet! (Xerox PARC) [^DRY]: [Wikipedia: Don't Repeat Yourself (DRY Principle)](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself#DRY_vs_WET_solutions) [^Choreo]: [Youtube: "Who Needs Orchestration? What You Want is Choreography."](https://www.youtube.com/watch?v=kfF9IATUask) [^REST]: [2000 Roy Fielding: "Architectural Styles and the Design of Network-based Software Architectures"](https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm) [^PT1]: [Wikipedia: Promise Theory](https://en.wikipedia.org/wiki/Promise_theory) [^PT2]: [Mark Burgess: Promise Theory -- What is it?](https://www.linuxjournal.com/content/promise-theory%E2%80%94what-it) [^stack]: [Lightbend/Akka: "How the Actor Model Meets the Needs of Modern, Distributed Systems"](https://doc.akka.io/docs/akka/current/guide/actors-motivation.html#the-illusion-of-a-call-stack)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully