2014년 12월 6일 토요일

Copying Remote Database

First off let me say I am a newB when it comes to Mongo, so excuse my ignorance. With that being said:
Using db.copyDatabase() to copy a remote database:
What impact does this have on the database being copied. Please note the the database being copied is currently being use by a live application.
Would db.copyDatabase() lock the database?
What about performance, would it make the database run slower?
I don't really mind if while coping some new data is being written to the DB. The copy does not have to be exact per say, it just need to be as close as possible to the live DB. But I am really concern about performance issue, is it safe to do this on a live DB?




Basically, copyDatabase reads the data from the source DB the same way something like a backup or full collection query would read it - that means that it may impact the performance of that DB (for example, by bringing more data into RAM which may displace some other data) but the impact would be about the same as running mongodump on that DB.

The docs do explicitly mention that the copied database does *not* get locked.

P.S. if the "from" system is a replica set you can copydb from a secondary which may help with performance concern.


댓글 없음:

댓글 쓰기