The check is: count today s rows for this user, and if the count is under the limit, run the call and insert a row. That works for one request at a time. If a client sends 10 requests at once, all 10 can read count = 2 before any of them insert, so all 10 pass.
On serverless, this gets worse, because an in-memory counter doesn t help. Each request may run in a different instance with its own memory.
The fixes I m weighing, all in the database:
A unique constraint on (user, day, slot number). Each request claims the next slot, and a duplicate insert fails. It s simple, but I need to handle the retry.
An atomic counter. One SQL statement increments a per-user-per-day counter and returns the new value, and the request is rejected if it s over the limit. There s no gap between checking and counting.
An external store like Redis. It s fast, but it s one more service for a small stack.
Lots of app makers here run creator or UGC programs alongside their launches, so figured this is a good crowd to ask.
Views are easy to count. Installs mostly too. The tricky bit seems to be knowing which creator brought the people who actually subscribe, and who's still around a month later.
I used to fall into the trap of spending weeks polishing a feature just because I thought it looked cool on paper without ever checking if users actually felt the pain point. One time I showed a quick prototype to a user right before coding it, and they flat out told me they already solved that exact problem using a basic spreadsheet template. It hurt my ego for a minute but it saved me from wasting days on code nobody wanted.
Do you show your raw ideas to users early on or do you prefer building the whole thing in secret first?
Reading bug reports or feedback forms is one thing, but watching someone actually open your app for the first time and struggle with things you thought were totally obvious is painful.
I sat behind a beta tester last week and watched them bypass our entire onboarding flow using some bizarre workaround I never could have imagined. It made me realize how trapped we get in our own design logic.
When was the last time a user session completely broke your assumptions about your own software?
I found an old notebook last week. From before I started any of this. Full of ideas about what I wanted to build and how I wanted to build it.
The person who wrote that notebook had principles. Strong ones. He believed in doing things a certain way. He had opinions about what was right and what was cheap.
Someone showed me their workflow last month and I did not recognize my own product in it.
They had built their entire process around a feature I considered minor, ignored the feature I was most proud of, and used a workaround for something I thought was obvious.
Someone sent me a bug report that made me sit back and stare at the wall. Not because it was harsh. Because they were right, and it was a fundamental problem, and fixing it properly meant rebuilding something I had built a year ago and was proud of.
For about an hour I did not want to do it. I wanted to close the tab and pretend I had not read it. The whole thing felt like being told my house had a bad foundation and the roof was fine.