{"id":830,"date":"2022-09-22T22:38:35","date_gmt":"2022-09-22T14:38:35","guid":{"rendered":"https:\/\/www.fanyamin.com\/wordpress\/?p=830"},"modified":"2022-09-22T22:38:35","modified_gmt":"2022-09-22T14:38:35","slug":"%e6%97%a0%e5%a4%84%e4%b8%8d%e5%9c%a8%e7%9a%84%e5%8f%91%e5%b8%83%e8%ae%a2%e9%98%85%e6%a8%a1%e5%bc%8ftbd","status":"publish","type":"post","link":"https:\/\/www.fanyamin.com\/wordpress\/?p=830","title":{"rendered":"\u65e0\u5904\u4e0d\u5728\u7684\u53d1\u5e03\u8ba2\u9605\u6a21\u5f0f(TBD)"},"content":{"rendered":"<p>\u8ba2\u9605\u4e00\u4efd\u62a5\u7eb8\uff0c\u5230\u65f6\u5019\u5c31\u4f1a\u6295\u9012\u7ed9\u4f60\u3002<br \/>\n\u8ba2\u9605\u4e00\u4e2a\u65b0\u95fb\u9891\u9053\uff0c\u4e00\u6709\u65b0\u95fb\u5c31\u4f1a\u63a8\u9001\u7ed9\u4f60\u3002<\/p>\n<p>\u672c\u8d28\u4e0a\uff0c\u5b83\u662f\u4e00\u79cd\u5f02\u6b65\u901a\u4fe1\u7684\u67b6\u6784\u6a21\u5f0f<br \/>\n\u4e0e\u4e4b\u5bf9\u5e94\u7684\u4ee3\u7801\u6a21\u5f0f\u5c31\u662f\u89c2\u5bdf\u8005\u6a21\u5f0f\uff0c\u5176\u6ce8\u518c register \u5bf9\u5e94\u4e8e subscribe, notify \u5bf9\u5e94\u4e8e publishe<\/p>\n<ul>\n<li>subscribe\n<pre><code>subscriber -&gt; router: subscribe\nrouter--&gt;subscriber: ack<\/code><\/pre>\n<\/li>\n<li>publisher\n<pre><code>publisher -&gt; router: event\nrouter--&gt;publisher: ack\nrouter --&gt; subscriber: event\nsubscviber--&gt;router: ack<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>\u5178\u578b\u7528\u4f8b\u6709<\/p>\n<ul>\n<li>\n<p>Ingestion user interaction and server events.<br \/>\nTo use user interaction events from end-user apps or server events from your system, you might forward them to Pub\/Sub. You can then use a stream processing tool, such as Dataflow, which delivers the events to databases. Examples of such databases are BigQuery, Cloud Bigtable, and Cloud Storage. Pub\/Sub lets you gather events from many clients simultaneously.<\/p>\n<\/li>\n<li>\n<p>Real-time event distribution.<br \/>\nEvents, raw or processed, may be made available to multiple applications across your team and organization for real- time processing. Pub\/Sub supports an &quot;enterprise event bus&quot; and event-driven application design patterns.<\/p>\n<\/li>\n<li>\n<p>Replicating data among databases. <\/p>\n<\/li>\n<\/ul>\n<p>Pub\/Sub is commonly used to distribute change events from databases. These events can be used to construct a view of the database state and state history in BigQuery and other data storage systems.<\/p>\n<ul>\n<li>Parallel processing and workflows. <\/li>\n<\/ul>\n<p>You can efficiently distribute many tasks among multiple workers by using Pub\/Sub messages to connect to Cloud Functions. Examples of such tasks are compressing text files, sending email notifications, evaluating AI models, and reformatting images.<\/p>\n<ul>\n<li>Enterprise event bus. <\/li>\n<\/ul>\n<p>You can create an enterprise-wide real-time data sharing bus, distributing business events, database updates, and analytics events across your organization.<\/p>\n<ul>\n<li>Data streaming from applications, services, or IoT devices. <\/li>\n<\/ul>\n<p>For example, a SaaS application can publish a real-time feed of events. Or, a residential sensor can stream data to Pub\/Sub for use in other Google Cloud products through a Dataflow pipeline.<\/p>\n<ul>\n<li>\n<p>Refreshing distributed caches.<br \/>\nFor example, an application can publish invalidation events to update the IDs of objects that have changed.<\/p>\n<\/li>\n<li>\n<p>Load balancing for reliability. <\/p>\n<\/li>\n<\/ul>\n<p>For example, instances of a service may be deployed on Compute Engine in multiple zones but subscribe to a common topic. When the service fails in any zone, the others can pick up the load automatically.<\/p>\n<h1>Reference<\/h1>\n<ul>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Publish%E2%80%93subscribe_pattern\">https:\/\/en.wikipedia.org\/wiki\/Publish%E2%80%93subscribe_pattern<\/a><\/li>\n<li><a href=\"https:\/\/cloud.google.com\/pubsub\/docs\/overview\">https:\/\/cloud.google.com\/pubsub\/docs\/overview<\/a><\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/architecture\/patterns\/publisher-subscriber\">https:\/\/learn.microsoft.com\/en-us\/azure\/architecture\/patterns\/publisher-subscriber<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u8ba2\u9605\u4e00\u4efd\u62a5\u7eb8\uff0c\u5230\u65f6\u5019\u5c31\u4f1a\u6295\u9012\u7ed9\u4f60\u3002 \u8ba2\u9605\u4e00\u4e2a\u65b0\u95fb\u9891\u9053\uff0c\u4e00\u6709\u65b0\u95fb\u5c31\u4f1a\u63a8\u9001\u7ed9\u4f60\u3002 \u672c\u8d28\u4e0a\uff0c\u5b83\u662f\u4e00\u79cd\u5f02\u6b65\u901a\u4fe1\u7684\u67b6\u6784\u6a21\u5f0f \u4e0e\u4e4b\u5bf9\u5e94\u7684\u4ee3\u7801\u6a21\u5f0f\u5c31\u662f\u89c2\u5bdf\u8005\u6a21\u5f0f\uff0c\u5176\u6ce8\u518c register \u5bf9\u5e94\u4e8e subscribe, notify \u5bf9\u5e94\u4e8e publishe subscribe subscriber -&gt; router: subscribe router&#8211;&gt;subscriber: ack publisher publisher -&gt; router: event router&#8211;&gt;publisher: ack router &#8211;&gt; subscriber: event subscviber&#8211;&gt;router: ack \u5178\u578b\u7528\u4f8b\u6709 Ingestion user interaction and server events. To use user interaction events from end-user apps or server events from your system, you might forward them [&hellip;] <a class=\"read-more\" href=\"https:\/\/www.fanyamin.com\/wordpress\/?p=830\" title=\"Permanent Link to: \u65e0\u5904\u4e0d\u5728\u7684\u53d1\u5e03\u8ba2\u9605\u6a21\u5f0f(TBD)\">&rarr;Read&nbsp;more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-830","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/830"}],"collection":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=830"}],"version-history":[{"count":2,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/830\/revisions"}],"predecessor-version":[{"id":832,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/830\/revisions\/832"}],"wp:attachment":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}