Rate Limiting Algorithms
Your API gateway allows five requests every ten seconds. A client sends five at 9.9 seconds and another five at 10.1 seconds. All ten reach the backend. Wait, how did that pass? It depends on what you meant by every ten seconds. If you’re counting in blocks, the requests landed in two different blocks. If you meant any ten-second stretch, the second batch should have been rejected. And if you just want to allow a small burst without letting the client keep hammering the backend, you probably want a different rule altogether....
Rebasing a Stacked Branch After a Squash Merge
A situation that happens a lot in teams: a teammate opens feature-a, you need their work, so you branch feature-b off it and keep going. A few days later feature-a gets merged into main. Now you want feature-b to sit on top of main. The obvious move doesn’t work You run git rebase main and… conflicts. Lots of them, in code you never touched. The reason: feature-a was squash-merged. Its 5 commits were combined into one brand-new commit S on main....
Circuit Breaker
Your order-service calls payment-service over HTTP. One day payment-service doesn’t go down. It just gets slow: every request takes 30 seconds, then times out. Here is what happens to order-service: Each incoming request waits 30 seconds on the payment call, holding a goroutine, a connection, some memory. New requests keep coming in, and they wait too. The connection pool runs dry. Requests that have nothing to do with payments start to queue....
Wails App 101
💡 Idea An desktop app that take screenshot every specified minutes and upload to the server so your manager can track your work progress (read micro management). 📝 Requirements Not electron Cross platform Fun to develop 🛠️ Tech Stack Wails with Golang for OS level’s tasks Vue for frontend (UI will be simple, so Vue, React, Angular, whatsoever is fine) 💅 Design I found the Linear design system is very cool and it has a community version in Figma https://www....
Clone Apps Collection ✨
🙏 Here are some clone apps that I made in 2023. Most of them are abandoned, I just want to bootstrap and play around with them, as well as try out new technologies. 1. Teams 👉 Demo I didn’t find a way to host a React app along side with Hugo, so if you manually enter some path like /team-clone/sign-in in address bar, you will end up with 404 page 😅...