Eternal Mori
Eternal Mori2w ago

Is this the correct way of processing data?

I am kinda new to convex and I am experimenting to check if I should migrate my existing app to convex. So I try to migrate the most demanding part of my existing app over to convex. If it can handle that, it can handle everything else to. I just started and created a workflow that truncates a summary table and go recursivly over all the data needed to do processing on to fill back up the summary table. In my old app, the script takes around 30 seconds to run. With the exact same data for only the current part of the code (below) it is still going (23 mins at the moment) without even processing anything. My question is, is this the correct way of doing this work in convex? https://pastebin.com/KjQYtYwM
Pastebin
import { v } from "convex/values";import { internal } from "../_gen...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
3 Replies
Convex Bot
Convex Bot2w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
Eternal Mori
Eternal MoriOP2w ago
Here is also a bit of context I posted in #general yesterday: https://discord.com/channels/1019350475847499849/1019350478817079338/1360288766614442177
Convex Bot
Convex Bot7d ago
<@35h6nwr87agxv93r3r7a5v5a9fxnw28>: That looks reasonable, the only bit that comes to mind is doing Promise.all on the deletes. I usually do smaller batch sizes like 100 (helps avoid contention if other thing sare writing at the same time), but if there aren't writes, should be ok <@35h6nwr87agxv93r3r7a5v5a9fxnw28>: You can look at scheduled jobs on the Dashboard. If you're on a free plan, there's a limit of how many mutations run in parallel (16 I believe)

Did you find this page helpful?