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

标签:#systemd

找到 126 篇相关文章

AI 资讯

What Is Precision Tracking Radar? A Developer’s Guide to Continuous Target Tracking

What Is Precision Tracking Radar? Precision tracking radar is an active radar sensing system designed to repeatedly measure a selected target and maintain an updated estimate of its state over time. For developers, the important distinction is that precision tracking is not simply repeated target detection. Detection answers: Is there evidence of a target in the current radar measurements? Tracking answers: Does this new measurement belong to an existing target, and how should that target state be updated? A practical precision tracking pipeline can be represented as: RF sensing → target measurement → detection → association → state update → continuous track → mission output That makes precision tracking radar a real-time data-processing system as much as an RF sensing system. A Practical Definition Precision tracking radar is a radar capability that combines repeated target measurements across time to maintain a continuous estimate of target position, motion or other relevant state information. The key word is continuous. A detector can operate independently on each radar update. A tracker has memory. It maintains information from previous measurements and decides how new observations relate to that history. From a software architecture perspective, tracking introduces persistent state into the sensing pipeline. Detection and Tracking Should Be Separate Services A useful radar architecture keeps target detection and target tracking logically separate. The detector processes current radar measurements. The tracker consumes target-related measurements over time. Conceptually: Radar measurement ↓ Detection ↓ Measurement object ↓ Association ↓ Track update ↓ Track state This separation helps developers understand where errors originate. If the detector produces unstable measurements, the tracker cannot fully repair them. If detections are stable but tracks switch between targets, the problem may exist in association. If sensor-relative detections are correct but missio

2026-08-29 原文 →
AI 资讯

Webhooks vs Polling: Why Real-Time Integrations Matter in 2026

Webhooks vs Polling: Why Real-Time Integrations Matter in 2026 In modern software, knowing that something happened is often just as important as knowing what happened. A customer completes a payment. An order changes from pending to shipped. A user creates an account. A GitHub pull request is opened. A subscription is renewed. An AI workflow needs to start processing a new request. The question is simple: How does your application know that something changed? For years, developers have relied on two common approaches: polling and webhooks. Both solve the same fundamental problem—keeping systems synchronized—but they do it in completely different ways. Polling repeatedly asks an API whether something has changed. Webhooks allow the external system to notify your application when something actually happens. That difference can have a major impact on performance, scalability, API usage, responsiveness, reliability, and overall system architecture. And as applications become increasingly connected in 2026, understanding when to use each approach is more important than ever. What Is Polling? Polling is the traditional approach to checking for changes. Your application periodically sends a request to another system: “Has anything changed?” For example, imagine an e-commerce application that needs to know when an order has been paid. It might call an API every 30 seconds: GET /orders/12345 The response might say: status: pending Thirty seconds later, the application asks again. Then again. And again. Eventually: status: paid The application finally discovers that the payment has been completed. The basic workflow looks like this: Application → API → “Anything new?” API → Application → “No.” Thirty seconds later: Application → API → “Anything new?” API → Application → “No.” Eventually: Application → API → “Anything new?” API → Application → “Yes, the order has been paid.” The approach is straightforward and easy to understand. But there is a problem. Most of those requests

2026-08-28 原文 →
AI 资讯

Retries Are Not a Recovery Strategy

A retry answers a narrow question: might the same operation succeed if I attempt it again? Recovery has a harder job. It must bring the original business operation to a known, valid outcome after something went wrong. Getting there may require another attempt, a status lookup, resuming from persisted state, or compensation. If the system cannot resolve the operation safely, it must hand it to a person. This difference matters as soon as an AI workflow does more than return text. If it retrieves data, calls tools, writes state, or continues after the HTTP request ends, adding three retries around the workflow is not a recovery design. It is three more chances to spend money, repeat a side effect, or lose track of what already happened. A retry repeats an attempt Suppose a support feature performs this workflow: load the ticket and approved policy -> generate a reply -> validate the reply -> save it as a draft The policy read returns 503 Service Unavailable with an applicable Retry-After response, and the dependency contract classifies it as transient. No application business state changed, and the request still has time left. A delayed retry may be reasonable. Now suppose the draft save times out after the request reached the database. The caller cannot tell whether the write committed. Repeating the complete workflow creates a new model response and may save a second draft. Retrying only the write is safe when the write is naturally idempotent, or when the boundary can recognize the retry as the same logical operation. Otherwise, the second attempt may create another draft. Both failures may appear as a timeout or dependency exception in application code. They do not have the same effect. What happened What is known Suitable response A transient policy read failed before returning data No application business state changed Retry the read within its budget The model endpoint rejected an invalid request The same request will fail again Stop and fix the request or cont

2026-08-27 原文 →
AI 资讯

Stop Designing Agentic AI Systems Backwards: Start With Constraints, Then Choose the Architecture

There is a pattern I keep seeing when designing Agentic AI systems. We start by asking: Which LLM should we use? Should we use LangGraph? Where can MCP fit? Should we build multiple agents? Do we need RAG? Should we add memory? Should every step be handled by an autonomous agent? These are useful questions. But they are often asked too early . The result can be an architecture that is technically impressive but operationally difficult, expensive, slow, and surprisingly hard to trust. A better approach is to reverse the order: Start with the product outcome. Define the constraints. Then design the architecture. Choose the tools last. I have found a useful way to structure those constraints around four dimensions: LCFE L — Latency C — Cost F — Failure E — Evaluation This is not a framework that says every agentic system must look the same. It is a way of forcing architectural decisions to start with the realities of the product rather than the capabilities of the technology. In this article, I’ll walk through a concrete incident-automation example and show how starting with constraints can completely change the architecture. 1. The "backwards" way of designing an agent Imagine we want to build an AI Incident Resolution Assistant for an engineering organization. The goal sounds straightforward: When a production incident is raised, the AI should investigate the incident, gather context, identify the likely cause, recommend or perform remediation, and verify the result. Now imagine the team starts with the technology. The first architecture might look like this: User / Incident | v ┌──────────────┐ │ Triage Agent │ └──────┬───────┘ | v ┌────────────────┐ │ Research Agent │ └───────┬────────┘ | ┌──────────────┼──────────────┐ v v v Logs Agent Metrics Agent Knowledge Agent | | | └──────────────┼──────────────┘ | v ┌─────────────────┐ │ Remediation │ │ Agent │ └────────┬────────┘ | v ┌─────────────────┐ │ Validation Agent│ └────────┬────────┘ | v Resolution It looks sophis

2026-08-27 原文 →
AI 资讯

System Design: Payment Processing System

System Design: Payment Processing System A capstone system design walkthrough — designing a payment processing system end to end — covering the core domain model, the ledger as the system's source of truth, idempotency and exactly-once-effect guarantees, integrating with external payment gateways and card networks, handling asynchronous webhooks, reconciliation, fraud and risk checks, and the specific correctness and compliance demands that make payments a uniquely unforgiving system design problem. Table of Contents Introduction Why Payment Systems Are a Different Kind of Hard The Core Domain Model The Ledger: Double-Entry Bookkeeping as the Source of Truth Idempotency: The Single Most Important Property Integrating with Payment Gateways and Card Networks The Payment State Machine Webhooks: Handling Asynchronous Gateway Callbacks The Saga: Coordinating Payment Across Multiple Services Reconciliation Fraud and Risk Checks Data Security and Compliance Consistency, Availability, and the CAP Trade-off for Money Scaling the System Observability for a Payment System Common Pitfalls Quick Reference Table Conclusion Introduction A payment processing system takes the general system design vocabulary covered in this series' System Design guide — databases, caching, queues, load balancing — and applies it to a domain where the ordinary consequences of a bug are dramatically higher: a double-charged customer, a lost payment, or a corrupted ledger isn't a degraded user experience, it's real money moved incorrectly, sometimes irreversibly. This guide walks through designing such a system end to end, drawing directly on this series' DDD, Event-Driven Architecture, Database Migrations, and Secret Management guides, each of which turns out to be load-bearing infrastructure for getting payments right rather than optional architectural polish. Client → Payment API → [validate, risk-check] → Payment Gateway (Stripe/Adyen/etc.) → Card Network → Bank ↓ ↓ (async webhook) Ledger (source o

2026-08-26 原文 →
AI 资讯

Understanding RCDA: A Strategic Approach to Managing Risk and Cost in Architecture

