puchesjr
puchesjr6d ago

Convex pricing model

Question as i'm putting my head around how convex works, so if i understand this correctly, we are charged for function calls essentially not per row/document read, as well as storage. if that is the case, if we were to run a transactions to update a record say lead and create an audit trail record, would that be completed in 1 function or is that considered 2?
18 Replies
Nicolas
Nicolas6d ago
Convex charges for both function calls and database bandwidth (which would be increased whenever you read or writes rows to your DB) If you're doing multiple reads or writes in a single Convex function it would count for only one function call but the DB bandwidth might be higher Both the free plan and the Pro plan have a certain included amount of both function calls and DB bandwidth, see https://www.convex.dev/pricing
Convex
Plans and Pricing
Choose the plan that works best for you and your team.
whatisagi
whatisagi6d ago
@puchesjr Why are you having to worry about price so early? Is it because you find the price prohibitive?
puchesjr
puchesjrOP6d ago
This is perfect. Thanks for the info. Yea, I understood the bandwidth and storage, was less clear if a function was say the update function on the lead and a create function on the audit log.
Nicolas
Nicolas6d ago
“Function” here means a Convex function, see for example https://docs.convex.dev/functions/mutation-functions
Mutations | Convex Developer Hub
Mutations insert, update and remove data from the database, check authentication
puchesjr
puchesjrOP6d ago
Not worried about the pricing, trying to be conscious of how it is priced. Built a pretty complex system with couchdb, and recently Firestore where we are charged per read/write/delete. we were performing hundreds of millions of reads per month. We took great care in denormalizing our data to match our reads and optimized for that use case. I love everything I’ve read and everything dug into about convex. Now that we are starting a new project, I want to give it a full go. But, I have a budget and need to be sure I account for the spend and forecasted spend as we grow
whatisagi
whatisagi6d ago
Thanks for the info. Are you finding the pricing here reasonable, based on your experience? I’m also using convex to build a new project btw
puchesjr
puchesjrOP6d ago
that is what i am trying to calculate / forecast now. to give you an idea why i was trying to understand the function cost. with firestore - because this is what we were considering staying with, the price per document read is $0.06 per 100k and the cost for writes is $0.18 per 100k. To be clear is this per document read. convex on the other hand charges per function, if we were comparing single document/record read per service then convex would be much more expensive with growth. but, because they charge per function, and a function can return up to 8MiB of data that implies I can return say 100, 200, 500 records per function call and only be charged for the 1 function call and the bandwidth, as well as storage for the data. convex, because of the function pricing is a clear winner on writes - because firestore charges $0.18 per 100k writes. which is $1.80 per million, and while convex is $2 per million, you can do multiple writes in the function and you only incur 1x fee. whereas with firestore, when we perform a transaction, we incur a cost for each document we touch - so if we touch 2 documents we incur 2 writes. whereas, with convex we would only have 1 function charge. now, our system will be a good blend of reads and writes, but it is a shade heavier on the writes. Think accounting where you will make a bulk read of data, and then you will update documents like invoices paid, parts added, etc. now, what is less clear to me is how the real-time updates are charged, are we charged for the real-time update when the documents are changed? or are we only charged 1x for the connection and any possible reconnections, as well as bandwidth final question, how is the real-time updates charged? if i understand the docs, i'll be charged for the initial function call which should establish the websocket connection, and then i'll be charged for the bandwidth, but if the connection breaks and has to reconnect, are we charged again? are we charge for a function call per update that comes down the wire? or is it only the initial connection?
whatisagi
whatisagi6d ago
I’m also wondering about how the real-time is charged. If you make a write to your db, and you have say 1000 different people connected to the UI from 1000 different devices, they’ll also see an updated version of the UI. Will that be then counted as 1001 function calls?
puchesjr
puchesjrOP6d ago
so in firestore, you are charges the 1,000 document reads for each person connected + 1 for your devices document update. if i understand convex properly, this will not be the case, we will be charged for the bandwidth once the websocket is connected/established, but i would like clarification here
whatisagi
whatisagi6d ago
Yeah this is an important point. I hope it’s not the case, because then it means convex will be only suitable for small scale real-time apps. @jamwt @james Well I found this
Explicit client calls, scheduled executions, subscription updates, and file accesses count as function calls
If you use useQuery to get updated UI it’s counted as a subscription update in the case above so I think it’s 1001 function calls then? (Note that given the number of free function calls given 1 million I think this is indeed the case.)
jamwt
jamwt6d ago
UI from 1000 different devices, they’ll also see an updated version of the UI. Will that be then counted as 1001 function calls
this is correct in the pro plan. however, we have a different plan that charges for execution time inside a query/mutation instead of a blanket "function call", and then cache hits are significantly cheaper--for customers at the scale where this is meaningful. the pro plan is just designed to be simple out of the gate, and it works out for 99% of projects until their traffic gets really serious
james
james6d ago
note that there is no db bandwidth charge for 1000 of those queries, since they'll be returning the same cached result
puchesjr
puchesjrOP6d ago
Yes, once we get to 50,000,000 reads we'd updates we would need to work with you all on that pricing.
james
james6d ago
like Jamie said we want to make cached results like this much cheaper, since we have true query caching and they don't actually need to touch the db
jamwt
jamwt6d ago
exactly. cache hits are actually very cheap for us the pro plan is priced that way to be easier to understand, not because we want to get away with crazy margins on cache hits. for customers with that kind of scale, we pass through more savings
whatisagi
whatisagi6d ago
Thank you for the info! It’s quite reassuring to hear this.
puchesjr
puchesjrOP6d ago
no problemo. one one of our smaller apps we do roughly 25 million reads per month. this is Firestore.
No description
puchesjr
puchesjrOP6d ago
One of our internal tools uses firestore with 44+ million reads a month, 12+ million writes per month, and over 300GB of stored data. Firestore works great oh and we pay less than $100 a month for that.
No description

Did you find this page helpful?