fossasia / loklak_webclient

loklak web application
http://loklak-web.herokuapp.com
MIT License
1.56k stars 49 forks source link

Walls disappear if loklak.org switches to backup server #548

Closed mariobehling closed 8 years ago

mariobehling commented 8 years ago

Currently walls work, but if the main server is down and loklak.org switches to the back up server all the walls are gone. What solutions are there? Should we save all data in the web client instead?

screenshot from 2015-12-25 18 34 26

sudheesh001 commented 8 years ago

I think this issue is more about the server, saving the walls in the webclient would mean that we'd have to maintain either a database / in-memory keystore like that of redis to store "username" and the walls they've created, so that it the server moves to the backup server, the apps configuration part of the user profile isn't affected, But I still believe snapshots taken to the backup server of users based on some kind of a preference would solve this problem ?

TL;DR: Give a higher preference to user profiles using loklak.net and snapshot the apps part to the backup so that we don't lose the walls content. Maybe @Orbiter can help us more.

I am really interested in what @aneeshd16 Would have to say too ?

mariobehling commented 8 years ago

@sudheesh001 Yes, the question is if we store the wall config in a db or keystore or keep it info in the server. I think keeping the web clients and the server separate makes sense. Looking at how people are interested in the system, we should focus on providing data with loklak.org and running app on loklak.net or elsewhere. loklak apps would just be like twitter apps. They cannot store info on twitter but they can use the API. So, I see loklak.org in the place of twitter, weibo etc.

codethejason commented 8 years ago

The same thing happened to me. I created a wall yesterday and now it's gone.

sopankhosla commented 8 years ago

+1 @mariobehling

sopankhosla commented 8 years ago

The API should be totally separate from what the applications (based on it) require or do. It would be better if the metadata is stored on client side for removing dependence of loklak.org on loklak.net and other apps similar to it.

aneeshd16 commented 8 years ago

At this moment there is no client side datastore. All data is stored/retrieved from the loklak server running on the same host. Running our own db would pose many challenges. How do we sync data from local db and loklak server? How do we handle conflicts if the data is different in both? If the server switches to a back up one, the backup server should have a backup of the data as well, right?

Conceptually, keeping the API and user data separate sounds like the right thing to do. A Mongo deployment on the webclient VM seems like a good way to start? @sudheesh001 ?