Export from SimpleDB to Mongo?
Is t开发者_StackOverflow中文版he move from SimpleDB to MongoDB fairly straight forward? Is there anything I should watch out? Is there any limitations?
Johnny, gate's hit all the highlights, I'm just adding some hot-topic items here that will hopefully help you decide faster if you want to do this or not:
- You use SimpleDB because you don't want to be a server admin, recover lost server, run backups, ensure Master/Slave configurations are working and or buy additional hardware to run the DB on.
- If you use Mongo, you'll have to do all this (unless you go the MongoHQ route) but the payoff flexibility and potentially speed... there is a big "it depends" here.
- SimpleDB has a very simple (Strings only) storage and query model; if your data/use-case is simple, it fits.
- SimpleDB scales amazingly well horizontally (thousands of queries at the same time), but vertically it is fairly slow. So if you plan on a few users quering the bejesus out of your data store, consider something else; round-trips to and from SimpleDB will add up. But if you are trying to create the next twitter and need to service hundreds/thousands of users horizontally, SimpleDB will give you the same performance across all the connections regardless.
- Scaling horizontally with Mongo is very robust... but that also means it can be complex (beyond Master/Slave, which is pretty straight forward). Replica sets and arbiters have to enter into your vocabulary... consider if that is something you want.
- Mongo's query model is as close to SQL as you are going to get with a NoSQL data store; it is very rich.
- Mongo likes to be the only service on a piece of hardware; if you can throw beefy hardware at Mongo, it runs like a dream.
- If you use mongo, you NEED to be running at least two instances on separate machines. If you don't do this, it will work fine until it doesn't... and then your world will melt. If you DO do this, and a server crashes, the other one will take over for you automatically.
So I guess if I had to sum it all up:
- Use SimpleDB if you don't want to get into the server admin game and don't mind the simpler query model.
- Use MongoDB if you don't mind being an attentive admin with good habits and/or need the complex query capabilities.
Hope that helps.
I guess they are both document stores.
So SimpleDB is a hosted data storage with a REST/SOAP API for manipulating data. MongoDB is a data storage engine that you run on your own hardware it uses a series of BSON commands for manipulating data, but most users run one of the supported drivers.
Things that will be different:
- Configuration (you'll need servers)
- Maintenance
- Client code: you need to run with the driver, your queries are probably different
- Indexes
- Paging
- Possibly data structures (different query tools)
- Map / Reduces (done in Javascript with MongoDB)
Things that will be the same:
- The data: they are both document stores and should be able to handle the same basic data
In theory, you can just dump your data from SimpleDB to MongoDB, but there's definitely some legwork involved for the other moving parts of your data.
All that said, I do encourage you to test MongoDB as you may find it provides cost benefits over SimpleDB.
精彩评论