mysociety / popit

DEPRECATED - Development on PopIt has stopped and it is no longer being maintained
https://goo.gl/Vvej4Q
Other
76 stars 33 forks source link

allow atomic replacement of a PopIt instance #462

Open mhl opened 10 years ago

mhl commented 10 years ago

For the People's Assembly site our plan is to mirror the Pombola database to a corresponding PopIt interface using:

Unfortunately this takes a long time to run, because all the people organisation and memberships have to be deleted one by one to empty the database, and then recreated one by one. It would be nice to have (perhaps) some mechanism for POSTing PopIt entities into a temporary database and then renaming it into place, similar to the idiom for safely updating files via writing to a temporary file that's then atomically renamed into place.

... or find some other way of making it possible to do this kind of bulk update that may be slow (and may fail) without affecting use of the API by clients while it's happening.

mhl commented 10 years ago

Although we can now import Pombola data using mongoimport there would still be significant downtime, both while the import is happening and when the elasticsearch reindexing is happening. Being able to rename databases in MongoDB seems to be a long-requested feature: