Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How does Etherpad's timeline feature work?

How does Etherpad's timeline feature work?

Problem

I would like to understand how Etherpad's timeline feature work.

If you don't know the etherpad software here is an implementation of it - http://piratepad.net/

Do some edits, write something, make bold, use the editor and then on top right you will see timeline. click that and play it.

I can see a JSON response like this - http://img6.imagebanana.com/img/vmot5xt0/Selection_060.png but can anyone break that into something comprehensible.

Here is the piece of code from the Node.js port of it - https://github.com/Pita/etherpad-lite/blob/master/src/node/handler/TimesliderMessageHandler.js#L359

I am very much interested in understanding the JSON response and how it works. Also what database is most suitable for such apps (etherpad, google docs, etc.). Nosql (like mongodb) or sql (like mysql).

Problem courtesy of: user1437328

Solution

When you drag on the timeslider, the relevant changes are sent from the server to the client as you've discovered.

Changes are encoded as instructions that edit the existing document contents to become the new document contents. See https://github.com/ether/etherpad-lite/wiki/Changeset-Library

The original description is: https://github.com/ether/pad/blob/master/infrastructure/ace/easysync-notes.txt

Etherpad runs on SQL primarily. Maybe there is experiments with other DB:s, but most important for etherpad is reading/writing raw tables of changesets. A relational DB is probably the best choice for performance and sanity. MySQL is the default for etherpad. Postgres has been worked on. List of DB tables at http://appolo85.wordpress.com/2010/03/22/first-steps-understanding-etherpad/

(So nosql type of databases is therefore not a good idea. If mysql is too boring for you, perhaps try an all in-memory database to get a nice speed boost. Also note that regular etherpad runs on java+scala on a beefy server, which may be your main obstacle if you want to setup a server of your own.)

Solution courtesy of: Simon B.

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

How does Etherpad's timeline feature work?

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×