Creating a rate limiter entails regulating the number of actions an entity (such as a user, IP address, or API) can execute within a designated timeframe. A widely used approach is the Fixed Window Algorithm , which tracks the number of requests made during the current time window. For example, if a user is permitted 100 requests per hour, once they reach that limit within any segment of that hour, any additional requests will be blocked. Nonetheless, the Fixed Window algorithm can inadvertently permit double the allowable requests near the boundaries of the time frame, specifically at the end and beginning of the window. To address this, the Sliding Log Algorithm offers an enhancement by recording the timestamps of each request in a log, thereby mitigating the risk of a sudden surge in requests that can occur with the fixed window approach. However, this method requires more memory to accommodate the storage of all request timestamps. A more memory-efficient alternative is the Sliding Window Counter Algorithm , which, unlike the Sliding Log, only keeps track of the total number of requests and the timestamp of the earliest request within the current window. When developing a rate limiter, the selection of the algorithm is influenced by the specific requirements of the system. Factors such as the level of protection needed, available resources, and the balance between precision and memory consumption must all be taken into account.