In today’s fast-paced digital world, organizations face a growing number of challenges in managing their enterprise architectures. Complex systems, rapid technological advancements, and evolving business needs make it difficult to maintain a balance between risk management and cost efficiency. This is where Risk and Cost Driven Architecture (RCDA) plays a pivotal role. What is RCDA? RCDA, or Risk Cost Domain Architecture, is a framework that helps organizations make informed architectural decisions by weighing the trade-offs between risk and cost. This approach enables architects to develop sustainable, resilient, and cost-effective solutions that align with business goals and technical requirements. By breaking down architecture into domains of risk and cost, RCDA provides a structured methodology to address uncertainties while optimizing investments. Why RCDA Matters Every architectural decision carries a degree of risk, whether it be technical, financial, or operational. These risks, if not properly managed, can lead to project delays, increased costs, and even system failures. Traditional methods of architecture design often focus on functionality and performance, leaving risk management as an afterthought. RCDA flips this approach by putting risk management and cost at the center of decision-making, ensuring that every aspect of the architecture is thoroughly evaluated from these two perspectives. RCDA is particularly beneficial in large-scale, complex systems where the stakes are high, and decisions must be made carefully. It allows architects to balance innovation with risk tolerance, ensuring that projects are not only delivered on time and within budget but are also resilient and adaptable to future needs. The Core Principles of RCDA Risk-Driven Decision Making: RCDA emphasizes identifying and assessing risks early in the architectural design process. These risks can include security vulnerabilities, performance bottlenecks, scalability issues, and more. By

2026-08-26 原文 →
AI 资讯

Reusing A Prompt System Across Clients Without Turning It Into A One Size Fits All Failure

Building a custom GPT for one ministry client teaches you something specific about that ministry. Building the third or fourth one for a different government or enterprise client teaches you something much harder, which is how much of what worked the first time was actually general, and how much of it only worked because it happened to fit that particular institution. The Temptation That Causes The Most Damage After the first successful deployment, the obvious next move is treating that system prompt as a proven template and adapting it lightly for the next client. Swap the knowledge base, adjust a few tone instructions, change the scope boundaries to match the new domain, and ship it faster than building from scratch. That instinct is not wrong exactly, but acting on it without first separating what was actually general from what was incidentally specific to the first client produces a second deployment that quietly inherits assumptions nobody meant to carry forward. The clearest example of this showed up around scope boundary language. The refusal and redirection instructions built for the first ministry deployment had been carefully tuned against that specific institution's culture, a fairly formal, procedurally strict environment where a firm, precise boundary read as competent and appropriate. Carrying that same boundary language into a private enterprise deployment, where the internal culture was considerably less formal and staff expected a more conversational tone even when the bot was declining to answer something outside its scope, produced a tool that technically enforced the correct scope but felt oddly cold and bureaucratic to an audience that had no institutional reason to expect that register. Nothing about that was a bug in the traditional sense. The logic was sound, the boundary was correctly enforced, and it still felt wrong, because the tone calibration underneath the logic had been implicitly trained against one specific institutional culture and

2026-08-25 原文 →
AI 资讯

From Developer to Architect — What Really Changes?

One of the biggest transitions in a software engineer’s career is moving from “How do I implement this?” to “How should we design this?” As developers, we naturally focus on writing clean code, implementing features, fixing bugs, and improving performance. But as you move toward an architect role, the questions become different: 🔹 Scalability — Will this solution work when the number of users or transactions increases 10x? 🔹 Maintainability — Can another team understand and extend this solution two years from now? 🔹 Security — Are authentication, authorization, data protection, and secrets management considered from the beginning? 🔹 Performance — Where could bottlenecks occur, and how can we identify them before they become production issues? 🔹 Resilience — What happens when a dependent service goes down? 🔹 Integration — How will this solution interact with existing enterprise systems? 🔹 Technology choices — Does the technology solve the actual business problem, or are we choosing it simply because it is popular? 🔹 Trade-offs — What are we gaining, and what are we giving up with each architectural decision? A senior developer asks: “How can I build this feature?” An architect asks: “What is the right solution for the business, technical, operational, and long-term requirements?” The most important lesson I’ve learned is that architecture is not about creating complicated diagrams or using more technologies. Good architecture is about making the right decisions at the right level , understanding trade-offs, and creating solutions that can evolve with the business. And you don't suddenly become an architect because of a designation. You gradually become one by thinking beyond your code. Java #SoftwareArchitecture #SpringBoot #Microservices #SoftwareEngineering #JavaDeveloper #TechnologyLeadership #Architect

