将数据从 Oracle 移动到 Cassandra 和/或 MongoDB
在工作中,我们正在考虑从 Oracle 迁移到 NoSQL 数据库,因此我必须在 Cassandra 和 MongoDB 上进行一些测试。我必须将很多表移动到 NoSQL 数据库,这个想法是让这两个平台之间的数据同步。
因此,我创建了一个简单的过程,将选择写入 Oracle DB 并插入到 mongo 中。我的一些同事指出,也许有一种更简单(也更专业)的方法可以做到这一点。
以前有人遇到过这个问题吗?你怎么解决它?
At work we are thinking to move from Oracle to a NoSQL database, so I have to make some test on Cassandra and MongoDB. I have to move a lot of tables to the NoSQL database the idea is to have the data synchronized between this two platforms.
So I create a simple procedure that make selects into the Oracle DB and insert into mongo. Some of my colleagues point that maybe there is an easier(and more professional) way to do it.
Anybody had this problem before? how do you solve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您的目标是将现有结构从 Oracle 复制到 NoSQL 数据库,那么您可能应该首先重新考虑您的举动。如果这样做,您就会失去使用非关系数据存储所带来的任何好处。
好的第一步是仔细研究现有的结构,并确定如何对其进行修改以对您的应用程序产生积极影响。此外,同时考虑混合系统。 Cassandra 在很多方面都非常有用,但如果您需要一个关系系统并且已经在使用大量 Oracle 功能,那么将大部分数据库保留在 Oracle 中可能是有意义的,同时移动需要频繁写入的部分受益于与 Mongo 或 Cassandra 不同的结构。
一旦您做出了有关结构的决定,我建议您编写脚本/程序/向现有应用程序添加一个模块,以将新格式的数据写入新的数据存储。这将使您能够对流程中的每个步骤进行最细粒度的控制,这在大型系统范围的架构更改中是我希望拥有的。
If your goal is to copy your existing structure from Oracle to a NoSQL database then you should probably reconsider your move in the first place. By doing that you are losing any of the benefits one sees from going to a non-relational data store.
A good first step would be to take a long look at your existing structure and determine how it can be modified to affect positive impact on your application. Additionally, consider a hybrid system at the same time. Cassandra is great for a lot of things, but if you need a relational system and already are using a lot of Oracle functionality, it likely makes sense for most of your database to stay in Oracle, while moving the pieces that require frequent writes and would benefit from a different structure to Mongo or Cassandra.
Once you've made the decisions about your structure, I would suggest writing scripts/programs/add a module to your existing app, to write the data in the new format to the new data store. That will give you the most fine-grained control over every step in the process, which in a large system-wide architectural change, I would want to have.
您还可以考虑使用 Hadoop 生态系统的组件来执行此类 (ETL) 任务。为此,您需要根据要求对 Cassandra DB 进行建模。
步骤可能是将 Oracle 表数据迁移到 HDFS(最好使用 SQOOP),然后编写 Map-Reduce 作业来转换此数据并插入到 Cassandra 数据模型中。
You can also consider using components of Hadoop ecosystem to perform this kind of (ETL) task .For that you need to model your Cassandra DB as per the requirements.
Steps could be to migrate your oracle table data to HDFS (using SQOOP preferably) and then writing Map-Reduce job to transform this data and insert into Cassandra Data Model .