HNhai nguyeninhainguyen.hashnode.dev·Jul 19, 2024 · 3 min readThe Importance of Idempotent APIsIdempotence is a concept where clients receive the same response for multiple identical requests. With idempotence, calling endpoints multiple times results in the action happening only once. This is important because it ensures that if a client repe...00
HNhai nguyeninhainguyen.hashnode.dev·Jun 16, 2024 · 2 min readUnderstanding Consistent Hash Ring: A Simple ExplanationProblem 1: We have a set of servers and need to distribute data and requests to those servers in a manageable, uniform way. If the data size increases (or the number of requests we need to serve increases), we can add or remove servers from the clust...00
HNhai nguyeninhainguyen.hashnode.dev·Jun 9, 2024 · 2 min readUnderstanding Python's Import ContextImporting modules in Python can be confusing. It works, but many people don't understand why it works. A typical scenario: We encounter a ModuleNotFoundError, search online, and eventually we find a workaround or a way to make it work, but we don't u...00
HNhai nguyeninhainguyen.hashnode.dev·May 30, 2024 · 2 min readSafety and Liveness in Distributed systemSafety: Something that must never happen in a correct system. Liveness: Something that must eventually happen in a correct system.. We will use a banking system as an example in this article. Safety: We can't let users withdraw or transfer more money...00
HNhai nguyeninhainguyen.hashnode.dev·May 20, 2024 · 3 min readTraditional way to scaling PythonSome traditional methods to scale a Python program Threading Pros: Lightweight compared to processes Multiple threads can share memory (this can also be a downside) Cons: Python has a GIL, so it's not good for CPU-heavy tasks Sharing memory bet...00