2026-08-24 原文 →
AI 资讯

Too Many Req: A Bucket List Guide to Building a Rate Limiter

Hello, I'm Maneshwar. I'm building git-lrc, a Micro AI code reviewer that runs on every commit. It is free and source-available on Github. Star git-lrc to help devs discover the project. Do give it a try and share your feedback. Every serious API will eventually tell you to sit down and be quiet. Hammer GitHub, Stripe, or AWS a little too eagerly and your requests start bouncing back with a polite but firm 429 . I always found that fascinating, so let's build the thing that says no. By the end of this post we'll have designed a rate limiter that actually holds up when you put it in front of real traffic, and I promise to only make a reasonable number of bucket puns along the way. A rate limiter does one job: it decides how many requests a client is allowed to make in a given window of time. It protects your system from getting flattened, and it keeps one greedy user from eating everyone else's lunch. Simple idea. Surprisingly spicy implementation. Let's build it up piece by piece, the way you'd actually reason through it in an interview or a design doc. First, what are we even building? Before writing a single line, let's agree on what "good" looks like. Here's my wishlist: Configurable limits. Something like "100 requests per minute per user." The rules should not be hardcoded, because free users and premium users deserve different amounts of pain. Honest rejections. When someone goes over, we return HTTP 429 Too Many Requests and include helpful headers telling them how many requests they have left and when the window resets. No mystery. Barely-there latency. This check runs on every single request , so it has to be fast. Let's aim for under 3ms at P95. If your rate limiter is slow, congratulations, you built a second bottleneck. Highly available and shared. Multiple servers need to agree on the same counts. More on why that word "shared" is doing a lot of heavy lifting later. Cool. Now let's start naive and let reality punch us in the face a few times. Attempt 1:

2026-08-24 原文 →
AI 资讯

ByteByteGo in 2026: Is It Still Worth It for System Design Interview Prep?

Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided in this article. Credit - ByteByteGo Hello Devs, if you're preparing for a System Design interview in 2026 , there is a good chance you've come across ByteByteGo and its founder, Alex Xu, author of another popular System Design interview resource and book, the System Design Interview - An Insider's Guide . But with so many system design courses, books, YouTube channels, newsletters, and interview platforms available today, an important question remains: Is ByteByteGo still worth it for System Design interview preparation in 2026? After spending considerable time exploring the platform and Alex Xu's system design material, my answer is yes — especially if you prefer visual, structured, and practical explanations of complex distributed systems. What makes ByteByteGo particularly interesting is that it has grown beyond the original system design material. The platform now covers areas such as Object-Oriented Design, Machine Learning System Design, Generative AI System Design, and Coding Interview Patterns , all the important topics you need to master to crack any FAANG-level interview. The biggest strength, however, remains the same: making complicated system design concepts easier to understand through diagrams, examples, trade-offs, and real-world case studies. In this article, I'll take a fresh look at ByteByteGo in 2026, explain what it offers, who should use it, what you'll learn, and whether I think it's worth paying for. If you're already looking for a system design resource, you can check out ByteByteGo here . What Is ByteByteGo? ByteByteGo is an online learning platform created by Alex Xu , the author of the popular System Design Interview — An Insider's Guide books. The platform started with a strong focus on system design interview preparation and has evolved into a broader technical learning resource. One of the t

2026-08-23 原文 →
AI 资讯

Bulletproofing AI Agents: How to Prevent $2,000 Infinite API Loops

