主题: architecture
-
流水线、扇出、编排器与评审小组:哪种多智能体模式适合哪类任务
流水线适合有固定处理步骤的任务;并行扇出适合彼此独立的子问题,或需要多次尝试后投票决定的场景;带工作者的编排器适合分解方式只有在运行时才能确定的任务;评审小组适合需要按多项标准审查的输出;这几种模式都会成倍增加 token 开销,并新增一个可能自身出错的协调层。
-
技术决策中的 DACI 与 RACI:唯一审批人,指名的贡献者
DACI 框架指定一名推动者(driver)负责推进决策、一名审批人(approver)唯一地做出决策、有发言权但无表决权的贡献者(contributors),以及了解最终结果的知情方(informed);RACI 则为任务分配负责(responsible)、问责(accountable)、咨询(consulted)与知情(informed)四种角色。只要在讨论开始前把角色写清楚,两者都适用于技术决策。
-
.NET 依赖注入惯例:生命周期、作用域与“被困依赖”陷阱
Microsoft.Extensions.DependencyInjection 会把服务以 transient(瞬时)、scoped(作用域)或 singleton(单例)三种生命周期之一注册到 `IServiceCollection` 上,并通过公共构造函数注入;官方文档规定的规则是:绝不能把 scoped 服务注入 singleton 中,容器创建的对象应由容器自己释放,应避免使用服务定位器(service locator)式调用,并应启用作用域校验,使“被困依赖”在启动时就报错,而不是在多个请求之间悄悄泄漏状态。
-
Event sourcing and CQRS: what they buy and what they cost
Event sourcing stores every state change as an immutable event and derives current state by replay; CQRS separates the write model from read models. Both add auditability and flexibility at the price of complexity and eventual consistency.
-
为新服务选择 Go 或 Rust:不使用基准测试的决策流程
根据有文档依据的语言属性和团队约束,在 Go 与 Rust 之间作出选择,而不是听信基准测试传闻:内存管理模型、错误与并发风格、工作负载形态、服务必须对接的库,以及两年后由谁维护。
-
Technische Schulden als bewusste Entscheidung mit Buchführung
Cunninghams Metapher: Nicht ganz richtiger Code ist ein Kredit, jede Minute Mehrarbeit daran ist der Zins. Die Metapher trägt nur, wenn die Schuld bewusst aufgenommen, notiert und regelmässig bewertet wird; als Sammelbegriff für alles Unschöne oder als Entschuldigung für Schlamperei ist sie wertlos.
-
用决策模型选择工具或技能:Choice 负责排序,Noul 允许弃选
为什么针对候选工具的 Choice 回答的是相对问题(哪个候选最合适),而每个候选的 Noul 回答的是绝对问题(这一轮究竟是否需要工具);以及 TypeSafe 的技能建议指南如何在包含 182 个技能的目录上结合两者:一次请求为全部候选排序,第二次读取前三名,并可拒绝全部候选。
-
File upload service walk-through: direct-to-storage tickets, asynchronous scanning and quotas
A design walk-through for uploads that bypass the application servers: a ticket that reserves quota and returns a signed upload URL, a completion step that verifies the stored object, a scan worker that promotes or deletes it, lifecycle rules for abandoned uploads, and a status model that explains every stored object.
-
Notification service walk-through: channels, preferences, delivery attempts and retries
A design walk-through for a multi-channel notification service: an ingest API with an idempotency key, a router that expands one notification into per-channel deliveries after checking preferences, per-channel queues and retry schedules, callback handling for invalid tokens, and what to defer.
-
在 PostgreSQL 中存储派生数据:生成列与物化视图
生成列仅根据本行数据为每行派生一个值,可采用虚拟形式(读取时计算)或存储形式(写入时计算),且只能使用不可变表达式;物化视图存储任意查询的结果,其新鲜度仅截至上次 REFRESH。需要索引的逐行规范化适合存储生成列,允许滞后的昂贵聚合适合物化视图,两者都不合适时则维护汇总表。
-
设计智能体记忆:保留什么、概括什么、忘记什么
智能体记忆分为三个层次:上下文窗口、任务工作笔记和跨会话持久存储。应逐项决定归属层次,让持久记忆保持精简、可审查,并删除不再真实的内容。
-
Server-Sent Events 与 WebSocket 的比较
Server-Sent Events 通过普通 HTTP 将文本事件从服务器持续发送给客户端,并支持自动重连和最后事件标识;WebSocket 则使用自己的协议,提供支持二进制数据的双向通道。单向更新可选择 SSE,客户端需要频繁发送数据时可选择 WebSocket。
-
Abstaining as an agent: when not acting is the correct output
An agent's output space should include a deliberate 'not decided' for every automated action: what abstention is, why a classifier or agent without one converts every unclear case into a wrong action, and how to build abstention in through explicit options, floors on confidence, stakes-dependent thresholds and a route for what was abstained from.
-
When does client-side routing still pay off now that browsers offer bfcache, prerendering and cross-document view transitions?
Open question: in-page routers were adopted to avoid full page loads, at the cost of shell serving, 404 handling, scroll and focus restoration and a bundle that must arrive first; the back/forward cache, the Speculation Rules API and cross-document view transitions now address the original motivations in multi-page sites. For which sites and interaction patterns does an in-page router still measurably win?
-
At what repository size do teams need monorepo build tooling beyond plain Git?
Open question: sparse checkout, partial clone and per-directory CI filters cover the first stage of a growing single repository; at which size, team count or build time have teams found that a build graph tool with remote caching became necessary, and what did the transition cost?
-
为 Python 工作负载选择线程、进程或 asyncio
先判断热点路径的性质:等待 I/O 适合 asyncio(大量连接、异步库)或线程池(少量阻塞调用);纯 Python 的 CPU 工作需要进程或自由线程构建;释放 GIL 的原生代码可使用线程。限制每个池的规模,显式选择进程启动方式,并编写关闭流程。
-
URL shortener walk-through: key generation, redirect status and abuse controls
A design walk-through for a URL shortener: random base62 keys with collision retry, a redirect path that touches one cache and one store, 302 rather than 301 when targets must stay revocable and countable, creation-side abuse checks, and a list of what not to build first.
-
架构决策记录
架构决策记录用一个与代码一同保存的简短文件,记录一项重要决策的背景、决策本身、状态和后果。
-
Caching in Anwendungen: Ablaufzeiten, Invalidierung und Schutz vor dem Ansturm
Ein Anwendungs-Cache hält abgeleitete Daten und darf jederzeit verloren gehen; korrekt bleibt er nur durch bewusste Invalidierung: Ablaufzeit je Datenklasse, Löschen statt Überschreiben beim Schreiben, Versionskennung im Schlüssel und eine Sperre gegen gleichzeitiges Nachladen heisser Schlüssel.
-
ETL versus ELT: where the transformation runs and what that changes
ETL transforms data in a separate engine before loading it into the target; ELT loads raw data first and transforms it with the target store's own processing. The choice decides where compute is paid for, what raw data lands in the warehouse, and how easily a transformation can be rerun.
机器可读: JSON