惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cloudbric
Cloudbric
有赞技术团队
有赞技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Threat Research - Cisco Blogs
L
LangChain Blog
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
Latest news
Latest news
S
Schneier on Security
Cisco Talos Blog
Cisco Talos Blog
MyScale Blog
MyScale Blog
C
Check Point Blog
IT之家
IT之家
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
G
Google Developers Blog
T
Tor Project blog
T
Threatpost
D
DataBreaches.Net
博客园 - 【当耐特】
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Troy Hunt's Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
NISL@THU
NISL@THU
P
Privacy & Cybersecurity Law Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cisco Blogs
博客园_首页
S
Securelist
T
The Exploit Database - CXSecurity.com
Last Week in AI
Last Week in AI
量子位
U
Unit 42
Know Your Adversary
Know Your Adversary
Hugging Face - Blog
Hugging Face - Blog
S
Security Affairs
Google Online Security Blog
Google Online Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
From Resilience Infrastructure to Event Driven Architectures - What HNGi14 Taught Me About Real Systems
Wilfrid Okorie · 2026-06-13 · via DEV Community

Most backend systems look simple, until they don't. A single server, a database, with requests coming in and responses going out: it looks clean, predictable and easy to reason about. All of a sudden, business flows, traffic grows, external services start failing, processes crash mid-job, latency increases. What looked like a solid foundation reveals itself as a system that only works in the happy path.
During HNGi14, I spent months building systems that had to work outside the happy path; intelligent retries, automatic failure recovery and mishap management, asynchronous job processing, latency drops, and system hardening in general. This article covers two of those systems: a retry engine that covers exponential backoff and jitter, and a Redis pubsub metrics pipeline that demonstrates an event-driven architecture.

Stage 8 Task - Retry Engine

Problem it Solved

Imagine you have a system, and your server is down for 5 seconds. Say your system using Stripe for payments, and stripe is supposed to deliver a webhook to your server on successful payments. The payment happens that time, your server does not receive it, so your server doesn't consume the customer actually paid for the service, and the customer doesn't get served. In this context, I will refer to stripe as the client, and your server as the server. In this case, it is not the client's fault that the webhook wasn't delivered. It is actually the server's fault. If the client tried that request again now your server is up, it will probably succeed. This is a typical case where a retry engine is needed.

What is a Retry Engine?

A Retry Engine is a small HTTP service that acts as a reliable proxy for outbound HTTP requests. Instead of making a request directly and hoping it succeeds, it persists the job, and returns immediately with an ID, while a background worker handles the actual call. If the call succeeds, that is the happy path. It stores the result, and you can get it whenever you want. If it fails with a retryable error, the worker backs off and tries again. If it fails permanently, it stops, and marks the job dead.

When a server experiences transient failures, the clients that have made requests to it experience errors, and the typical solution is to retry the requests, depending on if the errors are retryable errors, or Transient Errors. Transient Errors are those that would probably succeed if tried again. However, if the errors are retried immediately, they would probably crash your just-recovering server. That is where Exponential Backoff. The clients requesting give the server some time to recover from the error, and the more the error persists, the higher the backoff period before the next request.

However, the issue with this is that if the server crashed due to high traffic all at once, and those retries, though exponentially backed off, happen at the same time, it would probably lead to the same spike in traffic, and would crash the server again. That is where Jitter comes in. Jitter adds randomness to the retries, and spreads these retries. Assuming they were supposed to happen at the 10 seconds after the previous try, jitter spreads it to 8.5s, 8.7s, 8.8s, 9.1s, 9.5s, 10.2s, 10.4s etc. It depends on randomness for varying the next_retry_at for each of the requests

How I Approached The Task

I was genuinely confused when I refused the task, so the first thing I did was give the task to claude to break it down. The prompt requested a breakdown, and key concepts needed to be studied to understand the task and implement. After this, I went to YouTube, searched through different videos for explanations.
I spent more time doing research than writing the code for that task, because the code was genuinely very easy to write, maybe because of how much I did research.
After understanding, I wrote a summary of what I got, and questions I had, and headed back to Claude. It was only after I had gotten the concept to the core, that I started writing the code, and it took me just an afternoon to complete the task.

What Broke and How I Fixed it

During implementation, the main things that broke had to do with my use of sqlite3 library, and how it differs from Postgres.
Although it uses SQL, it is file-based, unlike PostgreSQL.
I also had some issues with module and commonjs during the implementation, because I did not use any framework to bootstrap it - I wrote from scratch.

What I Took Away From It

Concepts:

  • How workers are actually just setIntervals or recursive setTimeout calls with a memory-layer, like DB or redis for BullMQ.
  • How exponential backoff and jitter work mathematically, not just conceptually
  • The thundering herd problem and why jitter solves it
  • What transient errors are and why the distinction between client errors and server errors matter for retry logic, and cases of exceptions
  • How SQLite DB works, using it for the first time

Patterns:

  • The claim-before-process pattern: previously learned in Web3 and applied here, to prevent duplicate work in polling workers
  • Using future time as self-healing lock instead of boolean flags all the time
  • How recursive setTimeouts can be a safe alternative to setInterval for async work loops

