AI 资讯
Load Balancing: The Neo Way to Dodge Traffic
The Quest Begins (The “Why”) I still remember the night our API started to sputter under a sudden traffic spike. Users were seeing 502 errors, the monitoring dashboard looked like a neon rainstorm, and I felt like I was stuck in a lobby waiting for the elevator that never arrives. We had a simple round‑robin load balancer sitting in front of three identical services. It worked fine when traffic was smooth, but as soon as a burst hit, one node would get overloaded while the others twiddled their thumbs. Honestly, I thought we just needed more servers. Throwing hardware at the problem felt like using a sledgehammer to crack a nut—expensive and messy. After a few frantic Slack threads and a lot of coffee, I realized the real issue wasn’t capacity; it was how we distributed the work. The balancer was oblivious to the actual load on each backend, treating every request like it was the same weight. That moment became my quest: design a load balancer that reacts to real‑time load, stays simple enough to operate, and doesn’t cause a reshuffling nightmare when we scale the cluster. The Revelation (The Insight) The breakthrough came when I read about least‑connections load balancing combined with a slow‑start period for new hosts. The core insight is deceptively simple: Send each new request to the backend that currently has the fewest active connections. Why does that work? Immediate fairness – If one node is handling long‑running requests, it will naturally have a higher connection count and receive fewer new ones until it catches up. Burst absorption – During a traffic spike, requests spill over to the less‑busy nodes instead of piling onto a single overloaded instance. Predictable scaling – When we add a new server, it starts with zero connections, so it gets a fair share of traffic right away—but we temper that with a slow‑start window to avoid overwhelming a cold host. Compare that to round‑robin, which blindly cycles through the list regardless of each node’s state. In
AI 资讯
Scale Is a Design, Not a Dial
The dashboard says forty instances, up from twelve this morning. The autoscaler did its job: it saw latency climb and threw hardware at it. And latency got worse. Not flat. Worse. You're paying for three times the compute to serve a slower product. Somewhere under all forty of those boxes is a single thing they're all waiting in line for, and every instance you add makes the line longer. Horizontal scaling multiplies work that doesn't have to coordinate. The instant the work does have to coordinate, more instances make it slower. Amdahl wrote this down in 1967: the serial fraction of a job sets a hard ceiling on how much faster you can go, no matter how much hardware you throw at the parallel part. Neil Gunther's Universal Scalability Law goes further: past a certain point, the cost of nodes coordinating with each other bends the curve back down. Add capacity, get less throughput. That ceiling was not set by the autoscaler, and it will not be moved by the autoscaler. It was set a long time before this morning, in a room, by whoever decided where the state lives and who has to touch it at the same instant. Now hand the service to a fleet of agents. It writes you something that looks built to scale: stateless handlers, a tidy repo, green tests, a canary that bakes fine at 1% traffic. Every gate you trust says ship it. And the bottleneck is sitting right there in the design, invisible to all of it, because the mistake isn't in the lines, it's in the shape. You cannot catch a shape problem by reading a diff. Name the hot state before you pick a framework. Where does the contended state live, and which requests touch it at the same instant? Answer that out loud, before anyone opens an editor. The tool is downstream of that answer, every time. Originally published at https://imacto.com/writing/scale-is-a-design-not-a-dial . Written with Claude Opus 4.8.
AI 资讯
Cybersecurity 101 : Windows Notifications
Introduction So imagine you are focused on your cappuccino-frappuccino doing something very important on you win laptop and then have a cringe attack due to the unknown Phone Link notification : Complete linking devices Your PC and mobile device are almost linked. Click here to continue linking devices. via Phone Link Then you switch off bluetooth, wifi, laptop - and you are right. What to do next ? Basic checks Settings -> Bluetooth & devices -> Mobile devices Settings -> Accounts -> Email & accounts Inspect recent notifications in Event Viewer eventvwr.msc Applications and Services Logs └ Microsoft └ Windows └ Notifications Applications and Services Logs └ Microsoft └ Windows └ Shell-Core Digital forensics Windows stores toast notifications in a local database, hence you need to install sqlite Get-ChildItem " $ env : LOCALAPPDATA \Microsoft\Windows\Notifications" output : Directory: C:\Users\$ USERNAME \A ppData \L ocal \M icrosoft \W indows \N otifications Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 1/1/2026 0:00 AM wpnidm -a---- 1/1/2026 0:00 AM 1000000 wpndatabase.db -a---- 1/1/2026 0:00 AM 10000 wpndatabase.db-shm -a---- 1/1/2026 0:00 AM 1000000 wpndatabase.db-wal wpndatabase.db is a SQLite database. connect to the database : sqlite3 " $env :LOCALAPPDATA \M icrosoft \W indows \N otifications \w pndatabase.db" query the Notification table . headers on . mode column SELECT Notification . Id , Notification . HandlerId , Notification . Type , Notification . ArrivalTime , Notification . Payload FROM Notification LIMIT 20 ; Then you will have something like : Id: [REDACTED] HandlerId: [REDACTED] Type: toast ArrivalTime: [REDACTED] Payload: <?xml version="1.0"?> <toast activationType= "protocol" launch= "ms-phone:fre/?cid=[REDACTED]&ref=FreIncompleteToast&reason=IncompleteNotificationsToast" > <visual> <binding template= "ToastGeneric" > <text hint-maxLines= "1" > Complete linking devices </text> <text> Your PC and mobile device are almost li
AI 资讯
Designing a Multi-Tenant Storefront With Wildcard Subdomains
At my workplace, I worked on an ERP platform used by fashion businesses to manage customers, body measurements, products, orders, invoices, inventory, staff, and other day-to-day operations. Each business also had a public storefront where customers could browse products and check out. The storefront started as a simple sharing feature. Businesses could publish products, copy a link, and send it to customers outside the main workspace. That worked well because the storefront was mostly a product catalogue, and most of the sales process still happened after the customer contacted the business. As the platform evolved, the storefront became much more than a catalogue. Customers were discovering businesses through shared links, browsing products, placing an order, and tracking orders directly from the storefront. That introduced new technical requirements around branded storefronts, SEO, server-rendered metadata, public checkout, pricing, and analytics. This article explores how I designed the storefront around wildcard subdomains, immutable shop identities, server-side shop resolution, and a scalable analytics pipeline. Table of Contents Giving the Storefront Its Own Identity Business Names, Reserved Names, and Subdomains Resolving a Storefront Active and Inactive Storefronts Location and Currency Product Pages and Share Previews Storefront Event Ingestion Processing Raw Events Counting Unique Visitors With HyperLogLog Domain Routing and Local DNS 1. Giving the Storefront Its Own Identity The original storefront was fairly simple. It was a React application that fetched a business and rendered its products. Beyond that, there wasn't much to it. There were no branded storefronts, analytics, subdomains, or even a separate identity beyond the business itself. Introducing those capabilities meant the storefront needed its own data model. I introduced a dedicated shop entity to represent the public storefront. The business remained the source of operational data such as cu
AI 资讯
Building an Instagram AutoDM System at Scale: Webhooks, Event Driven Architecture, and Lessons Learned
Instagram creators love engagement. Every comment is an opportunity to start a conversation, share a product, deliver a resource, or convert a viewer into a customer. The problem is that manually replying to hundreds or thousands of comments doesn't scale. At Vyral , we set out to build an Instagram AutoDM platform capable of serving thousands of creators while handling bursts of traffic generated by viral Reels. Instead of building a traditional chatbot, we designed an event driven system powered by Instagram webhooks, AWS services, and asynchronous processing. This article walks through the architecture, the engineering challenges we encountered, and the lessons we learned while designing a system that can process large spikes of comment events reliably. The Problem Imagine a creator with 2 million followers. A Reel starts trending. Within minutes: 10,000+ comments arrive Thousands of users comment the same keyword Instagram sends webhook events continuously Every eligible comment should trigger a personalized DM From an engineering perspective, this isn't a chatbot problem. It's an event processing problem. The system needs to answer questions like: Which comments qualify? Has this comment already been processed? What happens if Instagram sends the same webhook twice? What if the user deletes the comment? What if our service is temporarily unavailable? How do we avoid overwhelming downstream APIs? Those questions shaped the architecture far more than the messaging logic itself. Why We Chose Webhooks Instead of Polling Polling Instagram every few seconds would have introduced unnecessary latency and API usage for Vyral AutoDM . Instead, Instagram pushes events whenever something happens. The flow looks like this: Instagram │ ▼ Webhook Endpoint │ ▼ Event Validation │ ▼ Event Queue │ ▼ Workers │ ▼ Business Rules │ ▼ Send DM This architecture offers several benefits: Low latency Lower infrastructure cost Better scalability Natural decoupling between components Most i
AI 资讯
The Complete TypeScript Mastery Guide
Learn TypeScript From First Principles to Senior/Staff-Level Production Engineering If you searched for how to learn TypeScript properly — not just the syntax, but the thinking behind it — this guide is built for that. Most TypeScript tutorials stop at "here's an interface, here's a generic." This one goes further: it's a single, exhaustive TypeScript tutorial and reference that walks through the type system, object-oriented programming, generics, async programming, design patterns, SOLID and DRY principles, error handling, testing, and the tooling that real production teams run in CI — the same TypeScript best practices used at top-tier engineering organizations. Whether you're a beginner looking for a structured TypeScript for beginners path, or an experienced JavaScript developer making the jump to advanced TypeScript and system design, you can read this end to end or jump straight to the section you need using the linked table of contents below. Table of Contents 1. Introduction — What Is TypeScript & Why It Exists 2. Installation, Setup & tsconfig.json Deep Dive 3. Variables & the Complete Type System 4. Functions — Every Form, Overloads, this , and Best Practices 5. Arrays & Tuples 6. Objects & Type Aliases 7. Interfaces 8. Enums & Literal Types 9. Union, Intersection & Discriminated Unions 10. Type Narrowing, Assertions & Type Guards 11. Classes & Object-Oriented Programming 12. Generics — Basic to Advanced 13. Modules, Namespaces & Project Structure 14. Asynchronous Programming — Event Loop to Production Patterns 15. Advanced/Utility Types & the Type-Level Programming Toolkit 16. Design Patterns in TypeScript 17. SOLID, DRY, KISS, YAGNI — Principles Applied With Real TS Code 18. Error Handling Strategies 19. Testing TypeScript 20. Tooling, Linting, Build Systems & CI/CD for Production TS 21. Performance, Compiler Internals & Scaling Large Codebases 22. Interview Cheat Sheet (Expanded) 23. One-Page Quick Revision Sheet 1. Introduction — What Is TypeScript & W
AI 资讯
How Reddit Stores Comment Trees and Ranks Hot Posts
Reddit looks simple and hides two genuinely hard problems. Comments nest arbitrarily deep, and a naive tree structure makes loading a busy thread slow. The front page reorders itself constantly, so ranking cannot just count votes or old posts would never leave. Both problems have well-known answers, and both are good lessons in choosing the right model. The core problem A comment thread is a tree. Each comment can reply to any other, so depth is unbounded. If you store only "this comment's parent id" and then try to load a whole thread, you walk the tree one level at a time, one query per level, which gets slow for deep or wide threads. Loading a popular post with thousands of nested comments should not take thousands of queries. Ranking is the second problem. If the front page sorted by raw vote count, the highest-voted post of all time would sit at the top forever. If it sorted by newest, quality would drown in noise. You need a score that blends how good a post is with how fresh it is, so good new posts can climb and old ones fade even if they were once popular. Key design decisions Store the parent pointer, but do not traverse at read time. The simple model is a parent_id per comment, which is easy to write but expensive to read as a tree. To load a thread cheaply, fetch all comments for the post in one query, then assemble the tree in application memory. One read, in-memory tree building. This works because a single post's comments, while numerous, fit in memory to assemble. Consider a path or closure model for deep trees. For very deep threads, some systems store a materialized path on each comment, an encoded ancestor chain, so you can fetch an entire subtree with a single prefix query and sort by the path to get correct display order. Another option is a closure table that records every ancestor-descendant pair, which makes subtree queries direct at the cost of extra write work. The right choice depends on how deep threads get and how often you read subtrees
AI 资讯
How Elasticsearch Searches Fast: The Inverted Index and Shard Routing
Searching billions of documents for a phrase and getting ranked results in tens of milliseconds looks like magic. It is not. It comes down to two ideas working together: an index that maps words to documents instead of scanning documents for words, and a way to spread that index across machines so each holds only a slice. Understand both and full-text search stops being mysterious. The core problem A database scans rows. If you ask a plain database to find every document containing a word, it reads documents and checks them, which is linear in the amount of data. That is fine for exact key lookups and hopeless for free-text search across huge corpora. You need the opposite mapping. Instead of "given a document, what words does it have", you want "given a word, which documents have it". That inversion is the whole trick. The second problem is size. One machine cannot hold the index for billions of documents, and one machine cannot serve the query load. So the index has to be split across nodes, and a query has to find the right nodes and combine their answers. Key design decisions Build an inverted index. At index time, each document is broken into tokens by an analyzer that lowercases, splits on word boundaries, and often strips or stems words. For every token, the engine keeps a posting list: the set of document ids that contain it, often with positions for phrase matching. A query for a word becomes a direct lookup of its posting list, not a scan. A multi-word query intersects or unions posting lists, which is fast because the lists are sorted. Store the index in immutable segments. New documents go into small new segments rather than editing existing ones. Segments are immutable, which makes them cache-friendly and safe to read without locks. A background process merges small segments into larger ones over time. A delete is just a marker; the document is removed for real during a later merge. Split an index into shards. An index is divided into shards, each a sel
AI 资讯
Architecture Decisions Behind Building a Simple Personal Software Tool
How I moved from a traditional web application mindset to exploring local-first architecture I wanted to build a simple software tool for my personal use. Nothing complicated. Something in the category of tools people build for themselves: A personal expense tracker A budgeting application A private knowledge management tool A personal organization system The important characteristic was this: The data belonged to one person. It was not a social application. It was not a collaboration platform. It did not need users interacting with each other. There was no requirement for: Public profiles Sharing updates Real-time collaboration Social features It was simply a tool that helped one person manage their own information. When I started thinking about building it, my first instinct was the most natural one for me. I am a web application developer. My comfort zone is building web applications. So my first thought was: "Why not build a Ruby on Rails application?" Something like: User | Web Application | Ruby on Rails API | PostgreSQL Database This is an architecture I have worked with many times. The workflow is familiar: Create models Build controllers Add authentication Store data in a database Deploy the application Access it from anywhere This is a proven architecture. For many products, this is exactly the right approach. But while thinking about this project, I asked myself a different question: Am I choosing this architecture because the problem requires it, or because it is the architecture I already know? That question changed the direction completely. Understanding The Actual Problem Before choosing technology, I wanted to understand the nature of the problem. What kind of application was I actually building? There is a big difference between building: A social network A marketplace A collaboration platform A communication application versus building: A personal tool A private utility A single-user productivity application In the first category, the server is the
AI 资讯
The Hidden Cost of Multi-Model Workflows
The AI race is quietly changing Months ago, most discussions revolved around one question: "Which model is the smartest?" Today, I'm seeing a different pattern. The conversation is shifting toward: How do we orchestrate multiple models, tools, and workflows effectively? Look at where the industry is investing. It's no longer just about improving the model itself. The focus is increasingly on long-running tasks, delegated execution, tool use, coding assistants, planning, memory, and specialized sub-tasks working together. That's not a coincidence. The model is becoming one component of a much larger system. As engineers, we're spending less time debating benchmarks and more time designing the layer around the model: • Context management • Routing requests to the right model • Memory and continuity • Tool orchestration • Verification and evaluation • Recovery and fallback strategies This is why I believe the next competitive advantage won't simply be having access to the "best" LLM. It will be building the best AI Harness—the engineering layer that coordinates models, tools, context, and decision-making into a reliable system. Cloud computing went through a similar evolution. Eventually, the infrastructure became a commodity, while orchestration became the differentiator. I think AI is heading down the same path. In a few years, we may stop asking: "Which model are you using?" and start asking: "What's your orchestration architecture?" I'm curious—are you seeing the same shift in your AI workflows, or do you think model capability will remain the primary differentiator?
AI 资讯
End-to-end Design Walkthrough — Full System Design
Full system design walkthrough: vì sao quy trình 5 bước quan trọng hơn thuật ngữ, và cái bẫy nhảy thẳng vào deep-dive Một buổi phỏng vấn system design 45–60 phút không đánh giá xem thí sinh biết bao nhiêu tên công nghệ, mà đánh giá xem thí sinh có xử lý được một bài toán mơ hồ theo một quy trình có kỷ luật hay không. Cùng đề "thiết kế URL shortener", người thất bại thường bắt đầu bằng "dùng Cassandra vì scale tốt" ngay ở phút thứ hai — chưa hỏi scale bao nhiêu, chưa biết read/write ratio, chưa đồng ý interface. Người pass đi theo một trình tự cứng: requirements → estimation → high-level → deep-dive → tradeoff . Cùng một đề, cùng thời lượng, nhưng người thứ hai dẫn dắt được interviewer thay vì bị dí. Bài này mô tả quy trình đó ở mức thực dụng, các thất bại thường gặp khi bỏ bước, và một hands-on end-to-end trên URL shortener để tự luyện. Cơ chế hoạt động Quy trình chuẩn được nhiều tài liệu tổng hợp (Alex Xu — System Design Interview vol.1; Donne Martin — system-design-primer ; Kleppmann — Designing Data-Intensive Applications ) đều có 4–5 bước gần như trùng nhau. Đây là khung 5 bước dùng thực tế trong phỏng vấn: Requirements clarification (~5 phút). Chốt functional requirement (hệ thống làm gì — API nào, use case nào) và non-functional requirement (availability target, latency target, consistency yêu cầu, security, cost). Không đoán — hỏi lại interviewer. Output: 3–5 gạch đầu dòng functional + 3–5 gạch NFR + danh sách "out of scope" (analytics, billing, ...). Back-of-the-envelope estimation (~5 phút). Tính DAU, QPS peak/avg, read:write ratio, storage growth theo năm, bandwidth. Không cần chính xác — cần đúng order of magnitude để quyết định "cần shard hay không", "cache có ý nghĩa không", "một node đủ hay phải scale ngang". High-level design (~10–15 phút). Vẽ box diagram: client → LB → app tier → cache → primary datastore → async worker → object storage/CDN. Định nghĩa API (endpoint, request/response, status code) và data model (schema chính, index chính). Ở bước này
产品设计
Missing network configuration on fresh Ubuntu Server offline installation
Installing Ubuntu Server 24.04 LTS in an offline mode (no LAN cable or WiFi connected) leaves you with an unmanaged network interface which requires manual configuration post-install. The interface enp4s0 is unmanaged by systemd-networkd and also the service itself is disabled. NOTE: This guide applies to Ubuntu server. On Ubuntu desktop you have the NetworkManager service installed and the steps would be different. To fix the problem follow the steps below: Create a Brand New Netplan Configuration File Look into /etc/netplan . You will probably see the dir is empty. This means the installer completely gave up on configuring the network and didn't create any profiles. Create a new file, e.g. vim /etc/netplan/01-netcfg.yaml . Paste the following configuration network : version : 2 renderer : networkd ethernets : enp4s0 : dhcp4 : true This makes the interface managed by networkd instead of the desktop NetworkManager. Fix permissions The new file needs to be readable only by root so fix it's permissions chmod 600 /etc/netplan/01-netcfg.yaml . Enable network service Enable the network service and make it start on boot: systemctl enable systemd-networkd systemctl start systemd-networkd Run netplan Finally, we need to tell Ubuntu to use our new configuration and activate the network netplan generate netplan apply Network should be up! ip a
AI 资讯
Governance
Governance is not a set of rules layered on top of AI. It is the structural logic that determines how meaning, constraint, and legitimacy are maintained as the system accelerates. If Pillar 1 establishes the need for a sovereign semantic foundation, Pillar 2 defines the governance architecture that must sit above it — not as oversight, but as physics. The Perception Governance is often treated as a reactive discipline: policies, audits, compliance frameworks, risk registers, and oversight mechanisms designed to keep AI “within bounds.” This assumes governance is something external — a supervisory layer that watches, corrects, and intervenes when systems behave unexpectedly. But this view is fundamentally flawed. It treats governance as a response rather than a structure. The Reality Governance is not external to the system. Governance is the system. If the architecture cannot represent constraint, legitimacy, and permissible transitions internally, no external governance mechanism can compensate for that absence. Oversight becomes containment. Policy becomes patching. Compliance becomes theatre. True governance is not about controlling behaviour. It is about ensuring the system’s behaviour emerges from legitimate semantics in the first place. Governance is not a supervisory function. Governance is an architectural function. What Governance Actually Is In sovereign AI, governance is the structural logic that ensures: meaning remains coherent boundaries remain stable transitions remain legitimate behaviour remains aligned with the system’s semantic substrate Governance is not a set of rules. Governance is the architecture that determines how rules exist. It defines: how constraints are represented how legitimacy is encoded how transitions are validated how the system maintains coherence under acceleration how external pressure is absorbed without destabilising meaning Governance is not about preventing misbehaviour. It is about ensuring misbehaviour cannot emerge from
AI 资讯
The Accidental Architect
I didn’t set out to become a systems architect. In fact, I didn’t even know that’s what I was becoming. There was no grand plan, no formal training, no moment where someone handed me a title. It happened the same way most systems failures happen: slowly, then all at once. What I did have was a habit. Whenever something broke — a workflow, a process, a piece of software, an organisation — I couldn’t leave it alone. I needed to understand why. Not the surface‑level “why,” but the structural one. The hidden one. The one nobody sees until it’s too late. Most people move on when something fails. I map it. I started noticing patterns. The same failure modes appeared everywhere: unclear ownership, mismatched incentives, brittle assumptions, invisible dependencies, and the classic “we built this fast and hoped it wouldn’t collapse.” Different domains, same architecture problems. I wasn’t trying to fix things. I was trying to understand them. But understanding inevitably leads to repair, and repair inevitably leads to design. Eventually I realised I wasn’t just analysing systems — I was architecting them. Not officially. Not ceremonially. Just… functionally. I became the person who could see the structure beneath the mess. The person who could explain why something was breaking and what would happen next. The person who could redesign the thing so it wouldn’t break again. People started asking me questions that only architects get asked. “Why is this happening?” “How do we stop it?” “What should this look like instead?” “What’s the underlying pattern here?” I didn’t have a job title for it. I didn’t need one. The work defined itself. Over time, I realised that “systems architect” was simply the most accurate description of what I was already doing. Not in the traditional enterprise sense — no UML diagrams, no formal frameworks, no ivory‑tower abstractions. More like: the person who sees the real structure beneath the chaos and can articulate it clearly enough that others fin
AI 资讯
Designing ERP Software for Retail: Five Lessons Every Software Engineer Should Know
Here are five architectural lessons we've learned from designing software for modern retailers.* Designing ERP Software for Retail: Five Lessons Every Software Engineer Should Know When people hear the word ERP , they often think of accounting software, dashboards, or inventory management. As software engineers, we see something different. We see distributed systems. Complex business workflows. Real-time data synchronization. Concurrent transactions. Event-driven architecture. And perhaps the biggest challenge of all—representing how real businesses actually operate. At RetailWings , we've learned that building an ERP for retail isn't simply a software engineering challenge. It's a business engineering challenge. Here are five lessons every engineer should understand before designing an ERP platform for modern retail. 1. Retail Doesn't Run in Modules—It Runs as One Business One of the biggest architectural mistakes in business software is treating departments as isolated applications. Many systems separate: Sales Inventory Finance Procurement HR But retailers don't experience their businesses that way. One sale immediately affects inventory. Inventory influences procurement. Procurement impacts finance. Finance drives reporting. Everything is connected. A well-designed ERP should reflect these relationships rather than forcing departments into disconnected silos. 2. Inventory Is More Than a Database Table To many engineers, inventory may appear to be a simple CRUD problem. Create. Read. Update. Delete. Retail quickly proves otherwise. Inventory changes through: Sales Returns Transfers Damages Procurement Stock adjustments Warehouse movements Manual reconciliations Every movement has financial implications. Every movement must be traceable. Designing inventory requires thinking in terms of events, not just records. 3. Real-Time Data Changes Everything Retail managers don't want yesterday's reports. They want answers now. How much stock is left? Which branch is sellin
AI 资讯
4A Enterprise Architecture + TOGAF: How to Guide Agent Skill Design
4A企业架构+TOGAF如何指导Agent Skill设计 引言:AI Skill设计的"巴别塔"困局 当下的AI Agent生态,正陷入一种似曾相识的混乱。 去年帮一家保险公司梳理Agent技能库,发现100多个Skill横七竖八地堆在一起——有的直接调API,有的内嵌业务逻辑,有的把数据获取和分析揉成一团。问架构师这些Skill怎么分类,回答是"按安装顺序排的"。再问两个Skill之间数据怎么流转,回答是"各写各的"。一个股票监控Skill自己爬数据、自己做分析、自己发消息,三件事耦合在同一个脚本里。换一个场景想复用其中的分析逻辑?做不到,只能重写。 这不是个例。几乎所有率先部署AI Agent的企业都面临同样的困境:Skill越堆越多,越堆越乱。缺乏统一的能力域划分,缺乏标准化的数据接口,缺乏清晰的组合规则,缺乏可复用的构建块沉淀。 听起来很熟悉?没错——这正是企业架构在20年前要解决的问题。当年企业信息化的混乱,和今天AI Skill的混乱,本质上是一回事:没有架构约束的开发,必然走向无序。 4A企业架构(业务架构BA、数据架构DA、应用架构AA、技术架构TA)加上TOGAF的构建块思想,为Agent Skill设计提供了一套经过验证的方法论。本文试图建立这二者之间的映射框架,并用实际案例说明其可行性。 4A映射框架:四个问题驱动Skill设计 企业架构的核心是四个问题:做什么(BA)、数据怎么流(DA)、用什么组合(AA)、底层怎么支撑(TA)。这四个问题同样适用于Skill设计。 ┌───────────────────────────────────────────────────────────────┐ │ 4A → Skill 映射框架 │ ├───────────────────────────────────────────────────────────────┤ │ │ │ BA 业务架构 │ │ ┌─────────────────────────────────────────────────────────┐ │ │ │ Skill的业务能力域划分、价值链映射 │ │ │ │ → 回答"这套Skill体系解决什么业务问题" │ │ │ └────────────────────────────┬────────────────────────────┘ │ │ │ │ │ DA 数据架构 │ │ │ ┌────────────────────────────▼────────────────────────────┐ │ │ │ Skill的数据流、信息交换标准 │ │ │ │ → 回答"Skill之间数据怎么流转、用什么格式" │ │ │ └────────────────────────────┬────────────────────────────┘ │ │ │ │ │ AA 应用架构 │ │ │ ┌────────────────────────────▼────────────────────────────┐ │ │ │ Skill的组合关系、依赖图谱 │ │ │ │ → 回答"哪些Skill可以组装、依赖关系是什么" │ │ │ └────────────────────────────┬────────────────────────────┘ │ │ │ │ │ TA 技术架构 │ │ │ ┌────────────────────────────▼────────────────────────────┐ │ │ │ Skill的运行时、工具链、基础设施 │ │ │ │ → 回答"Skill跑在什么环境上、需要哪些依赖" │ │ │ └─────────────────────────────────────────────────────────┘ │ │ │ └───────────────────────────────────────────────────────────────┘ 用表格更清晰地展示每一层的核心映射关系: 架构层 核心问题 Skill映射 示例 BA 业务架构 Skill解决什么业务问题? 按能力域分组:协同办公、内容生产、数据智能、系统运维等 "数据智能"域包含客户画像、股票监控、财务智能等Skill DA 数据架构 Skill间数据如何流转? 统一数据格式(Markdown/JSON),标准化数据源→转换→消费管道 搜索Skill输出Markdown,报告Skill消费Markdown生成PDF AA 应用架构 Skill如何组合复用? 构建依赖图谱,上层组合下层,同类可替换 日报Skill = 搜索 + 摘要 + PDF转换 + 消息推送
AI 资讯
The Shop on the Corner: How I Learned System Design Without Building Clone
The Shop on the Corner: How I Learned System Design Without Building Amazon Nephew asks his uncle — 10 years deep into building large-scale systems — to explain "system design," and all the scary jargon that comes with it. Uncle refuses to start with the jargon. Instead: "Forget servers and databases for a minute. Just imagine you're running a small shop." What follows is a thought experiment, built one problem at a time — no cloud bills, no fancy stack, just a counter, a storeroom, and a lot of common sense. Part 1: The Counter — Your First "API" 👦 Nephew: Uncle, everyone at work keeps throwing around terms — load balancer, cache, index, sharding. I nod along, but I don't actually get any of it. 👨🦳 Uncle: Then don't start there. Close your eyes for a second and forget servers exist. Suppose — just suppose — you're running a small shop. One counter, one small storeroom at the back. A customer walks up and asks for something. What do you do? 👦 Nephew: I'd walk into the storeroom, find it, walk back, hand it over. 👨🦳 Uncle: That's it. That's the entire job of a server handling a request. You don't need to understand Amazon's warehouse to understand Amazon's problems. You need a counter and a storeroom, imagined clearly, and the patience to grow them one honest problem at a time. Here's the shape of what you just described, whether you realized it or not: 🧍 Customer 🧑 You (Counter) 📦 Storeroom (Database) | | | |── "Got Maggi?" ───────>| | | |──── Walk in, search ────────>| | |<─────── Found it ────────────| |<── Hand it over, ──────| | | take payment | | 👨🦳 Uncle: One customer, one request, one trip to the storeroom, one response. This is fine. This is correct , even, for a shop with five customers a day. Don't let anyone tell you a single counter isn't "scalable" — a shop that small doesn't need two counters, it needs someone to stop worrying and open the shutter. 👦 Nephew: So this is just... a server handling one request at a time? 👨🦳 Uncle: Exactly. Customer sen
AI 资讯
🚀 The RAM Disk Revival & In-Memory Architectures
If you ask any senior backend engineer or database administrator how to instantly make a slow, disk-bound application faster, their first answer is almost always: "Put it in memory." But why is memory so preferred, and how do modern architectures utilize RAM to achieve sub-millisecond latencies? We're seeing a massive revival of RAM disks and in-memory architectures. Let's explore why computer experts are increasingly treating RAM like a hard drive. 1. The Physics of Storage: Why RAM Wins To understand the shift towards in-memory architectures, we have to look at the numbers. Hard Disk Drives (HDDs): Mechanical spinning disks. Seek times are around 2-5 milliseconds . Solid State Drives (SSDs): Flash memory. Seek times are around 0.1 milliseconds (100 microseconds) . RAM (Random Access Memory): Volatile silicon. Access times are around 100 nanoseconds . RAM is roughly 1,000 times faster than an SSD and 10,000 to 50,000 times faster than an HDD. When you have a high-throughput system serving millions of requests per second, waiting for a disk to seek is an eternity. 2. In-Memory Databases: Redis and Memcached The most common implementation of this principle in modern backends is the In-Memory Database . How They Work Instead of writing every transaction to an SSD, systems like Redis and Memcached store the entire dataset directly in RAM. This bypasses the OS file system cache, disk I/O bottlenecks, and complex B-tree traversals required by traditional relational databases like PostgreSQL or MySQL. The Trade-off: Durability RAM is volatile. If the server loses power, all data is gone. So how do in-memory databases survive crashes? Snapshots (RDB in Redis): Periodically dumping the entire memory state to disk. Append-Only Files (AOF in Redis): Logging every write operation to a disk sequentially. Sequential writes to disk are significantly faster than random writes. This hybrid approach gives you the read/write speed of RAM with a "good enough" durability guarantee for
AI 资讯
I Finally Read Designing Data-Intensive Applications (2nd Edition) - Here's Why Every Backend Engineer Should
If you've spent any time exploring backend engineering, distributed systems, or system design, you've almost certainly seen one book recommended more than any other: Designing Data-Intensive Applications , or DDIA for short. For years, I've heard experienced engineers describe it as the book that completely changed the way they think about software architecture. When the second edition was released with updated content covering modern distributed systems and cloud-native architectures, I decided it was finally time to see whether it deserved the hype. After reading it from beginning to end, I understand why this book has become a classic. It isn't another programming book that teaches a framework, a database, or a cloud platform. Instead, it teaches something much more valuable: how to think about building systems that continue working when data grows, traffic increases, and failures become inevitable. If you're a backend engineer—or want to become one—this is probably one of the best technical books you can read. This Isn't Really a Database Book The title can be a little misleading. Before opening DDIA, I assumed it would spend hundreds of pages comparing databases or discussing storage engines. Databases are certainly a major part of the discussion, but they're really just one piece of a much larger picture. The book is about designing systems that process enormous amounts of data while remaining reliable, scalable, and maintainable. Those systems happen to rely on databases, but they also involve replication, partitioning, distributed communication, stream processing, fault tolerance, consistency, messaging, and dozens of other architectural concepts that appear in modern software systems. By the end of the first few chapters, it becomes clear that the authors aren't trying to teach products. They're teaching engineering principles that remain useful no matter which technologies you're using. It Explains Why , Not Just How One of my favorite things about DDIA is
开发者
GraphQL Query & Mutation Architecture, A Production Deep Dive
Author: Erwin Wilson Ceniza Published: July 2, 2026 Tags: GraphQL | HotChocolate | BatchDataLoader | CQRS | Outbox Pattern | Apollo Federation | .NET | Architecture | EMR | API Design GraphQL Query & Mutation Architecture - A Production Deep Dive Code-first GraphQL with HotChocolate, BatchDataLoader, CQRS, and a transactional outbox pattern, with real examples from a production EMR system serving three portals from a single schema. Table of Contents Interactive Data Traversal The Architecture at 30,000 Feet Why GraphQL Won for Healthcare Data Shapes Simple Queries vs. Complex REST, The Comparison That Sold Me The Resolver Layer, Code-First, Schema-Last How GraphQL Smoothly Orchestrates the Application Services N+1 Is the Silent Killer, How BatchDataLoaders Eliminate It Mutation Architecture - CQRS + Transactional Outbox Security at the Resolver Level, Custom Middleware Attributes Type Extensions, Why I Stopped Writing DTO Mappers Projections, Filtering, Sorting, and Paging Apollo Federation, Future-Proofing the Graph GraphQL Client on Mobile, Sharing Query Logic Across Portals Why I Chose Ionic for the Patient Mobile App The Retrospective, What I'd Keep and What I'd Change A step-by-step walkthrough of how the app consumes (reads) and creates (writes) data through the services. interactive <script type="module"> const C = document.currentScript.parentElement; C.style.cssText='width:100%;font-family:system-ui,-apple-system,sans-serif'; const S = document.createElement('style'); S.textContent=` .gv *{box-sizing:border-box;margin:0;padding:0} .gv{background:var(--bg-secondary,#111);border-radius:12px;overflow:hidden;border:1px solid var(--border,#333);min-height:440px} .gv-tabs{display:flex;border-bottom:1px solid var(--border,#333);background:var(--bg-card,#1a1a1a)} .gv-tab{flex:1;padding:12px 8px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;cursor:pointer;border:none;background:none;color:var(--text-muted,#666);transition:all .2s;border