Implement multi-layer circuit breakers, payload hashing, and financial cutoffs before an autonomous agent drains your backend. The Bottleneck in Production Autonomous AI agents running in tool-use loops fail unpredictably. When an LLM encounters an unexpected schema, a transient network error, or an ambiguous prompt, it often enters a hallucinated retry storm. In standard web apps, a runaway loop hits a rate limit or returns a 500 Internal Server Error . In agentic architectures, an unconstrained ReAct loop executes external API calls continuously, burning tokens, exhausting upstream quotas, and running up massive cloud bills in minutes. Here is the anti-pattern running in far too many codebases: # Anti-pattern: Unbounded autonomous agent loop while not task_complete : action = llm . decide_action ( state ) result = external_api . call ( action . endpoint , action . params ) state = update_state ( result ) If the LLM fails to transition state due to an unparseable response, this loop runs indefinitely. Cloud providers do not issue refunds for self-inflicted API usage. The System Architecture & Fix To make AI agent tool execution production-safe, never allow direct API calls from agent code. Route every external request through an isolated API Safety Wrapper implementing three distinct layers of defense: Deterministic Request Firewall: A hard cap on execution count per task session (Time-To-Live counter). Sliding-Window Loop Detector: Hashing outgoing request payloads to catch repetitive or oscillating tool invocations. Financial Kill Switch: A pre-flight budget validator that cuts credentials immediately if projected cost exceeds session limits. [ AI Agent Engine ] │ ▼ [ API Safety Wrapper ] ├── 1. Call Counter Check (Limit < N) ├── 2. Hash Duplicate Detector (Window: last 3 calls) └── 3. Pre-flight Cost Estimator (Budget < Limit) │ ┌────┴──────────────────────────┐ [ Passed ] [ Tripped ] │ │ ▼ ▼ [ External Upstream API ] [ Emergency Kill Switch ] (Revoke Token & Ab

2026-08-22 原文 →
AI 资讯

Beyond Writing Code: The Core Mindset of a Modern Software Engineer

Many beginner developers believe software engineering is all about mastering programming languages, framework syntaxes, and clearing error logs. In reality, writing code is only a fraction of the actual job. The true core of software engineering lies in analyzing complex domain problems, evaluating deep trade-offs, and designing robust systems that stand the test of time. Let's explore what it genuinely takes to transition from a coder to a modern software engineer with the right engineering mindset. 1. Writing Code vs. Solving Problems Anyone with a healthy brain can learn syntax and write functional scripts after a few tutorials. However, the real engineering challenge begins long before you touch your IDE. Understanding the Domain: Breaking down business logic and user requirements. Evaluating Alternatives: Assessing whether a feature needs a complex custom hook or a simple native state. Long-term Value: Building solutions that won't break when requirements shift tomorrow. 2. The Importance of Maintainability Code is read much more often than it is written. When you are working on large-scale applications, you are never coding alone—even if you are solo for now, your future self is essentially a stranger six months down the line. Crafting clean, self-documenting code with meaningful, intention-revealing names. Enforcing single-responsibility functions to keep modules decoupled. Using predictable patterns so teammates can navigate and scale the application without getting buried in technical debt. 3. Pragmatic System Design and Trade-offs There is no silver bullet in software engineering. Every architectural decision—whether choosing a database, state management library, or caching strategy—comes with heavy trade-offs. Performance vs. Development Speed: Knowing when to optimize early and when to ship MVP code. Scalability vs. Complexity: Avoiding over-engineering simple features just because a shiny new tool exists. Balancing Constraints: A great engineer evaluate

2026-08-20 原文 →
AI 资讯

Architecting the New Operating System: A Guide to Context Engineering

Prompt engineering is a conversation; context engineering is system architecture. In the early days of working with Large Language Models (LLMs), optimizing the prompt was enough for simple text generation tasks. But when you are building autonomous systems—like a self-hosted automation server connecting cloud databases, webhooks, and reasoning nodes—prompts alone will not keep track of APIs, past decisions, and strict output constraints. Think of the LLM as the CPU, and the context window as the RAM. Context engineering is the discipline of treating that memory as a scarce resource, meticulously designing the pipeline that feeds the model the exact facts, instructions, and tools it needs at the precise moment it needs them. The Four Core Strategies To shift from vibe-coding a chatbot to architecting a resilient multi-agent system, you must manage what enters and stays in the context window using four primary techniques: Select: Decide exactly which external sources—like database schemas or specific API documentation—enter the context window to maximize the signal-to-noise ratio. Compress: Shrink the context payload only after the key facts are successfully structured. Write: Persist the task state and intermediate decisions outside the active context window so the agent can retrieve them later. Think of this as giving the agent its own local-first markdown vault for networked thought. Isolate: Separate contexts when domains collide. Instead of forcing one model to do everything, build multi-agent systems where each agent receives a strictly scoped slice of the context. Navigating the Failure Modes Stuffing a massive context window with raw JSON logs and unstructured data is a recipe for disaster. When building complex workflows, you must engineer guardrails against these critical failure modes: Context Poisoning: Hallucinated or incorrect information enters the context and compounds over time because the agent continually reuses it. Context Distraction: The agent g

2026-08-20 原文 →
AI 资讯

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

