Recommended Free Tools
When people in a student house share one internet connection, an IP-based rate limit can treat their separate accounts as one caller. In Daniel Pertu’s Notifio example, the application instead keys notification limits to each customer’s licence token, so one buyer’s activity does not consume another’s allowance. That approach fits a licence-based notification endpoint; the right key depends on which identity or resource the limit is meant to protect.
Why an IP address can combine unrelated customers
An IP address identifies the network address a server sees, not necessarily the person or account making a request. A home router, university network, residence, office, or coworking gateway can send requests from many people through one public address. If a limiter counts only by IP, those people may share one bucket even when each has a separate licence.
As an Amazon Associate I earn from qualifying purchases.
Pertu illustrates this with six people in a student house: a limit set for one person’s expected activity could be exhausted by the household’s combined requests. The six-person scenario is an example, not a measured study. The underlying design issue applies whenever a network address is shared.
Choose the rate-limit key that matches what you are protecting
| Key | What it represents | Trade-off |
|---|---|---|
| IP address | The network address observed by the server | Useful when limiting traffic by source network, but shared NAT can combine different customers in one bucket. |
| Licence token | An application-level customer identity in Pertu’s design | Separates licensed customers behind one NAT, but requests without a token still need a bounded path. |
Pertu’s advice is: “Rate limit the identity you are actually protecting.” It is the author’s design guidance, not a standards-body rule. An IP-based limit can still be useful for bounding unauthenticated traffic or abuse by source network; it need not be the only limiter.
#1 Best Overall
Keep endpoint budgets separate with a key namespace
In the described implementation, `/api/notify` and `/api/validate` use the same Redis-backed limiter instance, but the notification route adds a `notify:` prefix to its key. This keeps notification traffic in a separate key namespace: frequent validation requests cannot consume the notification bucket merely because both routes use the same limiter.
The route forms its key as notify:${token || ip}. When a token is present, the token identifies the notification bucket; when it is absent, the first forwarded IP value is used as a fallback. The endpoint rejects a missing or invalid licence later, but the fallback ensures tokenless requests still encounter a bounded bucket rather than collecting in one unlimited bucket.
The example is configured for a sliding window of 20 requests per 10 seconds. That is Pertu’s code example, not a universal threshold or a performance measurement. Set a quota according to the resource, expected legitimate use, and abuse risk in your own application.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Validate requests and return useful failure signals
Pertu describes one `/api/notify` route with a `type` field for four notifications: new listings, authentication failures, blocked sites, and reply confirmations. Before sending an email, the route checks the licence, its email match and active state, and the payload’s shape.
The described response contract assigns distinct HTTP statuses to different outcomes:
- 400: malformed payload.
- 403: missing, mismatched, or inactive licence information. The route uses the same message for these cases rather than revealing which credential detail was valid.
- 429: the request has exceeded its rate limit.
- 502: email delivery failed.
These distinctions give a client actionable signals, which matters when the installed application cannot be updated quickly. The author’s stated principle is: “Never return success for work you did not do.” In this example, the desktop application updates its “already seen” baseline only after an alert is delivered; falsely reporting success could suppress a later notification.
Rank #4
Handle listing content as untrusted text
Listing titles and URLs originate outside the notification service, so Pertu escapes them before inserting them into HTML email. The implementation also provides a plain-text counterpart for each email type. These steps help prevent third-party text from being interpreted as HTML and ensure the message is not available only in HTML form.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteWhen a licence-keyed limiter is the right fit
A per-licence bucket is a sensible fit when the allowance is intended to apply to each licensed customer, as in Pertu’s notification example. It is not a substitute for deciding which resources need protection: a service may want a customer-level quota for normal use and a separate IP- or network-level control for unauthenticated traffic or abuse. Choose the key and namespace deliberately, then ensure every request path—including requests with no valid identity—has an appropriate limit.
Best Value
- Used Book in Good Condition
Implementation details above describe Daniel Pertu’s Notifio article, “A student house is one IP address, so our rate limit counts licences”: DEV Community.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




