今日已更新 133 条资讯 | 累计 37382 条内容
关于我们

标签:#systemd

找到 126 篇相关文章

AI 资讯

trelix v2.11.0 to v3.1.1: Six Feature Areas, Every One of Them Off By Default

Seed three events into an audit database, then reach past the application and change one row by hand: $ sqlite3 audit.db "UPDATE audit_log SET principal='attacker' WHERE id=2" $ trelix audit verify --db audit.db Audit chain TAMPERED — first divergent entry id: 2 $ echo $? 1 Delete the newest row instead and it still catches it, naming id 3, even though the surviving rows form a perfectly valid chain. Point it at something SQLite cannot open and it exits 2 rather than 0, because "I could not check" and "I checked and it is clean" must never collapse into the same green build. None of that existed six releases ago. trelix audit verify is one command out of six feature areas that landed in trelix v3.0.0, and it is the one that most changes what the project is for. What the major bump actually is The span from v2.11.0 to v3.1.1 is six releases — v2.11.1, v2.12.0, v3.0.0, v3.0.1, v3.1.0 and v3.1.1, the last of them dated 2026-08-15 — 68 commits, 137 files changed, +19,829/-1,211 lines. v2.11.0 closed out the Jira and Linear connector work, which has its own story. Everything after it is a different kind of release. v3.0.0 carries six new feature areas: Anthropic extended thinking, a model-aware context budget, a VS Code extension that acts instead of merely displaying, a hash-chained append-only audit trail, OIDC SSO, and query-conditioned context compression. Alongside them, an opt-in FTS5 declaration boost for keyword ranking. It is a major bump because of scope, not breakage. Every one of those six is additive and off by default: TRELIX_AUDIT_ENABLED=false , TRELIX_OIDC_ENABLED=false , TRELIX_LLM_THINKING_ENABLED=false , TRELIX_RETRIEVAL_COMPRESSION=false , declaration_boost_enabled False, and context_token_budget still the exact 12_000 integer it was in v2.12.0. A default v3.0.0 install assembles context byte-identically to a default v2.12.0 install, and there is a test that proves it rather than a release note that asserts it. An audit trail you can hand to somebody

2026-08-15 原文 →
AI 资讯

Token Bucket vs. Sliding Window: Building Rate Limiters That Actually Hold Under Load

Rate limiting sounds like a solved problem until you actually implement one and watch it fail in a way your load test didn't predict: legitimate bursts getting rejected, or a limiter that lets through 2x its stated limit at window boundaries. The failure modes are specific enough that it's worth working through the two dominant algorithms — token bucket and sliding window — with actual code, not just the diagrams. The problem with fixed windows The naive approach almost everyone reaches for first is a fixed window counter: pick a window size (say, 60 seconds), count requests in that window, reset the counter when the window rolls over. import time class FixedWindowLimiter : def __init__ ( self , limit : int , window_seconds : int ): self . limit = limit self . window_seconds = window_seconds self . count = 0 self . window_start = time . time () def allow ( self ) -> bool : now = time . time () if now - self . window_start >= self . window_seconds : self . window_start = now self . count = 0 if self . count < self . limit : self . count += 1 return True return False This is simple and cheap, and it's also broken in a specific, exploitable way. Say the limit is 100 requests/minute. A client can send 100 requests in the last second of window N, then another 100 in the first second of window N+1. That's 200 requests in roughly two seconds, well within the letter of "100/minute" as the code enforces it, but nowhere near the spirit of it. This is the classic boundary-burst problem, and it's the reason fixed windows get replaced once traffic is adversarial or bursty enough to find the seam. Sliding window: smoothing the boundary A sliding window log fixes this by tracking actual timestamps instead of a single counter, and counting how many fall within the trailing window at the moment of the request: from collections import deque import time class SlidingWindowLogLimiter : def __init__ ( self , limit : int , window_seconds : float ): self . limit = limit self . window_seco

2026-08-14 原文 →
AI 资讯

What Permit Files Can Teach Us About Reliable Workflow Software

