greends
greends•2y ago

All access to documents is mediated through Convex functions.

So does this mean 1M database queries cost $2 USD https://stack.convex.dev/convex-vs-firebase
No description
7 Replies
gautamg
gautamg•2y ago
A function call can contain multiple database queries; it might be better think about function calls as just "a request to the backend". It's $2 USD for every additional 1M calls after the included 25M!
greends
greendsOP•2y ago
Single or multiple, every database query counts as a function which counts against the quota, right?
ballingt
ballingt•2y ago
No, a Convex query function like
handler: async (ctx, args) => {
const task1 = await ctx.db.get(args.taskId1);
const task2 = await ctx.db.get(args.taskId2);
// do something with tasks
},
handler: async (ctx, args) => {
const task1 = await ctx.db.get(args.taskId1);
const task2 = await ctx.db.get(args.taskId2);
// do something with tasks
},
does two database queries, but running this function counts as a single function call.
greends
greendsOP•2y ago
handler: async (ctx, args) => {
const task1 = await ctx.db.get(args.taskId1);
},
handler: async (ctx, args) => {
const task1 = await ctx.db.get(args.taskId1);
},
but this also counts as a single function and there's no other way to query the database
ballingt
ballingt•2y ago
yeah that's right
greends
greendsOP•2y ago
That seems to be an extremely inefficient pricing scheme for my chat app. It's so extreme, I feel like I'm in the wrong business....
I should wrap Firebase and resell it 😄 hahaha
ballingt
ballingt•2y ago
It's true Convex isn't the right fit for everything, but curious about the math there, would you mind walking me through it? I'd like to make some pricing estimators for cases like this. @greends left but if anyone else is doing napkin math here I'd love to see. The math I'm doing makes this look reasonable, and the paid plan compares especially well against websocket push services like Ably and Pusher.

Did you find this page helpful?