Menu

Building a Postgres-Backed Rate Limiter for Public Netlify Functions
📰

Building a Postgres-Backed Rate Limiter for Public Netlify Functions

DEV Community: postgres·the bomber·about 6 hours ago
#BCHWc5uS
#devtopostgresql#devto#dev#client#const
Reading 0:00
15s threshold

I am Kaleb, a web developer running Dream Futures Tech right out of Pompano Beach, Florida. Recently, I added a public chat widget to my own business website to let visitors drop quick questions. Because the endpoint lives on a Netlify serverless function, it is completely open to the public internet. Within a few days of deploying it, I noticed automated script traffic trying to hammer the endpoint. I needed a reliable rate limiter without paying for expensive third-party edge security tiers.

Netlify Functions are great for hosting lightweight APIs, but they are stateless and spin down when idle. Relying on an in-memory cache inside the function container does not work because the container instances scale up, down, and across regions.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.