慣性聚合 高效追讀感興趣之博客、新聞、科技資訊
閱原文 以慣性聚合開啟

推薦訂閱源

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python)
插件合Azure函数及服务总线:异步整合于宏规
SapotaCorp · 2026-05-24 · via DEV Community

SapotaCorp

一数据宇宙之变。五下游系统当知:一ERP系,司财计;一检索之务,索引其录;一Power BI之集,供将帅之仪表;一通报之列,传讯于行役之员于携器;一数据之渊,储析理之留。

此之幼版,乃一异步插件,于同一操作后步骤调用五者。于开发中,其可行。于生产,五者中一旦有者不遂,插件步骤即误,重试十次,填塞系统任务队列,而操作者得受传唤。

吾辈所运于企业之规式异矣:插件之职,惟布信息于 Azure Service Bus 耳。五者独立,自该信息之题,各司其途。每者皆自为重试、自为死信、自为监察。插件未尝呼他物,惟及队列而已。

此乃架构之图,代码之文,失败之理,及六载真实之验,铸此而成.

架构

为题非列,因一事发多受。受者各有所择,故事随其心。每受各设死信,非统设——ERP与搜索之务,可各自败而不相染。

第一阶段:插件

插件之小,乃有意为之。每行皆潜藏败笔;所为之事愈少,则愈为可靠。

三要决:

  1. 此载负乃元数据,非全行也。其讯含实名、其号,及所变之属。消费者若需全行,则自取之。讯体恒小(小于1KB),故驿传之费减,且避载负逾讯体之限之变例。
  2. 插件上下文中之关联标识。每条日志条目及下游消息皆载同关联标识,遂可于一查询中实现跨系统追踪。
  3. 筛选之主题字段。订阅者或以主题如 'account.%' 筛选,或以主题等于 'order.Update' 筛选。基于主题之筛选,服务器端代价低廉;基于内容之筛选,代价则较重。

第二阶段:服务总线主题之配置

主题之设:

  • 最多信息量:一兆字节(其本)。吾等之负载,约五百字节,远未及此限。
  • 信息之存留时日:七日。足以度周末之故障,亦足以使陈旧之信息不扰系统。
  • 重复检测:启于十分钟之窗。若同一MessageId于十分钟内至者二次,则后者弃之。此御插件重试致下游重复处理之患。

每订阅者之设:

  • 筛规:仿SQL之式于消息属性(主题、自定义头)上。
  • 最多投递次数:五(与简易服务总线模式之理同)。
  • 锁定时长,依各消费者处理时调适。ERP消费者,其远程调用或持续至三十秒,故锁六十秒。搜索消费者,纯在Azure内运作,历时一至二秒,故锁三十秒。

第三阶段:消费者

每订阅者皆为一 Azure Function,以 Service Bus Topic 订阅触发。共架一形,而下游逻辑各异。

共形者:

幂等存储,或为 Cosmos DB 配 TTL,或为 Redis。每成功处理之 MessageId 皆录之。TTL 合于 Topic 上之消息时寿,并加安全余裕。

核心之别,在于每户之理:

  • ERP之户:以Web API(用受管之身)取Dataverse全行,映于ERP之式,以MessageId所衍之幂等键,召ERP之API。
  • 搜索之户:取行,召搜索服务之索引API。
  • Power BI 之用者:触数据集分区之更新;以关联ID标记更新之事。
  • 通知之用者:检视当通知何人,依行主与策,经通知之务而达之。
  • 数据湖之用者:以日为界,附压缩之JSON录于分区ADLS Gen2之径。

可察之明

链无可观,则于生产无益。吾之设:

  • 每项功能应用皆设应用洞察,共享工作空间,使查询跨越各项功能。
  • 每条日志记录皆含CorrelationId与MessageId,依上述BeginScope之范式。
  • 自定制之量:已处理之讯,已败之讯,已寂之讯,处理之时。
  • 监控表(Azure Monitor 工作簿):每事件类型端到端延迟(自Dataverse变更时间至最终写入目的地)。每消费者死信队列深度。每小时每消费者错误率。
  • 报警:任一消费者死信队列深度> 10,任一消费者处理时长p95> SLA。

一事件之端到端追迹:以KQL查询Application Insights,以CorrelationId为键联。Dataverse中一行之变,自插件→Service Bus发布→每消费者→每下游调用,皆可溯。若有失,则链中所在,了然于心。

半载匠心:数析

一客有:

  • 每日五十万数据宇宙事件
  • 五者均速三秒以处
  • 甚时五百事每分

今状:

  • P50 末至迟滞(事→众者毕):四秒二
  • P95 末至迟滞:十一秒
  • 死信率:千分之三(万三千三之一)
  • 消费者错误率:0.1-0.2%(多属暂态,自动重试)
  • 月度Azure成本(服务总线+函数应用+应用洞察):约320美元

启用后所调之项

功能应用实例与队列深度之比。消耗计划自动伸缩;其默认值较为保守。吾等调适每功能之maxConcurrentCalls,以使消费者处理近其每实例之容量,方启更多实例。

订阅之滤则。初时,每消费者皆得诸事,于码中自滤。移滤于订阅之级(伺侧),消者之费减其六成,盖消者不复为不相关之事而醒也。

去重之窗。初设一分钟之窗,过短;插件重试偶使复件相隔逾分。量得实重试间隔,延至十分,以应其实。

何时不发此

此模式之用过度矣:

  • 下游消费者仅一二人者,直用 Power Automate 流程,事简。
  • 低量场景<每日千事,其运筹之繁,过其通量之益。
  • 无 Azure 之经验者,持 Service Bus、Function Apps、Application Insights,实为运营之重负。待运营之能成,乃择简易之式。

凡合乎其制者(如企业级、多用户、事件关键),此乃吾辈首选之架构。其能承重,其能明示故障,及至事有乖谬,其解必在所知之域,明察秋毫。