我们计划从mysql迁移到mongoDB。我想知道是否有一个工具或任何其他资源可以帮助我创建迁移计划。例如,(与公司的表,应首先移动,然后用户的详细信息,等等),以便迁移可以顺利。
发布于 2012-11-13 18:28:07
不能简单地将MySQL模式迁移到MongoDB (或任何其他文档数据库存储区)。存储数据的方式完全不同。请记住,没有联接,您很可能需要对数据进行去角色化,并将某些数据嵌入到其他文档中。这不是什么可以自动化的东西。
这里的数据库是完全不同的。您需要从应用程序端了解如何读取和写入数据、在何处进行连接、如何最好地架构您的新模式以使用MongoDB,而不仅仅是将其用作关系数据库管理系统。搜索"MongoDB模式设计“,了解您需要考虑的内容。
发布于 2012-11-13 21:11:51
首先,您必须了解表和查询之间的关系。
1. If the relation is `1:1`, you can simply merge them into one table and do migrate.
2. If `1:n`, you can embed the `n` side into `1` side. But merge(embed) or not should be according to your query. For example: if two tables with `1:1` relation never be read together, you can just migrate to MongoDB directly without merge.
3. Though `n:m` can be implemented with MongoDB, you have to manage large redundant data or process `join` yourself. But if you really really want to do this, that's OK. But the performance may be a problem.
1:1和1:n关系的表,我只是将它们合并并嵌入到一个表中,这样很容易,性能也更好。https://stackoverflow.com/questions/13364474
复制相似问题