Making backups and importing data – Mongo and xDB part three

There are a few ways you can make a backup with Mongo. The most simple is to take a copy of the database files and put them somewhere safe. This is made easier if you’ve put each database into its own directory. However, this is a pretty naive method as you will have to stop the server and restart it. You also will be taking a full backup. That said, this method does have its uses in a scenario where you are messing around with a secondary but that’s beyond the scope of this short post.

Its possible to extend this a little by using mongodump against the file system. The tool will lock the files so the database cannot be in use at the time but it at least provides a binary export of the data.

For a developer scenario, its more likely that we’ll be using mongodump, mongorestore, mongoimport and mongoexport against our running database. We may need some data from a co-worker or from the live system or we may be the provider of some data to another member of our team.

Continue reading

Advertisements

Using MongoDb to provide items as a Cache for Sitecore.

Ok, so I finally managed to get my MongoDB hat back on recently and first thing that struck me is that I forgot how much I love it as a product, the driver is easy to get to grips with, its a doddle to set up and hyper fast :D.

Below I have listed a starting point that I have been working on to serve the latest version of content from Mongo, in part this is to help out in the content editor (and in particular, that item.GetChildren() causes the default item provider to return the latest version from the database, but I expect to extend this to be able to serve all of the web content from such a provider.

This post at present is the basis of a working idea that I have been playing with, but I think with refinement (and certainly until Sitecore provide us a full blown MongoDB based version) it might have mileage to enable us to squeeze a little more performance out of our existing implementations.
Continue reading