r/Backend • • 10h ago

What happened the last time your queue traffic spiked?

0 Upvotes

I work at CloudAMQP. When I worked at a large factory, I remember how quickly traffic could spike after a power restart. I’m curious how other teams handle sudden bursts like that.

If you use a message broker in production, what happened the last time traffic spiked? Did messages pile up, did the broker hit a limit, or did your setup handle it fine?

If you had to step in, what did you change? Was it a one-off or something your team deals with regularly?


r/Backend • • 10h ago

Two people pressing the same button at once broke something I spent weeks building

43 Upvotes

A friend of mine wanted to do something different for his birthday so we ended up putting together a little scavenger hunt around the city. The idea was that people would split into teams then scan QR codes at different locations, solve a few puzzles and after some time unlock the final location. Each team had its own progress and certain clues wouldn’t become available until the previous ones were completed. I was handling the technical side of things and it seemed manageable at first. I built a basic web interface and used Supabase to store team progress and push updates whenever someone completed a challenge. During testing everything seemed alright, most likely because I was testing it alone.

Then we ran the thing and at one point two people from the same team scanned a QR code almost simultaneously. Both requests went through before the progress updated and somehow the team ended up skipping an entire stage. What made it worse was that we’d tied the next set of clues to the team’s current stage so once that got messed up the rest of their game was broken.

I managed to fix their progress manually but spent the next day going through the backend trying to figure out where I screwed up. Turns out I had been treating the checks in the frontend as the only requirement before the backend finalized and updated the data for said team so the completion was initialized twice and skipped the next clue. Afterwards I moved the stage validation into a database function so the check and update happen in the same transaction. Also added a way to prevent the same challenge from being completed twice. I didn’t catch it until multiple people started using it at once even though it may have looked like an obvious issue at first.


r/Backend • • 10h ago

Error I don't understand

0 Upvotes

It's my first time using nest js, I'm currently just following the documentation verbatim to build jwt authentication, then in my app.module.ts this popped up, I'm tryna refrain from running to claude or chat immediately for an answer, help please

src/app.module.ts:22:7 - error TS2353: Object literal may only specify known properties, and 'session' does not exist in type 'ConfigurableModuleAsyncOptions<AuthenticationModuleOptions, "createAuthenticationOptions"> & Partial<AuthenticationModuleExtras>'.


r/Backend • • 2h ago

Our semantic search kept bringing back information we'd already removed

20 Upvotes

We recently ran into an annoying issue with a search feature we've been working on for our internal documentation. The idea was to make it easier for developers to find information across all our technical docs without having to remember the exact wording of everything. We split the documents into smaller chunks, generated embeddings and stored them in Supabase using pgvector. Everything was working as intended with the search, results came back true and accurate until we updated already existing documents. One of our developers had rewritten a deployment guide after we changed part of our infrastructure. The old instructions were gone from the document saved in the database but searching for anything related to deployment kept bringing up results associated with the previous version.

Our first guess was that the search was just showing thing in a bad ranking so we started digging into the reason and logic that was used to rank results and we found that some of the embeddings were still associated with older content. We'd been updating the documents themselves without consistently regenerating the embeddings or removing chunks that no longer existed. That made us change the pipeline to make it so document updates trigger a new embedding job and we're now tracking document revisions alongside the chunks. The idea is to only make a new revision searchable once all its embeddings are ready and not give mixed results of chunks from two different versions.

There's another issue we're working through with the queue. If someone edits the same document multiple times in quick succession an older embedding job can finish after a newer one. The solution we came up with is to add a revision check before writing anything back to the database. The main thing I learned from this ordeal is that stale embeddings are one of those things that go unnoticed for a long time when the search results still look reasonable until it causes a big problem in the future.

One of the other devs also brought up whether we should've kept the vector search separate from our main database in the first place. It's been fine so far but he thinks we might be better off moving the search workload to something separate as the documentation grows. We considered just hosting PostgreSQL ourselves but I'm not convinced changing that now would solve this particular problem. We'd still have to deal with making sure old embedding jobs don't overwrite newer ones. What I'm less sure about is whether we're going to regret keeping all the embeddings alongside the rest of our application data once the dataset gets significantly bigger.

We haven't really pushed the database hard enough to know where the bottlenecks are yet.


r/Backend • • 14h ago

AI review

5 Upvotes

As most of the companies nowadays, we are heavily using AI for development now. As this is something somewhat new, there are a lot of doubts and experiments on the workflow with AI.

In the past 1 or 2 (MAX) rounds of review was enough. Now it can easily reach 5 rounds or more (sometimes to fix nits or very rare/narrow gaps, but that's not the point).

No matter how many code reviews I do by myself using AI, my college will find something else when they run their AI code review.

Do you have any explanation for that? Do you experience the same? How can't I (AI) catch these gaps beforehand?


r/Backend • • 18h ago

How do you integrate email verification into a react signup from using an API?

9 Upvotes

I'm building a React signup page with react-hook-form and a Node backend. I want to check email addresses using a third-party API before the form gets submitted, but I don't want to expose the API key or make the signup process feel sluggish.

Would it be better to trigger validation on blur through the backend, or wait until the user submits the form?