With the Azure Kubernetes Services (AKS) platform, containerized workloads can be efficiently managed and scaled. However, the full potential of AKS is only realized when it is seamlessly integrated with other Azure services. This enables a complete cloud-native environment that is scalable, secure, and automatable, while providing maximum flexibility. In this final post of the series, we will show you how AKS can be integrated with other Azure services to create a robust and holistic platform for your applications. Why Integrating AKS into the Azure Cloud Is Crucial AKS provides a highly available and scalable infrastructure for managing containerized applications. However, integrating it with other Azure services like Azure DevOps, Azure Monitor, Azure Active Directory (Entra ID), and Azure Storage extends functionality and optimizes workload management. By leveraging Azure services alongside AKS, companies can: Ensure enhanced security for their containerized applications. Build robust monitoring and logging solutions to monitor the state of applications at all times. Set up automated pipelines for deployment and scaling. Seamlessly exchange data and status information across various Azure services. Key Azure Services to Integrate with Your AKS Platform Azure Active Directory (AAD) for Authentication and Security Azure Active Directory (AAD) provides comprehensive identity and access management that can be directly integrated with AKS. This ensures that only authorized users and services can access your Kubernetes clusters. With Azure RBAC (Role-Based Access Control), you can define granular access permissions for different users and teams, increasing the security of your environment. AAD Pod Managed Identities enable your AKS applications to securely access Azure resources like Azure Key Vault or Azure Storage without the need to manually manage sensitive credentials. Azure DevOps for CI/CD Pipelines Azure DevOps is one of the best solutions for automating CI/CD

2026-08-19 原文 →
AI 资讯

The Rate Limiter Strikes Back: Designing a Token Bucket from Scratch

The Quest Begins (The "Why") I still remember the first time our API started choking under a sudden traffic spike. It was a Friday afternoon, the kind where you’re just about to log off, and the monitoring dashboard lit up like a Christmas tree. Requests were piling up, latency shot through the roof, and our users began seeing those dreaded “429 Too Many Requests” errors. We had a naive rate limiter in place—a simple fixed‑window counter that reset every minute. It worked fine when traffic was steady, but as soon as a burst hit, the counter would either let too many through (because we hadn’t hit the limit yet) or block everything for the whole minute (because we’d already exhausted the quota). It felt like trying to hold back a tsunami with a sandbag. Honestly, I was frustrated. I knew there had to be a smarter way to smooth out those bursts without penalizing honest users or over‑protecting the system. That’s when I dove into the world of rate‑limiting algorithms, and the token bucket caught my eye like a shiny loot drop in a dungeon. The Revelation (The Insight) The token bucket is deceptively simple, yet it solves the exact pain points we were experiencing. Imagine a bucket that holds a fixed number of tokens. Tokens drip into the bucket at a steady rate (say, 10 tokens per second). Each incoming request consumes a token. If the bucket is empty, the request is denied or delayed; if there’s a token, the request proceeds and the token is removed. Why does this beat the fixed‑window counter? Burst tolerance – The bucket can store up to its capacity, allowing a short burst of requests up to that limit without waiting for the next window. Smooth throttling – Because tokens are added continuously, the limiter adapts to the actual request rate rather than resetting abruptly at arbitrary intervals. Memory‑light – We only need to track two numbers: the current token count and the last time we refilled the bucket. No arrays of timestamps per key. Here’s a quick ASCII sket

2026-08-19 原文 →
AI 资讯

Your AI Agent Scheduler Needs a Clock-Skew Budget, Not Just Cron

