• davel [he/him]@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    21 hours ago

    I know it was just an example to make a point, but my first assumption was that there would be a web server or something in front of the application, and so I’d rate limit the API path at that level, before the calls even reached the application.

    • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      21 hours ago

      Yeah, I’d typically front an app with something like nginx and farm off stuff like rate limiting or tls handling to it instead of having to worry about it in the app itself. The general point in the article is solid though. I’ve started using this sort of heuristic to evaluate libraries as well. I first try to think of how I’d solve the problem conceptually, and then once I work through that and have a good mental model of what I want, I’ll look for libraries and try to find one that’s closest to the way I think about the problem.