Least taxing way to query and update a table field?
I have a table called favourites, that will store a list of favourite names. For example, lets just say these can be things like
dog
dog
,
cat
cat
,
mouse
mouse
etc
My server side code has an endpoint that receives thousands of external webhooks every 24hrs. What I want to do is when these webhooks come in, look at that data, check a field and see if it exists in the favourites table. If not, add it, if it does, ignore it.
To me, doing the same lookup query for every single request seems a bit silly, since it'll add thousands of database queries.
Is there a better way to do this? All my endpoints are serverless, so storing something in memory isn't really doable either.
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.