What's the max payload side for an action, mutation, etc.

Trying to currently determine the best way to store really long documents within convex (currently paginating their content for dispalying them). Now how do I save these really long form documents is there a recommended approach/limitations that may be helpful to be aware of?
5 Replies
james
james2y ago
i need to get a more thorough limits doc up sometime soon. currently a lot of these limits are scattered through our documentation or missing * a query or mutation can read or write 8MB * each document can be at most 1MB * arguments and return values to queries/mutations/actions can be at most 8MB total * http actions allow 20MB requests/responses * files are currently limited to 50GB but will generally hit a timeout beforehand, so we should introduce a lower limit to avoid developers having to think about timeout-based limits if you have very large content then generally the approach would be to split these into separate documents in the database or to store these as files if you don't need to treat them as metadata if there's a specific use-case where these limits aren't sufficient let's chat further and figure things out
Chad Maycumber
Chad MaycumberOP2y ago
if you have very large content then generally the approach would be to split these into separate documents in the database or to store these as files if you don't need to treat them as metadata
This was exactly what I was thinking. Do you have a recommended approach here? Especially for something that might be updated periodically? I guess my question from a bandwidth perspective if I'm doing a lot of updates on largish files maybe that could get expensive?
james
james2y ago
if it's file content that doesn't contain structured metadata that you need to filter on etc then that sounds like a file to me, in which case file storage is the best bet. file bandwidth is $0.3 per GB so ideally that would be pretty cheap regardless of workload if it's structured data, or data with a structured component, then that could be a document in convex with a pointer to a file for the large unstructured content
james
james2y ago
e.g., if storing a user with a profile photo, the user info would be in a document but the profile photo itself would be in convex storage https://docs.convex.dev/file-storage this sample app stores image data in file storage and stores the ID in a table: https://stack.convex.dev/using-dall-e-from-convex
File Storage | Convex Developer Hub
Store and serve files of any type.
Using Dall-E from Convex
Use Convex to fetch an image from OpenAI’s image generation service based on a user-provided prompt.
Michal Srb
Michal Srb2y ago
Error Handling | Convex Developer Hub
There are three reasons why your Convex

Did you find this page helpful?