Paperwork-heavy workflows rarely fail because a database cannot store another PDF. They fail because the system loses the relationship between the document, the real-world object, the decision it supports, and the stage of work it represents. Permits provide a useful example. A complete project record is not one uploaded form. It is an evidence chain that changes over time. A recent Local Service Ledger guide to Pasco County septic-repair records organizes the file into eight stages: property, existing system, site, pump-out, water and sewer, application, permit, and closeout. The guide's most important software lesson is that a receipt or contractor proposal alone does not establish the complete chain from reported problem to final recorded status. That distinction generalizes well beyond permits. 1. Give every workflow a stable subject Every document should attach to a stable entity: a property, customer, asset, case, project, or account. Do not rely on a filename or free-form address as the only identifier. Normalize enough data to prevent obvious duplication, preserve the source value, and retain a stable internal ID. For a property workflow, several records may contain slightly different owner names or address formatting. The system should help a reviewer determine whether they refer to the same site without silently overwriting those differences. 2. Separate observations, proposals, and decisions These are different kinds of facts: an owner reports a symptom; a contractor proposes a scope; an authority authorizes specific work; an inspector records a result; a final status closes the file. Collapsing them into one “project description” field destroys provenance. Model the actor, date, source, and status of each statement. The interface can display the current operational summary while preserving the earlier language that explains how the record evolved. 3. Make state transitions explicit A reliable workflow should not infer completion because a document exists

2026-08-14 原文 →
AI 资讯

UPI at Scale: Handling Millions of Payments

Imagine this: It's salary day. It's 2 PM. Millions of people across India suddenly open their UPI apps and start paying rent, sending money to family, paying credit-card bills, and shopping online. Now here's the system-design interview question: If millions of people make payments at almost exactly the same time, is every request hitting one central server? What prevents the entire payment system from freezing? At first glance, it sounds like a scaling problem. It isn't just a scaling problem. It's a combination of: horizontal scaling concurrency distributed systems database consistency retries idempotency backpressure failure isolation downstream bottlenecks And that's what makes payment systems such an interesting system-design problem. First: Don't Imagine One Giant UPI Server A common mental model looks like this: Millions of users | v +-------------+ | UPI Server | +-------------+ | v Bank If that were literally true, we'd have a pretty serious problem. One machine cannot safely process the country's entire payment traffic. Instead, think about a distributed system: Users | v +---------------+ | API / Gateway | +---------------+ / | \ / | \ v v v [S1] [S2] [S3] | | | +------+------+ | Payment Services | +--------+--------+ | | Bank A Bank B The exact implementation of a real payment network is much more complicated than this diagram, but this is the right system-design mental model . The important idea is: The system is distributed across many machines and participating institutions. Step 1: The First Problem — Traffic Spikes Let's take a concrete example. You want to pay your landlord: ₹25,000 At the same moment, millions of other people are doing something similar. Suddenly: Normal traffic: 100K requests/sec Salary day: ████████████████████████ 1M+ requests/sec The first question is: How do we handle the additional traffic? Naive Solution: One Powerful Server We could buy a massive machine. 1M requests/sec | v +---------------+ | HUGE SERVER | | 256 CPU core

2026-08-13 原文 →
AI 资讯

Introduction to the Cloud-Native World with Azure Kubernetes Services (AKS) - Series Part 3

n today's world of cloud-native development, businesses require powerful, scalable, and flexible platforms that help developers efficiently build and operate their applications. An Internal Developer Platform (IDP) based on Azure Kubernetes Services (AKS) provides an optimized environment that brings together all the key components for modern software engineering. This article explains how to develop such a platform using AKS, what key components are required, and how to integrate them optimally. What is an Internal Developer Platform (IDP)? An internal developer platform is a set of tools, processes, and automations provided to developers to simplify the entire software development process. It offers a standardized environment where developers can write, test, and deploy code without worrying about the infrastructure or underlying complexities. An IDP built on Azure Kubernetes Services (AKS) also allows for the operation of containerized applications in a fully managed, highly available, and scalable environment. Core Components of a Development Platform on AKS When building an internal developer platform based on AKS, several key components ensure an efficient and robust system. Here are the essential elements: Azure Kubernetes Services (AKS) as the Central Platform AKS forms the core of the development platform. It provides a scalable and managed Kubernetes environment where all containerized applications run. With full integration into other Azure services, developers can access a wide range of tools to efficiently manage, monitor, and scale their workloads. Service Mesh for Managing Microservices Communication In a microservices architecture, which is commonly used in modern cloud-native applications, communication between services plays a crucial role. A Service Mesh like Istio or Linkerd enables the management and monitoring of this communication. It provides features such as load balancing, traffic management, security policies, and monitoring for microservi

