🚦 LLD Case Study: Designing a Rate Limiter in Node.js Rate Limiter is a very common Low-Level Design (LLD) interview question for backend roles. Instead of explaining it only in theory, I decided to design and implement it end-to-end with a production mindset. 🔗 GitHub: https://lnkd.in/drD79sfY What this project covers (LLD-focused) • Token Bucket, Fixed Window, and Sliding Window algorithms • Strategy Pattern to switch algorithms without changing client code • Redis + Lua scripts for atomic operations • Express middleware–based design • RFC-style rate-limit headers • Handling real-world scenarios like burst traffic and concurrency Why I built this In interviews, the expectation is not just: “Do you know the algorithm?” But also: • Can you structure clean, maintainable classes? • Can you extend the design without breaking existing code? • Can you handle race conditions? • Can you think about failure scenarios? This project answers those questions with actual working code, not just diagrams. Key design takeaway Algorithms change. Good design should not. Using the Strategy Pattern, each rate-limiting algorithm is isolated, testable, and replaceable without touching the rest of the system. If you’re preparing for backend LLD interviews or working on API design, this might be useful. Feedback and discussions are welcome 🙂 #LowLevelDesign #SystemDesign #NodeJS #BackendEngineering #Redis #InterviewPrep #OpenSource
Ikhlaque Ahmed Maner’s Post
More Relevant Posts
-
🚀 Breaking down the architecture of Real-Time Video & Chat! Ever wondered how to build a unified Chat & Video architecture in Django? It’s not about streaming everything through the server—it’s about knowing which protocol fits the job. I created this workflow to visualize how Django Channels, Redis, and WebRTC work together to create a seamless experience. 👇 The Tech Stack & Workflow: 1️⃣ Django Channels (The Manager): Standard Django is synchronous (request-response). Channels upgrades Django to handle asynchronous protocols like WebSockets—persistent, bi-directional connections that stay open. This allows the server to push data instantly without the client refreshing. 2️⃣ Redis Channel Layer (The Glue): When a user sends a chat message, it needs to reach the recipient instantly. Redis acts as the high-speed "Channel Layer." It serves as a message broker, taking the message from one server worker and broadcasting it across the system to the specific worker handling the recipient. 3️⃣ The Video Handshake (Signaling): Video calls don't start magically; browsers need to find each other first. We leverage the existing WebSocket connection as a "Signaling Server." User A and User B exchange contact info (SDP packets and ICE candidates) here. They aren't sending video yet—just negotiating how to connect. 4️⃣ WebRTC (The Heavy Lifter): Once the handshake is complete, the server steps back. WebRTC takes over to establish a direct Peer-to-Peer (UDP) connection between the browsers. This protocol is designed specifically for real-time media, allowing video and audio to flow directly between users. 💡 The Result: The heavy video traffic never touches our Django server, keeping costs low and latency minimal, while Redis ensures instant message delivery for the text chat. Has anyone else implemented WebRTC with Python? Let's discuss in the comments! 👇 #SystemDesign #Django #WebRTC #Python #Redis #SoftwareArchitecture #FullStackDev
To view or add a comment, sign in
-
-
Wanted to actually understand how backend services talk to each other on a deeper level, so I built it myself instead of just reading about it. Set up a Node/TypeScript API behind Nginx, added Postgres and Redis, containerized everything with Docker Compose, and scaled it to 3 replicas. What surprised me: - Curling my API and watching different container hostnames come back was the moment load balancing actually made sense to me - Containers just find each other by name. Docker DNS is one of those things that feels like magic until you see it work - Having a large dev image with hot reload vs a slim production build showed me why multi-stage Dockerfiles exist - Rate limiting at the Nginx layer instead of in app code felt way cleaner than I expected I also wired up Prometheus and Promtail because I wanted to see what my services were actually doing in a convenient way , less bouncing around and typing into the terminal. Biggest lesson: the gap between understanding an architecture diagram and debugging why one of your replicas isn't getting traffic is where you actually learn. As frustrating as it was to get certain things working, this project was a lot of fun. It's also given me boilerplate I can reach for whenever I need to spin something like this up again. I'm hoping it helps me build a deeper understanding of backend systems so that setting up infrastructure like this becomes second nature in other environments. (Currently seeing if I can create a consistent pattern for setting up development environments for C++) I know AI is fascinating and really takes the weight off, but it isn't an excuse to skip learning why things work the way they do. Repo's public if anyone wants to poke around. It's not complete just yet, still working on getting hot reloading working properly for active development workflows (backend and frontend). Feel free to make changes or share your advice on what could be better: https://lnkd.in/erHbKKJV #Docker #DevOps #Backend #NodeJS #TypeScript
To view or add a comment, sign in
-
Flask is often referred to as a micro framework, but its capabilities extend far beyond that label. At its core, Flask provides essential features such as routing, request handling, and extensibility, all without enforcing a rigid structure. This flexibility makes it a popular choice for APIs, microservices, and rapid backend development. A simple Flask API can be set up with just a few lines of code, offering: • URL routing • JSON responses • A running web server Flask truly excels in scalability through its simplicity, featuring: • Blueprints for a modular code structure • Easy integration with SQLAlchemy, Marshmallow, and Celery • RESTful API development with Flask-RESTful or Flask-Smorest • Seamless deployment using Docker, Gunicorn, and Nginx Flask does not dictate how to build applications; instead, it empowers developers to create clean and maintainable architectures tailored to their specific use cases. For Python developers focused on building APIs, internal tools, or microservices, Flask remains a sharp and reliable choice—simple by design, yet powerful in practice. #Python #Flask #APIDevelopment #BackendEngineering #Microservices #WebDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
-
⚡ 𝘁𝘀-𝗱𝗲𝘃-𝗸𝗶𝘁 — 𝗖𝗹𝗮𝘂𝗱𝗲 𝗖𝗼𝗱𝗲 𝗣𝗹𝘂𝗴𝗶𝗻 𝗳𝗼𝗿 𝗧𝘆𝗽𝗲𝗦𝗰𝗿𝗶𝗽𝘁 𝗙𝘂𝗹𝗹𝘀𝘁𝗮𝗰𝗸 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗺𝗲𝗻𝘁 A Claude Code plugin built for fullstack TypeScript teams. 𝗜𝘁 𝘀𝗵𝗶𝗽𝘀 𝘄𝗶𝘁𝗵: - 14 curated reference skills; - 15 specialized agents; - Multi-agent orchestration to break complex features into parallel workflows. 𝗪𝗵𝘆 𝘂𝘀𝗲 𝗶𝘁? - More accurate responses (curated references > hallucination); - True domain specialization; - Multi-agent orchestration. If you don’t want to use the agents, you can choose to install only the skills that fit your use case — check all available skills here: https://lnkd.in/dJgvjj3C For the full installation and more details, see the repository: https://lnkd.in/dbUsyjXF (contributions and ⭐ are welcome) #TypeScript #ClaudeCode #OpenSource #FullStack #DeveloperTools #AI #Fastify #NextJS #React #PostgreSQL #DevTools #AIEngineering
To view or add a comment, sign in
-
I Built “ScriptShelf” – A Knowledge Engine Born from a Real Problem Over time, I noticed something frustrating. Concepts I had already learned were scattered across notes, repos, and PDFs. Finding them again took more time than learning them the first time. So I started building ScriptShelf — a structured system to organize, connect, and search technical knowledge efficiently. Highlights • Redis caching strategy for optimized feed performance • PDF deep search with indexed documentation • Wiki-style bi-directional concept linking • Real-time updates using Socket.io • Zen Mode, Mermaid.js support, and Ctrl+K Command Palette Stack React | Redux Toolkit | Node.js | Express | MongoDB | Redis | Tailwind CSS This project pushed me beyond CRUD into caching strategies, search indexing, and real-time systems architecture. If knowledge fragmentation is a problem you’ve faced too, I’d love your thoughts. GitHub: https://lnkd.in/gbnaJxxi Live: https://lnkd.in/gJWpn7iy #MERN #SystemDesign #Redis #FullStackDeveloper #BuildInPublic
To view or add a comment, sign in
-
-
The textalyzer project is complete! Coming from a background in C++ and Data Structures, I recently challenged myself to dive into the web ecosystem. The result? Textalyzer — a high-performance REST API and web client for real-time text analysis. Throughout this project, I focused heavily on optimization and architecture. Here are the main technical hurdles I overcame: 🧠 Algorithmic Efficiency: Refactored the character frequency logic from a naive O(N^2) approach to O(N) by implementing custom Hash Maps, drastically improving processing time for large texts. 💾 Data Persistence & Resilience: Integrated a serverless PostgreSQL database (Neon). When I encountered "Cold Start" connection drops on the cloud, I implemented Connection Pooling (pg.Pool) to ensure the server gracefully handles disconnections without crashing. 🏗️ Clean Architecture: Applied Separation of Concerns by modularizing the Node.js backend logic, and separating the frontend into clean HTML, CSS, and Vanilla JavaScript files. The Tech Stack: Backend: Node.js, Express, PostgreSQL Frontend: HTML5, CSS3, Asynchronous JS (Fetch API) DevOps: Git (SemVer), WSL2, Render (PaaS) Check out the live project here: https://lnkd.in/eh9HBVnM Dive into the code on GitHub: https://lnkd.in/eGBrsCm6 Excited for the next challenge! Always open to feedback from the community. 👇 #SoftwareEngineering #NodeJS #PostgreSQL #FullStack #WebDevelopment #DataStructures #OpenSource
To view or add a comment, sign in
-
-
Setting Up a Production-Grade Monorepo on Windows was eazzyyyyyy 😭 Today was one of those “real engineering” days. I joined Whisperit and my first task wasn’t building features it was setting up a full production-style monorepo locally. Stack: • Next.js (web) • FastAPI backend • Redis workers • Supabase (local DB) • Azure integrations • Docker + Docker Compose • Turborepo + Yarn workspaces Sounds simple? It wasn’t. Problems I faced: Docker daemon not running (WSL misconfiguration) Shell script CRLF vs LF issues Backend failing to connect to Postgres because of hidden \r Docker build failing due to invalid Python wheel API gateway crashing because no LLM config existed in DB Supabase constraint errors when inserting region Restart loops due to missing OpenAI provider configuration What I learned: Docker isn’t just “containers” — it’s isolation, reproducibility, and dependency control. Monorepos require understanding orchestration (Turbo + workspaces). Infra bugs are usually small details (line endings, env formatting, wrong DB values). Logs > assumptions. Most startup engineering isn’t coding — it’s system thinking.By the end of the day: ✅ Database running ✅ Redis running ✅ FastAPI backend healthy ✅ LLM config fixed ✅ Next.js frontend connected ✅ Full local infra working Biggest takeaway: You don’t grow by avoiding complexity. You grow by sitting with it until it makes sense. Tomorrow we build. 🔥 #FullStack #AI #StartupLife #Docker #Supabase #FastAPI #NextJS
To view or add a comment, sign in
-
-
Every await in Your Node.js API Is a Pause. Chain 3 of Them and You've Built a 750ms Endpoint. Sequential async/await is the most common performance mistake in Node.js backends. It feels right clean, readable, easy to reason about. It's also serialising database calls that have zero dependency on each other. When you await getUserData, then await getOrders, then await getNotifications, you're processing one at a time. Node.js sits idle between each call waiting for the previous to resolve. You've turned an async runtime into a synchronous one. Promise.all changes everything. Wrap independent calls in Promise.all and they fire simultaneously. Your 750ms endpoint becomes 300ms the time of the slowest single query, not the sum of all of them. This isn't micro-optimisation. On endpoints that serve every page load, this is the difference between a snappy product and one that feels slow. Layer Redis in front and repeat requests return in 5ms. Cache invalidation is a single key delete. Most dashboard data doesn't change every second — stop pretending it does. Real impact: 750ms sequential response becomes 90ms parallel. Cached responses serve in 5ms. Your database handles a fraction of the load because repeated reads never reach it. Promise.all is one of the highest-leverage changes you can make to a Node.js API. If you're not using it for independent async calls, you're leaving performance on the table every single request. #NodeJS #BackendDevelopment #JavaScript #WebPerformance #API #Redis #Caching #SoftwareEngineering #Programming #WebDevelopment #Backend #TechTips
To view or add a comment, sign in
-
-
How I reduced my Lambda response time from 20 seconds to 5 seconds A few months ago, I built a Perplexity-style search tool that scrapes multiple web pages and uses an LLM to generate summaries. The original architecture was async: Frontend → Redis queue → Node.js worker → Python scraping service → LLM → PostgreSQL. It worked, but took 20-30 seconds per query. When I moved my side project to AWS Lambda to cut costs, I hit a wall. I wanted to use Node.js, but couldn't find solid web scraping libraries, so I switched to Python. Managing dependencies in Python Lambda was painful, but I got it working. Still, 20-second response times weren't great. Then I discovered AWS Lambda Power Tuning. It runs your function across different memory configurations and shows you the optimal balance between speed and cost. Since I prioritized speed, I bumped the memory to 1000MB. Response time dropped to 5 seconds — a 4x improvement. Sometimes the solution isn't rewriting your code. It's understanding how your infrastructure works. #AWS #Lambda #Serverless #CloudComputing #PerformanceOptimization #Python #WebDevelopment #LearningInPublic #SideProject #TechTips
To view or add a comment, sign in
-
-
🚀 Concurrency vs Parallelism vs Asynchronous Programming — Concepts Every Backend Developer Should Understand While working on my backend project with Bun + Hono + Redis, I spent some time understanding three important system concepts that often confuse developers: 👉 Concurrency 👉 Parallelism 👉 Asynchronous Programming Here is the simple way I understand them. 🔹 1️⃣ Concurrency Concurrency means handling multiple tasks during the same time period, even if they are not executed at the exact same moment. Think of it like a chef in a kitchen preparing multiple dishes: • Cooking rice • Cutting vegetables • Preparing sauce The chef switches between tasks efficiently. In backend systems, this allows servers to handle many user requests without blocking. Example: User A → /login User B → /login User C → /login The server manages all requests without freezing. 🔹 2️⃣ Parallelism Parallelism means running multiple tasks at the exact same time, usually using multiple CPU cores. Example: CPU Core 1 → Task A CPU Core 2 → Task B CPU Core 3 → Task C All tasks execute simultaneously, which is useful for heavy workloads like video processing or machine learning. 🔹 3️⃣ Asynchronous Programming Asynchronous programming means starting a task and continuing other work instead of waiting for it to finish. Example in backend systems: Request → Start database query Server → Handle other requests Database → Returns result Server → Sends response This keeps the server fast and responsive, even when operations like database queries take time. 💡 Why this matters for backend systems Modern runtimes like Node.js and Bun rely heavily on: • Event loops • Non-blocking I/O • Asynchronous operations This design allows servers to handle thousands of concurrent connections efficiently. Understanding these concepts helps in designing scalable backend systems and avoiding performance bottlenecks. 📚 Quick Summary • Concurrency → Managing multiple tasks over time • Parallelism → Running tasks at the same exact time • Asynchronous → Not waiting for tasks to finish Learning system concepts like these makes backend development much more interesting. Still exploring and improving every day. 🚀 #backenddevelopment #nodejs #javascript #webdevelopment #systemdesign #softwareengineering #programming #developers #coding #100DaysOfCode #learninginpublic #tech #developercommunity #redis #bunjs #hono #asyncprogramming #concurrency #parallelism #computerscience
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development