Rank 2: Process
Heyo! I have a question about how to size my string lengths in Appwrite Cloud DB. And then a thought I had on a way to possibly approach this. This is mainly to better understand how to optimize my document attributes to minimize costs for storage and transfer when Appwrite is released.
My Understanding So Far
- String attributes are
varcharinternally and need to be sized - MariaDB is used with InnoDB
Thus, storing any amount of data -- even a single character -- in a varchar(16000) attribute will consume the full 16kb of the storage allocated
So Does That Mean...
A NULL value will store only 2 bytes? Meaning if I have a nullable varchar(16000), it will either consume 2 bytes of storage or 16kb of storage?
Why I'm Asking
I have a column that is going to store a user's document content. The content can be freeform text...like this post that I'm making right now. It means that it is not only incredibly variable in length, but it could take up a significant amount of space.
Is This a Problem?
Assuming everything I've mentioned so far is accurate, is this an issue? Since there isn't much information on the pricing structure for Appwrite...is this going to be an issue? If the cost structure somehow works around the storage on disk or something, then please let me know and you can ignore my optimization idea.
What Do you Think of This Optimization?
What if I partitioned this field into multiple nullable fields?
Instead of: content varchar(16000) nullable
I have something like: content_one varchar(1000) nullable ;content_two varchar(2000) nullable; content_three varchar(4000) nullable; etc and combined these columns together when rendering the content.
In theory, if I have a lot of users and a majority of them are creating very little content but there are a few power users who are creating a lot of content, I could save on costs.
Thanks for reading! Open to any feedback.
