Skip to main content

Posts

Build a Redis Rate Limiter From Scratch (Token Bucket + Lua)

Build a Redis Rate Limiter From Scratch (Token Bucket + Lua) Every public API needs rate limiting. Without it, one misbehaving client — or a single runaway loop in someone's script — can flood your service and degrade it for everyone else. Most tutorials hand you a library and move on. In this build we go the other way: a production-grade rate limiter written from scratch with Redis and Spring Boot , so you can see every moving part — the algorithm, the atomic Lua script, the Spring filter, and the HTTP headers clients actually depend on. Watch the full walkthrough, then follow the write-up below. Why rate limiting lives in shared state A rate limiter has one job: count how many requests a client has made in a window of time, and reject the ones over the limit. The catch is where that count lives. If you keep it in memory inside your app, it breaks the moment you run more than one instance — each node counts separately, so a limit of "100 req...
Recent posts

Spring Boot ToDo App with JSP and MySQL: Complete Project From Scratch (Source Code + Fixes)

This is the written companion to my ToDo application video, one of the most-watched projects on my channel. It's a full web app, not just an API: a page that lists your tasks, forms to add and edit them, buttons to mark a task complete or delete it, and little pop-up notifications after every action. It uses Spring Boot 3, Spring MVC with JSP pages, Spring Data JPA and MySQL. All code below is copied from the project on GitHub. I've also gone through the questions viewers posted under the video, so the errors people actually hit are covered at the end, with fixes. How the app is put together Requests flow through three layers, and each class has one job: Layer Class / file Its job View ViewToDoList.jsp , AddToDoItem.jsp , EditToDoItem.jsp The HTML pages, styled with Bootstrap Controller ToDoController Maps each URL to a method and picks which page to show Service ToDoService The business rules: what "mark complete" or "save" actually means Reposito...