Compress text in-memory
Summary: The high concept is as the title says: compress all of that text while it is in RAM
Note: this is extremely hypothetical. This ticket is to think through and design an approach.
One of the great strengths and weaknesses of Querki is that everything lives in RAM. That gives us a lot of power, but also means that the system is dangerously memory-hungry.
Much of that in-memory content, though, is strings. What if we compress those?
The high concept here is that, for each Space, we maintain a shared, immutable dictionary, which we use for compressing all of the text in that Space. One Actor is responsible for maintaining the Dictionary; as new text gets added, it updates the dictionary accordingly. The Dictionary is shared amongst the Space, the user views of that Space, and the Conversations.
Thus, the data structures that we maintain everywhere aren't using literal Strings -- they are maintaining basically indexed lists into the Dictionary.
The Dictionary is strictly in-memory and transient: it is not guaranteed to be the same from load to load of the same Space, just consistent within the current load.
This needs to be implemented in a way that supports search as well; that probably strongly bounds the solution.
Keep in mind things like capitalization, punctuation and other unusual characters. This is not just a simple alphanumeric dictionary.