A scheduler can be perfectly healthy and still run the wrong job at the wrong time. The failure is usually not the cron expression. It is the boundary between wall-clock time, monotonic elapsed time, leases, retries, and a process that may pause or restart. A reliable agent scheduler needs an explicit clock contract. Without one, a clock correction can make a job run twice, never run, or run after its authorization window has expired. The three clocks an agent should not conflate Use wall-clock time for human meaning and durable records: scheduled_at: when the user asked for the run not_before: the earliest acceptable dispatch time expires_at: the latest acceptable dispatch time Use a monotonic clock for elapsed-time decisions inside one process: lease renewal deadlines backoff timers watchdog intervals drain deadlines Use a database or provider sequence for ordering across processes: scheduler ownership fencing tokens attempt numbers reconciliation order A monotonic timestamp cannot be compared across hosts, and a wall-clock timestamp cannot safely measure a five-minute lease if NTP steps the clock backward. Store both kinds of evidence instead of pretending one timestamp answers every question. A small scheduling contract Here is a deliberately boring record shape: action: send_digest run_id: 01J... scheduled_at: 2026-08-19T08:00:00Z not_before: 2026-08-19T08:00:00Z expires_at: 2026-08-19T08:05:00Z lease_owner: worker-7 lease_token: 1842 attempt: 1 state: READY The important part is not the field names. It is the decision rule: The scheduler claims the run with a durable lease and fencing token. It checks wall-clock eligibility against not_before and expires_at. The worker checks that its lease token is still current before starting. The effect layer checks the token again before a side effect. If the outcome is ambiguous, record UNKNOWN and reconcile by the provider's idempotency key instead of blindly retrying. That last step matters after restarts. A clean rest

2026-08-19 原文 →
AI 资讯

Building a Location-Aware Discovery Engine: Why “Nearby” Isn't Just Distance

"Nearby" sounds like a simple feature. Calculate the distance between the user and every location. Sort by distance. Done. In practice, that's not enough. A useful local discovery engine has to understand more than geography. That's one of the problems we're tackling with LeeX. The basic version A traditional nearby query might look like: User location ↓ Calculate distance ↓ Sort ascending ↓ Return results If Restaurant A is 500 meters away and Restaurant B is 2 kilometers away, Restaurant A wins. But what if Restaurant A is permanently closed? What if Restaurant B is much more relevant to the user's category? What if Restaurant B is currently featured? What if thousands of people have recently interacted with Restaurant B? Distance alone doesn't capture usefulness. Our discovery model We're thinking about discovery as a combination of signals: Discovery Score = Distance + Relevance + Activity + Popularity + Featured status + Availability + User context The exact weighting can evolve. The important part is that proximity is one signal, not the entire algorithm. Distance still matters We don't want to ignore geography. For local discovery, distance is extremely important. A user looking for a restaurant probably cares whether it is: 500 m 1 km 2 km 5 km 10 km That's why LeeX can expose radius-based discovery. But distance should normally be combined with other information. Category context Suppose someone opens LeeX and selects: Restaurants The discovery engine should not treat every listing equally. The system already knows the user's current intent. That gives us a stronger query: Nearby + Restaurant + Open + Relevant rather than: Nearby + Everything Featured listings LeeX also has a promotion layer. Featured listings can receive additional visibility across relevant discovery surfaces. But promotional ranking needs to be handled carefully. A featured listing shouldn't necessarily make every other result useless. Instead, we can think of featured placement as an ad

2026-08-19 原文 →
AI 资讯

Distributed Locking in Practice: Guarantees, Failure Scenarios and Better Alternatives (2/4)

In this article, we'll explore the mechanisms to solve the coordination problem. 8. Introducing Leases To address the problem of permanent ownership, distributed systems typically replace it with temporary ownership. This concept is known as a lease . Instead of granting indefinite control over a resource, the coordination service assigns ownership for a limited period of time. Rather than stating, “You own this resource until you explicitly release it,” the system instead says, “You own this resource for the next 30 seconds.” This changes the interaction model significantly. Acquire Lease | v Execute Work | v Renew Lease | v Continue Processing As long as the application remains healthy, it periodically renews the lease to maintain ownership. If the application crashes or becomes unresponsive, it can no longer renew the lease. Once the lease duration expires, ownership is automatically revoked. At that point, another application becomes eligible to acquire the lease and continue the work. Leases solve a critical problem in distributed systems: they prevent abandoned locks from blocking progress indefinitely . The system can recover automatically without manual intervention. However, while leases improve availability, they also introduce a new class of subtle and more complex problems. Leases Depend on Time To understand the next challenge, assume the lease duration is thirty seconds. Application A successfully acquires the lease. Lease Granted Duration = 30 seconds After twenty seconds, the JVM begins a long Full Garbage Collection cycle. This pause lasts forty seconds, significantly longer than the lease duration. The timeline now becomes problematic. Lease Granted | | Processing | | GC Pause (40 sec) | | Lease Expires While Application A is paused, the lease expires. During this time, another application requests access to the same resource. The coordination service observes that the previous lease has expired and therefore grants ownership to Application B. Appl

2026-08-18 原文 →