This talk (free reg. required) describes the kinds of algorithms used by the likes of Google Docs etc for multi-user editing, and demonstrates a simple implementation. In Scala but applicable to any language.

The main performance issue with String is that in O(n) in the length of the string for mutations (due to the need to take a complete copy).

Both of the Rope implementations above conform to the CharSequence interface (which String also implements), so if you design your application to work with CharSequences instead of Strings then you can start with Strings and switch to Ropes later if you decide you need them.

I'm doing a little research for a server application I'm planning to build. The main function will be - lots of users will be able to perform live editing.

So looking into all the options for a scalable string, which basically be some kind of stringbuffer but be able to handle lots(hundreds?) of threads working on it at the same time with quite a large amount of text.

If you need to deal with very long strings you probably want to use a Rope data structure. There are several implementations available in Java:

It seems to me that it would be a challenge. You need to allow individual users to "lock" the parts of the string they're working on, while others can lock and work on other parts. So basically what you're talking about is a form of database.

You might want to take a look at the sourcecode of Etherpad - it's a Java-based collaborative text editing web app, so it has to have some sort of string implementation that allows concurrent write access to separate regions of the string, presumably without losing data. Of course, whether it fulfills your performance requirements is a different matter...

Instead of reinventing the wheel, I hope to see libraries shared that have such features :) I couldn't really find much with Google.

So I'm currently looking at storing the strings in something like a LinkHashMap or ListOrderedMap now. But still doing more research in the correct data structure ...