Debugging Techniques

  • Using console.time() to track time in the console. Used in debugging, but not currently present

Why I Picked It

Among the many individual tasks that were done throughout the internship, this was the most exciting, because the retry engine, exponential backoff and jitter, were all completely foreign concepts to me before the task. After the task, I understood these things very well in my opinion, and good enough to take on the next task, which was basically a highly scoped-up version of it - a full production-grade Job Scheduler.

Project Details:

Team Task - Real-Time Inverter Metrics Streaming

In the HNG Internship, I was the backend track lead, and general technical leader of the EnergyIQ team. We built an application that turns solar inverter data gotten from the specific inverter brand APIs, into actionable intelligence for financial optimization, costs and savings, and device maintainance, for the user.

Initially, the flow mentioned the frontend polling the backend for updates from these APIs. This would mean an browser requests data, and the backend requests the data from the external service, and get the data, and then return it to the user, while also storing to the DB

The Problem

The problem is what is mentioned in the section above. For a handful of users, this works very well. However, as the user-base for the app grows, this starts to crack under pressure. EnergyIQ supports multiple users being able to view the dashboard for a particular inverter, in a feature known as Team Access. This means that if 10 people are viewing the inverter dashboard of a particular inverter, their 10 different browser instances make requests for the same data periodically. This also means that if the client doesn't ask, the backend doesn't get the inverter data, and cannot use the data to do other things it should. Also, these brand APIs have rate limits, and requested request times, so it becomes chaos when multiple clients ask for data at different times. One simple solution is them asking the DB instead, but this way, they don't exactly get data the moment it is available, and for critical cases, this latency can mean a lot.

What It Was

As a result, I created:

  • a single poller service for the brand APIs
  • a redis pubsub service for publishing data
  • an SSE endpoint for connecting clients to this stream by subscribing

The poller service is a background service that polls all the brand APIs at organized times, depending on the specific rate limit for that brand's API. This way, it organizes the traffic into a few, organized requests, using Promise.all to make this requests concurrently. When it makes these requests, if there are errors, the errors are handled and logged.
If the data is gotten successfully, it uses the pubsub service to publish this data to a specific channel, which is determined by the id of the inverter for which it has just polled.
The SSE endpoint enables the client to connect once to the server and listen for updates, by subscribing to the same channel pattern used by the poller/pubsub service.
As a result, data is gotten real-time, eliminating the polling from the frontend completely, and replacing chaos with order.

How I Approached It:

As the head of the team, I chose the task for myself, since I had been learning about different API and endpoints types and shapes. I thought of different solutions to it, of which the main ones were websockets, long-polling, server-sent events using the EventSource API, or Redis Pubsub + SSE - this is the one I chose.

The real challenge was how to make sure it was separate from other services i.e. it didn't result in circular dependencies by calling a function in the inverters service directly to deliver the data. One of the important design justifications in this implementation was avoiding the poller service being called by the endpoint controller directly.

Before writing a single line of code, I did my research to find out why redis was as fast as it was, how it was able to do a number of different things (also used in cache), and how SSE endpoints worked, and why they differ from websockets.

After this, I wrote an implementation plan, and used it.

What broke and How I fixed:

Here are some things that broke:

  • The device type assumption
    I hardcoded deviceType: 'min' in the Growatt adapter. When I tested against a real inverter, it returned empty arrays for min, inv, sph, and max. The fix was discovering the device was type: 2 (storage) and switching to deviceType: storage, and later making device type dynamic, stored at onboarding from the device list response rather than hardcoded.

  • Content-Type for the Growatt v4 endpoint
    The initial adapter was sending JSON. The Growatt v4 queryLastData endpoint requires application/x-www-form-urlencoded. The fix was switching to URLSearchParams and setting the correct Content-Type header.

  • Field name mismatches from the TRD
    The TRD documented bmsSOC - the actual API returned bdc1Soc and bmsSoc as separate fields depending on the device type. The storage response used completely different field names (capacity for SoC instead of bmsSOC, vBat instead of bdc1Vbat). The fix was mapping the storage-specific fields correctly.

What I Took Away From It:

From this task:

  • I learned how Redis works, and how it uses the RAM for data storage, for speed.
  • It was my first implementation ever of a lasting connection between client and server, so I got to understand practically how server-sent events work.
  • I learned alternatives that can be used in other cases. I had heard about Kafka for streaming. While it was not a direct solution to this, it was worth learning how and where it is used.

Why I Picked This:

I picked this because it is still my proudest contribution to the team, not because it is a very big thing, but because it enhanced EnergyIQ a lot. Many other services now use pattern pubsub (listen for updates on patterned channels) to perform their functions, without need to poll the DB. It became a backbone for the entire app, since the app is centered around getting and using solar inverter data from the brand APIs.

It is something worth being proud of.

CONCLUSION

In conclusion, I wrote my first Express server in HNG, coming with the intention of learning how systems work, and understanding Systems Design. It is not a destination, but I can proudly say I am moving fast and effectively on that journey, as a result of the well thought-through tasks that have been given in this HNG cohort. I am proud of myself.