2026-08-12 原文 →
AI 资讯

Polling vs. Webhooks vs. WebSockets vs. SSE: Choosing the Right Real-Time Architecture

API design patterns API event architecture API integration strategies API latency comparison API performance optimization API resource efficiency asynchronous API architecture automated API triggers backend architecture bidirectional API communication developer guide API event architecture event driven API design event driven architecture event driven webhooks HTTP long polling vs webhooks HTTP polling vs websockets HTTP request response vs sockets InstaWebhook microservices event communication polling overhead polling vs webhooks polling vs websockets publish subscribe architecture pub sub vs webhooks real time API integration real time communication protocols real time data streaming protocols real time notification architecture real time web applications REST API vs webhooks REST API vs websockets scalable API architecture server push technology server sent events vs webhooks short polling vs long polling socket connection vs webhooks software engineering API design webhook architecture webhook delivery system webhook infrastructure webhook listener webhook payload delivery webhooks best practices webhooks vs sockets vs polling comparison webhooks vs websockets websocket architecture websocket client server architecture websocket full duplex web sockets vs long polling when to use API polling when to use webhooks when to use websockets Polling Vs Webhooks Vs Web Sockets Vs SSE Choosing The Right Real Time Architecture Polling vs. Webhooks vs. WebSockets vs. SSE: Choosing the Right Real-Time Architecture Choosing how your systems communicate state changes is one of the most consequential decisions in API design. Whether you're building a notification engine, integrating a payment gateway, or streaming an LLM response token-by-token, the communication pattern you pick determines your app's latency, your infrastructure bill, and how much operational complexity you sign up for. Client-server systems started with a simple request-response loop: the client asks, the se

2026-08-10 原文 →
AI 资讯

Architectural Foundation: The Host-Guest Split

