Size of text fields, large amounts of text

Are there recommendations for text field sizes? When writing apps, you can support virtually unlimited text (writing an email, writing a blog entry, taking notes, etc.), but databases require you to awkwardly specify sizes for text fields. What if I want a comment to support lots and lots of text – say someone copied an email thread. Do I set it to 100,000 and hope it fits? How much data does a JSON field support? How do the different sizes affect performance? Do they map to CHAR, VARCHAR and TEXT depending on the size? Is this something the Aurora documentation would help with?

2 Likes

Yeah definitely keen to hear if there’s a column type / data type that supports arbitrary text lengths

Hey @mike_ekim1024!

So the optimizations that get passed along/adopted are those that are native to Aurora MySQL. Aurora ends up taking different text character counts and mapping them to different types, like anything below ~10,000 would map to VARCHAR, ~20,000 MEDIUMTEXT, 10,000,000 LONGTEXT (roughly). For totally arbitrary text storage, go ahead and put a huge Max, like (10-million).

We played with Aurora to uncover these limits, but don’t have exact documentation from Aurora for it.

1 Like

This is good to know, thanks Sebastian. If I understand the, the main difference is when filtering records. Large text is not stored in the row, so performance can be affected when searching lots of “comments” for example.

Good question, Mike. I’m not 100% sure about that. @evgeny.semushin might be able to help out!