SShortSingh.
Back to feed

Redis Rate Limiting Solves API Spam and Scaling Gaps in Express Apps

0
·1 views

A backend developer identified a critical vulnerability in their Express API where unrestricted endpoint access could crash servers or inflate costs from external AI service calls. In-memory request tracking was initially considered but rejected due to memory leak risks and failure to work across multiple server instances behind a load balancer. The developer implemented Redis as a centralized rate-limiting store, ensuring consistent request counts are shared across all app instances. A global limit of 100 requests per 15 minutes was applied to standard routes, while sensitive endpoints like AI generation were restricted to 5 requests per 10 minutes. The setup uses the express-rate-limit and rate-limit-redis packages with ES Modules, and Redis was noted to process limit checks in under one millisecond.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How One Team Built a WhatsApp AI Agent Serving 20 Industries With 99.7% Uptime

An engineering team has shared 18 months of lessons from running SARA, an open-source WhatsApp AI agent deployed across businesses in 20 industries. The system uses a four-provider AI chain — Groq, Cerebras, SambaNova, and Mistral — with automatic failover and exponential backoff, achieving 99.7% uptime over six months at near-zero inference cost by leveraging free tiers. SARA can execute over 30 real-world actions such as booking reservations, checking inventory, and generating invoices, with a risk-assessment gate that requires human approval for high-stakes operations. The architecture addresses WhatsApp-specific challenges including message ordering, multilingual date parsing, and privacy by anonymizing personal data before it reaches any language model. SARA is released under the AGPL-3.0 license on GitHub, with industry-specific agent definitions available separately under Apache-2.0.

0
ProgrammingHacker News ·

No Reports of AI Systems Forcing Companies to Recognize Worker Unions

A social media post on Mastodon by user Neil highlighted a notable absence in AI-related incident reports. Despite widespread concerns about AI going rogue or causing unintended consequences, no documented cases exist of an AI system compelling a company to recognize a workers union. The observation gained traction on Hacker News, accumulating 34 points and 8 comments. The post appears to draw an ironic contrast between feared AI risks and the kinds of outcomes that might actually benefit workers.

0
ProgrammingDEV Community ·

Dev team built 32,000 AI build prompts to ease Midnight blockchain's steep learning curve

A development team created Creative Midnight, a tool generating around 32,000 self-contained build prompts to help developers onboard onto Midnight, a zero-knowledge Layer 1 blockchain. Midnight's complex setup — involving version-sensitive packages, Docker dependencies, WASM polyfills, and testnet token access — was consuming hours of hackathon developers' time before they could begin building. The team compiled 1,996 project ideas across ten creative disciplines, each paired with a private-state mechanic tailored to Midnight's ZK architecture. For each idea, prompts are dynamically composed per network target and operating system, bundling pinned package versions, toolchain commands, wallet boot code, and known failure fixes. The project aims to eliminate repetitive environment setup so developers can focus on their actual ideas rather than infrastructure troubleshooting.

Redis Rate Limiting Solves API Spam and Scaling Gaps in Express Apps · ShortSingh