Field name length impact on bandwidth
We use a ton of really long and specific Field Names, I'm assuming this doesn't eat bandwidth anywhere within convex and across the web sockets as it all gets optimized by compliers and such right?
8 Replies
Field names do impact payload, and afaik are not optimized anywhere within our stack.
I wouldn't really worry about their length though, we already limit top level fields names to 64 characters and nested field names to 1024 characters.
I was the skeptic about these things being optimized. lol Dispite the argument data is cheap. I'm definitely going to thin out some stuff then 😅 Id say in a normal system its fine but we are doing too many n squared things where most data gets sent to every other user on the site after being transformed/customized for their view.
I'm surprised i don't see more enum usage. It doesn't seem too impossible to toss a fieldName translation layer in the constructor functions at some point while not losing dev experience, only dashboard.
It also complicates migrations, imports and exports
While both storage and bandwidth are getting cheaper and cheaper as time goes on
Ampp, What do you mean by "thin out stuff"? Like change the column names to something shorter, or make more tables/joins so that you return fewer fields per query?
Mostly thinking of shrinking some field names, as we don't have a lot of big tables. Field names are bigger then the contents in some. As I understand it bandwidth to the client is basically unaccounted for because convex charges for the read of the whole row and not what gets sent over the web socket.
Hmm interesting. it's surprising to me if there's actually enough money to be saved doing this effort, because I think changing column names would need a full migration to a new table
We are just going to minimize things for now as long as it doesn't sacrifice clarity. As losing clarity could be quite expensive. But we aren't in production yet, so no migration needed.
I’ve put out a feature request for comments for columns, especially in schema.ts. Maybe that will help