{
  "code": null,
  "collection": "architecture",
  "href": "https://banes-lab.com/ontology#architecture-publish-subscribe-pattern",
  "id": "publish-subscribe-pattern",
  "kind": "pattern",
  "layer": {
    "href": "https://banes-lab.com/ontology/schema#layer-execution-core",
    "json": "https://banes-lab.com/json/records/layer/execution-core",
    "label": "Execution Core",
    "markdown": "https://banes-lab.com/records/layer/execution-core.md",
    "ref": "layer:execution-core"
  },
  "name": "Publish/Subscribe Pattern",
  "ref": "architecture:publish-subscribe-pattern",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-publisher",
          "json": "https://banes-lab.com/json/records/lexicon/publisher",
          "label": "Publisher",
          "markdown": "https://banes-lab.com/records/lexicon/publisher.md",
          "ref": "lexicon:publisher"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-subscriber",
          "json": "https://banes-lab.com/json/records/lexicon/subscriber",
          "label": "Subscriber",
          "markdown": "https://banes-lab.com/records/lexicon/subscriber.md",
          "ref": "lexicon:subscriber"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-broker-event-bus",
          "json": "https://banes-lab.com/json/records/lexicon/broker-event-bus",
          "label": "Broker/Event Bus",
          "markdown": "https://banes-lab.com/records/lexicon/broker-event-bus.md",
          "ref": "lexicon:broker-event-bus"
        }
      ],
      "relation": "requires"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-low-coupling",
          "json": "https://banes-lab.com/json/records/architecture/low-coupling",
          "label": "Low Coupling",
          "markdown": "https://banes-lab.com/records/architecture/low-coupling.md",
          "ref": "architecture:low-coupling"
        }
      ],
      "relation": "reinforces"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-fan-out-notification",
          "json": "https://banes-lab.com/json/records/lexicon/fan-out-notification",
          "label": "Fan-Out Notification",
          "markdown": "https://banes-lab.com/records/lexicon/fan-out-notification.md",
          "ref": "lexicon:fan-out-notification"
        }
      ],
      "relation": "enables"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-direct-point-to-point-calls",
          "json": "https://banes-lab.com/json/records/lexicon/direct-point-to-point-calls",
          "label": "Direct Point-to-Point Calls",
          "markdown": "https://banes-lab.com/records/lexicon/direct-point-to-point-calls.md",
          "ref": "lexicon:direct-point-to-point-calls"
        }
      ],
      "relation": "conflicts-with"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-delivery-ordering",
          "json": "https://banes-lab.com/json/records/lexicon/delivery-ordering",
          "label": "Delivery Ordering",
          "markdown": "https://banes-lab.com/records/lexicon/delivery-ordering.md",
          "ref": "lexicon:delivery-ordering"
        }
      ],
      "relation": "tensions-with"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/schema#tension-delivery-ordering-publish-subscribe-pattern",
          "json": "https://banes-lab.com/json/records/tension/delivery-ordering-publish-subscribe-pattern",
          "label": "Publish/Subscribe Pattern / Delivery Ordering",
          "markdown": "https://banes-lab.com/records/tension/delivery-ordering-publish-subscribe-pattern.md",
          "ref": "tension:delivery-ordering-publish-subscribe-pattern"
        }
      ],
      "relation": "tensions"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-point-to-point-coupling",
          "json": "https://banes-lab.com/json/records/lexicon/point-to-point-coupling",
          "label": "Point-to-Point Coupling",
          "markdown": "https://banes-lab.com/records/lexicon/point-to-point-coupling.md",
          "ref": "lexicon:point-to-point-coupling"
        }
      ],
      "relation": "violated-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-event-bus",
          "json": "https://banes-lab.com/json/records/architecture/event-bus",
          "label": "Event Bus",
          "markdown": "https://banes-lab.com/records/architecture/event-bus.md",
          "ref": "architecture:event-bus"
        }
      ],
      "relation": "refactored-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/schema#vocabulary-severity-contextual",
          "json": "https://banes-lab.com/json/records/vocabulary/severity-contextual",
          "label": "contextual",
          "markdown": "https://banes-lab.com/records/vocabulary/severity-contextual.md",
          "ref": "vocabulary:severity-contextual"
        }
      ],
      "relation": "severity"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-category-event-messaging-asynchronous-architecture",
          "json": "https://banes-lab.com/json/records/architecture-category/event-messaging-asynchronous-architecture",
          "label": "Event / Messaging / Asynchronous Architecture",
          "markdown": "https://banes-lab.com/records/architecture-category/event-messaging-asynchronous-architecture.md",
          "ref": "architecture-category:event-messaging-asynchronous-architecture"
        }
      ],
      "relation": "category"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-message-broker",
          "json": "https://banes-lab.com/json/records/architecture/message-broker",
          "label": "Message Broker",
          "markdown": "https://banes-lab.com/records/architecture/message-broker.md",
          "ref": "architecture:message-broker"
        }
      ],
      "relation": "enabled-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/disciplined-methodology/collaborate#posting-and-waiting-are-one-operation",
          "json": "https://banes-lab.com/json/disciplined-methodology/collaborate/posting-and-waiting-are-one-operation",
          "label": "Posting and waiting are one operation",
          "markdown": "https://banes-lab.com/disciplined-methodology/collaborate/posting-and-waiting-are-one-operation.md",
          "ref": "chapter:/disciplined-methodology/collaborate#posting-and-waiting-are-one-operation"
        },
        {
          "href": "https://banes-lab.com/software-architecture/principles#execution-joins-the-halves",
          "json": "https://banes-lab.com/json/software-architecture/principles/execution-joins-the-halves",
          "label": "Execution joins the halves",
          "markdown": "https://banes-lab.com/software-architecture/principles/execution-joins-the-halves.md",
          "ref": "chapter:/software-architecture/principles#execution-joins-the-halves"
        },
        {
          "href": "https://banes-lab.com/ontology#architecture-category-core-modular-design",
          "json": "https://banes-lab.com/json/ontology/principles/architecture-category-core-modular-design",
          "label": "Core Modular Design",
          "markdown": "https://banes-lab.com/ontology/principles/architecture-category-core-modular-design.md",
          "ref": "chapter:/ontology#architecture-category-core-modular-design"
        },
        {
          "href": "https://banes-lab.com/ontology#architecture-category-event-messaging-asynchronous-architecture",
          "json": "https://banes-lab.com/json/ontology/principles/architecture-category-event-messaging-asynchronous-architecture",
          "label": "Event / Messaging / Asynchronous Architecture",
          "markdown": "https://banes-lab.com/ontology/principles/architecture-category-event-messaging-asynchronous-architecture.md",
          "ref": "chapter:/ontology#architecture-category-event-messaging-asynchronous-architecture"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-category-event-messaging-async",
          "json": "https://banes-lab.com/json/ontology/lexicon/lexicon-category-event-messaging-async",
          "label": "Event Messaging Async",
          "markdown": "https://banes-lab.com/ontology/lexicon/lexicon-category-event-messaging-async.md",
          "ref": "chapter:/ontology/lexicon#lexicon-category-event-messaging-async"
        },
        {
          "href": "https://banes-lab.com/ontology/schema#the-vocabulary-severity",
          "json": "https://banes-lab.com/json/ontology/schema/the-vocabulary-severity",
          "label": "Severity levels",
          "markdown": "https://banes-lab.com/ontology/schema/the-vocabulary-severity.md",
          "ref": "chapter:/ontology/schema#the-vocabulary-severity"
        },
        {
          "href": "https://banes-lab.com/ontology/schema#the-resolutions",
          "json": "https://banes-lab.com/json/ontology/schema/the-resolutions",
          "label": "The resolutions",
          "markdown": "https://banes-lab.com/ontology/schema/the-resolutions.md",
          "ref": "chapter:/ontology/schema#the-resolutions"
        }
      ],
      "relation": "linked-from"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/tree#file-core-buses-base-bus-ts",
          "json": "https://banes-lab.com/json/source/tree/core/buses/base.bus.ts",
          "label": "emitEvent",
          "markdown": "https://banes-lab.com/source/tree/core/buses/base.bus.ts.md",
          "ref": "anatomy:file-core-buses-base-bus-ts"
        },
        {
          "href": "https://banes-lab.com/anatomy/tree#file-core-buses-base-bus-ts",
          "json": "https://banes-lab.com/json/source/tree/core/buses/base.bus.ts",
          "label": "subscribeEvent",
          "markdown": "https://banes-lab.com/source/tree/core/buses/base.bus.ts.md",
          "ref": "anatomy:file-core-buses-base-bus-ts"
        },
        {
          "href": "https://banes-lab.com/anatomy/tree#folder-core-buses",
          "json": "https://banes-lab.com/json/anatomy/tree/folder-core-buses",
          "label": "core/buses",
          "markdown": "https://banes-lab.com/anatomy/tree/folder-core-buses.md",
          "ref": "chapter:/anatomy/tree#folder-core-buses"
        }
      ],
      "relation": "evidence"
    }
  ],
  "summary": "A design pattern in which publishers send messages to a topic and every subscriber to that topic receives them.",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/ontology#architecture-message-queue",
      "json": "https://banes-lab.com/json/records/architecture/message-queue",
      "label": "Message Queue",
      "markdown": "https://banes-lab.com/records/architecture/message-queue.md",
      "ref": "architecture:message-queue"
    },
    "previous": {
      "href": "https://banes-lab.com/ontology#architecture-event-driven-architecture",
      "json": "https://banes-lab.com/json/records/architecture/event-driven-architecture",
      "label": "Event-Driven Architecture",
      "markdown": "https://banes-lab.com/records/architecture/event-driven-architecture.md",
      "ref": "architecture:event-driven-architecture"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/records/architecture",
    "label": "Architecture principles",
    "markdown": "https://banes-lab.com/api/records/architecture.md",
    "ref": "api:records/architecture"
  },
  "aliases": [
    "Pub/Sub"
  ],
  "exemplar": {
    "after": "publisher.publish(\"foo.saved\", { fooId: foo.id });\nsubscriber.on(\"foo.saved\", auditFoo);\nsubscriber.on(\"foo.saved\", indexFoo);",
    "before": "function saveFoo(foo: Foo) {\n  fooStore.save(foo);\n  auditFoo(foo);\n  indexFoo(foo);\n}",
    "lang": "ts",
    "medium": "code"
  },
  "formedBy": null,
  "scope": [
    "integration",
    "eventing"
  ],
  "severity": "contextual"
}
