I want to implement a real time Collaboration editor like google docs because I want to keep data on my own servers.. Can anyone suggest me architectural points to build that...what should be stack on server side, how to send edit diffs etc..
I'm working on something similar: https://wikidocs.com. Although our's closed source at the moment (can't say whether or not it will remain closed), we will provide a downloadable package you can run yourself.
http://simperium.com/ is exactly what you need. It serves as a real-time data layer; you can push/pull from it from the browser, and pull/push to it from your server too.
Check out http://firepad.io, it's an open source project that uses Firebase on the backend. You could use that as a starting point and then put together your own backend.