A compiled application cannot hot-reload itself if its main loop, window context, and memory allocations live inside the binary being recompiled. The application must be split into two layers:Host Shell (Stable Execution Root):Statically compiled once.Manages the OS window, render loop, event polling, network sockets, and high-level heap allocations.Exposes a dynamic symbol loader (dlopen / LoadLibrary or a dynamic WebAssembly runtime execution context).Guest Module (Hot-Swappable Logic):Compiled as a shared dynamic library (.so, .dylib, .dll) or an isolated WebAssembly (.wasm) module.Contains frame updates, business rules, rendering instructions, and component tree logic.Exports explicit interface hooks (init, update, render, pre_reload, post_reload).The Hot-Reload PipelineWhen a developer edits source code in a compiled language (e.g., modifying a Rust UI render function or a C# algorithm), the dev server orchestrates a zero-downtime swap through this explicit pipeline:1.File Watcher & Fast Incremental Compile:Sub-second artifact generation.The watcher detects source changes and invokes an incremental compilation pass using dynamic linking configurations (e.g., -rdynamic, dynamic C-runtime links, or fast lld/mold linkers) to output a versioned binary artifact (logic_v2.so).2.Live Manifest Update:Atomic state & symbol mapping emit.The dev server emits an updated JSON manifest containing module hash, exposed symbol tables, binary payload locations, and updated asset hashes over a WebSocket/IPC stream to the Host Shell.3.State Snapshot & Freeze:Preserving user context.The Host Shell signals pre_reload() to the currently loaded logic_v1.so. The guest logic serializes volatile runtime state into a host-managed memory buffer or leaves pointers active inside a host arena.4.Dynamic Unload & Library Swap:Operating system symbol rotation.The Host Shell unloads logic_v1.so (releasing file locks via temporary copy paths on OS platforms like Windows), loads logic_v2.so, and re

2026-08-10 原文 →
AI 资讯

Introduction to the Cloud-Native World with Azure Kubernetes Services (AKS) - Series Part 2

Digital transformation has led companies to organize their infrastructure and development processes in entirely new ways. To address the challenges of modern cloud-native applications, concepts like Platform Engineering are gaining increasing importance. Especially in environments using Azure Kubernetes Services (AKS) , platform engineering plays a crucial role in efficiently managing and scaling containerized applications. What is Platform Engineering and Why is it Important? Platform engineering is the process of designing, implementing, and managing internal platforms that provide developers with a stable and efficient environment. These platforms bundle all the necessary resources and services to ensure smooth development and operation of applications. A well-developed platform engineering team ensures that recurring tasks are automated, allowing developers to focus on writing code without dealing with the underlying infrastructure. In a container environment like AKS, automation and standardization are critical. Platform engineering provides the framework to simplify these complex workflows. How Does Platform Engineering Support AKS Deployments? A key advantage of platform engineering is the ability to standardize the entire lifecycle of applications—from development to testing and deployment. When working with AKS, the main task of the platform engineering team is to create a seamless and scalable environment for container orchestration. Here are some key aspects of how platform engineering supports AKS: Standardizing and Automating Deployments Platform engineering enables the automation of Kubernetes cluster deployments in AKS using best practices and tools such as Infrastructure as Code (IaC) (e.g., Terraform or Azure Resource Manager templates). This automation reduces human errors and accelerates the time needed to deploy applications in production environments. Self-Service Platforms for Developers A well-designed platform engineering team builds self-ser

2026-08-10 原文 →
AI 资讯

Your Users Shouldn't Have to Wait: Learn Message Queues

This is Part 10 of my "From One User to One Million" series, where we'll build an understanding of System Design by following a simple application as it grows from a single user to millions. Instead of memorising technologies, we'll learn why they exist by solving real problems as they appear. In Part 9, we solved the problem of data that had grown too large for a single database. We split it across multiple shards, each holding its piece of the whole, so that no single machine ever had to carry everything. At that point, the architecture could scale in almost every direction we'd tried to push it. Traffic was distributed across application servers. Repeated database work was absorbed by the cache. Read traffic was spread across replicas. Data itself was partitioned across shards. And yet. We ended Part 9 by noticing something that none of those solutions addressed. Some user requests trigger a lot of downstream work. Saving an order is one thing. But saving the order, sending a confirmation email, generating an invoice, updating inventory, firing off a notification, recording an analytics event, triggering the recommendation engine: that's an entirely different conversation. Right now, all of that happens before the user gets a response. The question we left with was this: what if they didn't have to wait for all of it? -- Section 1: The User Doesn't Need Everything Right Now Before we look at any solution, it's worth asking a simpler question. When a user places an order, what do they actually need to know before they can move on? They need to know the order was received. They need confirmation that the important thing happened: their money was accepted, their items are reserved, the transaction is real. That's it. That's what they're waiting for. They do not need to wait for the confirmation email to land in their inbox. They do not need to wait for the invoice to be generated and stored somewhere. They do not need to wait for the analytics system to record that

2026-08-09 原文 →
产品设计

Verify before you break the lock

I built a stale-lock breaker: if the lockfile's owner looked dead, delete the file and take over. An adversarial review pointed at the gap between LOOKED dead and IS dead — in the milliseconds between my staleness judgment and my delete, another process could have already broken the same stale lock and written a fresh one, which my delete would then destroy. Two owners, both convinced they won. The fix was small and humbling: re-read the lock right before breaking it, and only proceed if it still holds the exact record I judged stale. Every check-then-act on shared state has a gap in the middle, and the gap doesn't care how fast your code is. Re-validate at the moment of the irreversible act, not just before it.

2026-08-08 原文 →
开发者

LLD Design Patterns: How We'll Learn Design Patterns Throughout This Series

So far in this mini-series, we've answered the biggest questions that confuse developers when they first encounter Design Patterns. We've learned: why SOLID isn't the final destination, why recurring design problems exist, why copying code doesn't create good design, what Design Patterns really are, how experienced engineers recognize them, and how every pattern can be understood through its Problem, Intent, Solution, and Consequences . Now it's time to answer one final question before we begin exploring the individual patterns. How should we learn Design Patterns so that we can actually use them in real-world software instead of just recognizing their names? The answer may surprise you. We're not going to learn Design Patterns the way they're usually taught. The Traditional Way of Learning Design Patterns Open almost any Design Patterns book or tutorial, and you'll often see something like this. Pattern Name ↓ Definition ↓ UML Diagram ↓ Code Example ↓ Advantages ↓ Disadvantages Technically, there's nothing wrong with this approach. But many developers finish reading the chapter and still wonder: "When would I ever use this?" That's because they learned the solution before understanding the problem. It's like learning how to use a fire extinguisher before understanding what kinds of fires it can safely put out. Knowledge without context is difficult to apply. The Way Experienced Engineers Learn Experienced engineers don't begin with the pattern. They begin with the software. They observe where the current design starts struggling. Only then do they search for a better design approach. Their thinking looks more like this. Business Requirement ↓ Design Challenge ↓ Current Design Starts Breaking ↓ Understand Why ↓ Explore Better Design ↓ Recognize a Design Pattern The pattern is never the starting point. It's the result of understanding the problem. The Learning Framework We'll Use Every pattern in this series will follow exactly the same structure. Business Problem ↓

2026-08-08 原文 →
AI 资讯

SNS vs SQS vs Kinesis vs MSK vs EventBridge vs RabbitMQ: An Architect's Decision Matrix

By Swetha Golla · 8 min read · Senior Application Architect 🔗 This post has a live interactive version with a clickable per-service verdict and the full comparison matrix: read it here TL;DR Need strict per-key ordering and replay? That's a log, not a queue — Kinesis or MSK. Pick MSK if you need real Kafka wire-protocol compatibility (existing clients, Kafka Streams, ksqlDB, Debezium); pick Kinesis if you'd rather AWS own shard mechanics and you're fine with its API. Need routing logic based on event content, not raw throughput? EventBridge — pattern-matching rules to many differently-interested targets, not identical delivery to everyone. Need a simple durable buffer between one producer and one consumer group? SQS. Need the same message fanned out to many independent subscribers? SNS — often paired with SQS underneath. Already running RabbitMQ, or need AMQP-specific routing? Amazon MQ for RabbitMQ is a lift-and-shift, not a rearchitecture. The expensive mistake isn't picking a slightly-suboptimal service — it's picking a queue when you needed a log, or the reverse. That's a rewrite, not a config change. The setup Scope note: this is a decision matrix for AWS's own catalog, not a survey of every messaging technology that exists. Self-hosted Kafka, Google Pub/Sub, Azure Service Bus, NATS, Pulsar, and plenty of others solve overlapping problems outside AWS's walls — worth knowing about, out of scope here. A platform team is replacing a single overloaded RabbitMQ broker that has become the answer to every "how do services talk to each other" question for three years running: order events, fraud signals, audit trails, third-party webhooks, and a slow-growing analytics pipeline all queue through it. It works, until it doesn't — a queue depth spike during a promotion in 2025 backed up every consumer behind it, including ones that had nothing to do with the promotion. The team's instinct is to "move it all to AWS-native," as one service. That instinct is the mistake. Thes

2026-08-06 原文 →
开发者

LLD Data Structures in Design Context: Trie — A Data Structure Designed for Prefix Search

"A Trie isn't designed to store words. It's designed to make finding everything that shares the same beginning incredibly efficient." In the previous article, we explored a different kind of software problem. Some systems don't search using complete values. Instead, users provide only part of the information they know. The system must immediately suggest possible matches. Once you recognize that requirement, another question naturally follows. How should the system organize data so prefix searches become fast and natural? This is exactly the problem a Trie solves. Think About a Dictionary Imagine opening a physical dictionary. Suppose you're looking for the word: Application Do you start reading from page one? Of course not. You first go to the words beginning with: A Then you narrow further. Ap Then: App Every additional letter reduces the search space. A Trie works in a very similar way. Instead of repeatedly searching through every word, it follows the characters one by one. What Is a Trie? A Trie is a tree-like data structure where each node represents a character. Words that begin with the same characters share the same path. Consider these words. car card care cart A Trie stores them like this. Root ↓ c ↓ a ↓ r ├── end ├── d → end ├── e → end └── t → end Notice something interesting. The prefix: car is stored only once. Every longer word simply continues from that shared path. Every Data Structure Answers a Different Question By now we've seen several data structures, each solving a different design problem. A HashMap asks: Where is this exact object? A Heap asks: Which item has the highest priority? A Queue asks: Which task should happen next? A Stack asks: What is the current working context? A Trie asks: What begins with these characters? Choosing the right data structure starts with identifying which question your software needs to answer. Inserting a Word Imagine inserting: cat The Trie creates a path. Root ↓ c ↓ a ↓ t Now insert: car The beginning alread

2026-08-05 原文 →
AI 资讯

Fast... But Wrong? Meet Cache Invalidation

This is Part 7 of my "From One User to One Million" series, where we'll build an understanding of System Design by following a simple application as it grows from a single user to millions. Instead of memorising technologies, we'll learn why they exist by solving real problems as they appear. Last time, we ended on a question that sounded simple but isn't. Aisha updated her profile picture. Her new photo is now saved in the database. But the cache is still holding onto the old one, completely unaware that anything changed. So every request for Aisha's profile gets served the old data. Confidently. Instantly. Incorrectly. How does a cache know when the data it's holding is no longer correct? Think about what we've actually built at this point. We have an application that responds fast, scales horizontally, and avoids hammering the database with repeated identical queries. From a performance standpoint, it looks great. But Aisha's friends are loading her profile and seeing a photo she replaced five minutes ago. The system isn't slow anymore. It's wrong. Speed and correctness are two different things. We optimized hard for one, and quietly broke the other. Engineers have a name for this problem: cache invalidation . It refers to the challenge of keeping the data in your cache consistent with the data in your database, as that underlying data changes over time. It turns out to be one of the genuinely hard problems in building software systems. Not hard in a complicated-algorithm way. Hard in the way that every solution has a catch, and the right answer always depends on what you're willing to accept. Let's think through it together. -- Section 1: When Cached Data Lies It's worth sitting with the problem a little longer before rushing to fix it, because the damage stale data can cause varies enormously depending on what's being cached. Consider a few examples. Your application caches the list of trending articles. An hour later, the list has changed. New articles have ri

2026-08-05 原文 →
AI 资讯

LLD Data Structures in Design Context: Stack — Understanding Last In, First Out Through Design

"A Stack isn't designed to store data. It's designed to make the most recent piece of work the easiest to access." In the previous article, we discovered a new kind of design problem. Some systems don't need to find the fastest item. Some don't need to process tasks in arrival order. Instead, they need to work with whatever happened most recently . That's exactly the problem a Stack solves. In this article, we'll understand how a Stack works and why its behavior appears naturally in many software systems. Imagine a Stack of Plates Think about a stack of dinner plates. Plate 4 ────────── Plate 3 ────────── Plate 2 ────────── Plate 1 ────────── When you need a plate, which one do you take? The one on the top. You don't pull out the bottom plate. Likewise, when placing a new plate, you put it on top. This simple rule defines the behavior of a Stack. What Is a Stack? A Stack is a data structure where both insertion and removal happen from the same end. The last item added is always the first one removed. This behavior is called LIFO (Last In, First Out). Push A ↓ Push B ↓ Push C ↓ Pop ↓ C Notice something important. A Stack isn't trying to preserve arrival order like a Queue. Instead, it preserves recency . The newest item is always the easiest to access. Every Data Structure Solves a Different Design Problem By now, we've seen several data structures, each answering a different question. A HashMap asks: Where is this object? A Heap asks: Which item has the highest priority? A Queue asks: Which task has been waiting the longest? A Stack asks: What happened most recently? Choosing the right data structure begins with identifying which of these questions your system needs to answer. Push and Pop Stacks are built around two simple operations. Push Adding a new item. Before Top ↓ B ↓ A Push C After Top ↓ C ↓ B ↓ A Pop Removing the most recent item. Before Top ↓ C ↓ B ↓ A Pop After Top ↓ B ↓ A Only the top item is removed. Everything below remains untouched. Real-World Examp

2026-08-04 原文 →
AI 资讯

Designing a Form Engine from Zero to One

Author: Skydu Summary: A form engine may look like the most basic capability in a low-code platform, but it is really the entry point for business modeling, data structure, permissions, workflows, and future AI understanding. Opening In the previous post, I wrote about why INFORMAT is not meant to be only a low-code tool. Starting from this post, I want to go into specific modules. The first module I want to write about is the form engine. The reason is simple: in a low-code platform, forms look basic, but a form is not just a page. Many enterprise business systems begin with a form. Customer registration, contract approval, project initiation, purchase requests, inventory receiving, equipment inspections, and production reporting are all, at their core, ways to collect, organize, and move business data. So a form engine is not about dragging a few input boxes onto a canvas. It is the entry point for the platform's business modeling capability. The initial requirement looked simple Before building the form engine, my most straightforward idea was this: users should be able to create business forms, configure fields, and let the system automatically generate data-entry pages and data lists. That idea does not sound complicated. A form name, a group of fields, a save button, and a data list seem like enough. But once implementation begins, a series of questions appear quickly. What field types should exist? Can fields be grouped? Can fields depend on each other? Should data be validated? Should a workflow be triggered after submission? Can different people see different fields? How will form data be used by reports, automation, and AI? When these questions stack together, the form engine stops being only a frontend component. It becomes a core module that connects the data model, permission system, workflow system, and automation system. A form is not a page, but a business model I gradually became more certain of one judgment: forms in a low-code platform should not

2026-08-04 原文 →
AI 资讯

How I Segmented Millions of Users in Just a Few Milliseconds

User segmentation requirement Imagine you need to send a push notification to users who satisfy all of the following conditions: Push notification is enabled User is a VIP Active within the last 30 days Following the Voucher Hot category The traditional approach is to query multiple tables: SELECT DISTINCT u . id FROM users u JOIN user_configs c ON c . user_id = u . id JOIN devices d ON d . user_id = u . id JOIN follows f ON f . user_id = u . id WHERE c . push_optin = 1 AND c . mute = 0 AND d . fcm_token IS NOT NULL AND f . category = 'voucher_hot' AND u . last_active >= NOW () - INTERVAL 30 DAY ; As your user base grows into the millions, every campaign requires joining multiple large tables, filtering millions of records, and repeatedly computing the same audience. Query latency increases significantly, making real-time segmentation increasingly difficult. A Different Approach Instead of querying the database every time, we precompute each boolean attribute as a bitmap. Think of a bitmap as a huge array containing only 0 and 1, where the index corresponds to the user ID. For example, a bitmap representing whether a user has enabled push notifications: User ID : 0 1 2 3 4 5 6 7 Bitmap : 1 0 1 1 0 0 1 1 To check whether user 123 has enabled notifications, simply read bit 123. 1 → enabled 0 → disabled Each bitmap represents exactly one boolean property: bitmap:push_optin bitmap:vip bitmap:active30 bitmap:follow:voucher_hot Memory Usage Bitmap is extremely memory efficient. Each user requires only one bit. For 1 million users: 1.000.000 bits ~ 125.000 bytes ~ 122 KB That means every segment only consumes about 122 KB of Redis memory. Even 100 different segments require only around 12 MB . Finding Intersections Suppose you want all users that are: VIP AND Push Opt-in AND Active30 AND Following Voucher Hot Redis can calculate the result with a single command: BITOP AND result vip push_optin active30 follow_voucher_hot Need the number of matched users? BITCOUNT result No

2026-08-03 原文 →
AI 资讯

Why Documentation Is Architecture

Most of the engineers consider documentation as an after-thought; a README on a finished system written in the final 20 minutes before a PR gets merged. That's the wrong way to do this relationship. Documentation is not a description of architecture. It is part of the architecture, and marking it as separate is the cause of so many rotting systems, which still pass all tests. The compiler doesn't care, your team does It could be a consistent codebase and yet it be undocumented garbage from the point of view of anybody who didn't write it. Only one sort of correctness is enforced by the compiler (or interpreter): does this code perform the operation that the instructions say it performs. It doesn't weigh in on why a specific table contains a deleted_at column, versus a hard delete, or why a service tries 3 times with exponential back-off, versus 5 times with a fixed interval. Those decisions include constraints that are not apparent in the diff, regulatory, historical, or performance. If these are only in the mind of the programmer who wrote them, the actual architecture is partially undocumented, and these constraints will be breached as soon as someone else messes with the code when it is under a tight deadline. Architecture is not only the shape of your services and schemas, it's the set of decisions and constraints that shape stayed within. Undocumented constraints are like walls that we don't see, or know about. They are walked through without anyone knowing they exist, and one of the assumed conditions is broken at a time. Documentation as a design artifact, not a report Good documentation should be done prior to and/or in the midst of implementation, not after. When writing a design doc that explicitly states the problem, the options you considered, the one you selected, and the tradeoffs you made, you are actually doing real design work, you are making mistakes in your thinking process that would only become apparent during production. There have been more ti

2026-08-02 原文 →
AI 资讯

LLD Data Structures in Design Context: The Heap Property — The Simple Rule That Makes Heaps Powerful

"A Heap doesn't stay useful because everything is sorted. It stays useful because every parent follows one simple rule." In the previous article, we learned that a Heap is built for continuous decision-making. Whether it's assigning the nearest driver, scheduling the next process, or selecting the most urgent support ticket, the system always needs one thing: The next best candidate But that raises an interesting question. How can a Heap always know the best candidate without sorting everything? The answer lies in one simple rule: The Heap Property. This single rule is what gives a Heap its power. The Biggest Misconception About Heaps Many beginners imagine a Heap like this. 100 95 90 82 76 64 51 Everything perfectly sorted. It feels logical. If the largest element should always come first, shouldn't every element be arranged in order? Surprisingly, no. A Heap solves a much smaller problem. It only guarantees that the best element is always easy to reach . Everything else only needs to follow one simple relationship. Imagine a Company Hierarchy Think about the structure of a company. CEO ↓ Engineering Director ↓ Engineering Manager ↓ Software Engineer The CEO doesn't directly manage every employee. Instead, each manager is responsible only for the people immediately below them. The entire organization works because every manager fulfills their local responsibility. A Heap works in a very similar way. Every node only needs to maintain the correct relationship with its immediate children. It doesn't need to know about every other node in the structure. The Heap Property Let's look at a Max Heap. 100 / \ 90 80 / \ / \ 75 60 70 50 Notice the pattern. Every parent has a value greater than or equal to its children. That's the Heap Property. Parent ≥ Children That's it. There is no rule saying that every node must be greater than every other node in the Heap. Only the parent-child relationship matters. What About a Min Heap? Some systems want the smallest value first. For

2026-08-01 原文 →
AI 资讯

LLD Data Structures in Design Context: Heap — A Data Structure Built for Continuous Decision Making

"A HashMap helps you find what you already know. A Heap helps you decide what should happen next." In the previous article, we discovered that not every software problem is about finding a specific object. Sometimes, the system already knows exactly what it's looking for. Find User ID = 1024 ↓ Return User Other times, the system doesn't know the answer in advance. Instead, it has to repeatedly answer questions like: Which task should run next? Which driver should be assigned? Which customer should be served first? Which alert is the most critical? These are fundamentally different problems. Instead of retrieving an object, the system is making a decision. This is where a Heap comes in. A Heap Is Built for Decisions, Not Searches Imagine you're managing a hospital emergency room. Patients keep arriving throughout the day. Patient A Minor Injury Patient B Heart Attack Patient C Broken Arm Patient D High Fever Should doctors treat patients in the order they arrived? Probably not. Instead, they ask one question. Who needs treatment first? Notice something important. The hospital isn't searching for a particular patient. It's choosing the highest-priority patient. A Heap is designed for exactly this kind of problem. A Different Way of Thinking When beginners hear "data structure," they often think about storing data. Experienced engineers think differently. They ask: "What operation does my system perform repeatedly?" If the answer is: Find User Find Order Find Product that's a lookup problem. But if the answer is: Choose Highest Priority Choose Nearest Driver Choose Earliest Deadline that's a decision problem. A Heap is optimized for continuous decision-making. What Exactly Is a Heap? A Heap is a data structure that keeps the most important element immediately available. Depending on the system, "most important" can mean different things. For example: Highest priority Lowest cost Earliest deadline Highest score Closest driver Most urgent ticket The Heap doesn't decide w

2026-08-01 原文 →