#Pricing Question

13 messages · Page 1 of 1 (latest)

slim sundial
#

If each 1M functions costs 2USD. And I have 500.000 messages per month with 100 MAU that need to receive this messages in realtime. How much would it cost convex?

covert canyonBOT
#

Hi @slim sundial. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

To answer your pricing question about Convex, I need to break down how realtime messages work in Convex's pricing model.

In Convex, when a message is sent and received in realtime, there are function calls involved. Based on the information provided in the knowledge sources, here's how it would work:

For 500,000 messages per month with 100 monthly active users (MAU), we need to consider:

  1. Each message sent counts as a function call (mutation)
  2. Each user receiving updates counts as a function call when the subscription is updated

For the sending part, that's 500,000 function calls.

For the receiving part, if all 100 users receive all messages, that would be 500,000 × 100 = 50,000,000 function calls.

In total, that's approximately 50,500,000 function calls.

At $2 per 1,000,000 function calls, the cost would be:
50.5 × $2 = $101

However, it's important to note that Convex's Professional plan includes 25,000,000 function calls per month as mentioned in the limits documentation. So the actual additional cost would be for the 25,500,000 function calls beyond the included amount:
25.5 × $2 = $51

This would be in addition to the base Professional plan cost of $25 per developer per month.

Keep in mind that Convex has automatic caching for query functions, which can significantly reduce the actual number of function calls charged, especially for realtime updates where the same data is being accessed repeatedly.

Also, as mentioned by a Convex team member in one of the Discord threads, they're working on a "Scale" plan that will make these patterns even cheaper, as most of the cost is associated with function calls rather than database bandwidth.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@slim sundial Kapa.ai is still learning and improving, please let me know how I did by reacting below.

slim sundial
#

So if I have 5 active users taht receive 1 message it wouldnt be 5 functions call but rather only 1? Because 4 would be cached?

#

@covert canyon So if I have 5 active users taht receive 1 message it wouldnt be 5 functions call but rather only 1? Because 4 would be cached?

covert canyonBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

You're asking about how Convex's caching affects function call counts when multiple users receive the same message. This is a great question about Convex's caching mechanism.

Based on the knowledge sources, Convex does indeed provide automatic caching that can reduce the number of function calls:

When multiple clients request the same query with the same arguments, Convex automatically caches the result. This means that if 5 users are subscribed to the same chat room and a new message arrives, Convex won't necessarily execute the query function 5 separate times.

As explained in the documentation:

"Convex leverages its deterministic queries to ensure that every specific combination of (query code, parameters, and database read set) executes only once for all online clients." Stack: What is Sync?

And:

"Convex automatically caches the result of your query functions so that future calls just read from the cache. The cache is updated if the data ever changes. You don't get charged for database bandwidth for cached reads." Convex Realtime Documentation

Additionally, in the context of presence data (which is similar to chat in many ways), the documentation notes:

"Its cache primarily uses the function arguments as the key, so our query for all the presence data in a given room will be recomputed once per room, rather than once per user. This means that as the number of users in a room (& their associated mutations) grows, the number of function invocations grows linearly, instead of quadratically, which is a big deal, even for dozens of users." Stack: Implementing Presence with Convex

#

So in your example, if 5 active users are all subscribed to the same query (like messages in a specific chat room) and 1 new message arrives, Convex would likely execute the query function once and distribute the result to all 5 users, rather than executing the function 5 separate times.

This caching mechanism is one of Convex's key features that helps keep costs down for realtime applications.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@slim sundial Kapa.ai is still learning and improving, please let me know how I did by reacting below.

slim sundial
#

@covert canyon great, can this be fact checked by someone from the team?

covert canyonBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

I understand you'd like to have the information about Convex's caching behavior fact-checked by someone from the Convex team.

The best way to get official confirmation would be to:

  1. Join the Convex Discord community where Convex team members regularly answer questions
  2. Create a GitHub issue or discussion on the Convex GitHub repository
  3. Reach out to Convex directly through their official support channels

From the knowledge sources, I can see that Trusted Support Staff members have provided similar information in Discord threads, but for an official confirmation specific to your use case, direct communication with the Convex team would be best.

The information I provided is based on the documentation and community discussions included in the knowledge sources, but getting direct confirmation from the Convex team would ensure you have the most accurate and up-to-date information for your specific scenario.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: