As I'm new to CouchDB, I wanted to know different options for migrating from SQL Server DB to CouchDB. Please throw some light on this.
-
1One is a relational database that has been normalised to at a minimum third normal form and preferably further, the other is a document based datastore that is not relational and is not normalised. So there is not natural correspondence between elements in either that you could apply a generalised algorithm to to perform an export. You would need to map the schema of the Mysql to the document of couch and write an sql to export to text and then import to couch. I suspect from the question that you know little about relational and document based databases. You need to fill those gaps. – PurplePilot Apr 02 '12 at 15:09
-
I know some stuff in SQL Server. However, I don't know anything about CouchDB. – user1308190 Apr 02 '12 at 18:46
-
@user1308190 you should have a read about CouchDB before committing to migrating from one to the other - http://couchdb.apache.org/ – Chris Shain Apr 02 '12 at 18:51
-
May be a silly question as you may just have been told to do it from higher up but if you don't know anything about it why choose it? – PurplePilot Apr 03 '12 at 08:06
-
@PurplePilot..You are right. I have been told to work on this task. – user1308190 Apr 09 '12 at 14:45
4 Answers
The short answer is that there is no easy way to migrate from MySQL to CouchDB. This because the logic of MySQL or any relational database engine and a NoSQL engine are completely different. So while moving data per see is not difficult the idea is how your application and your data will work in a totally new environment. The first issue is that you will need to create views so you are need to know how your data is accessed in advance. This is not a big hurdle but you need to take this into account.
Without sufficient information about your application and your current MySQL data giving you a comprehensive reply is difficult . This said you can see a rough MySQL to CouchDB logic explanation for your queries etc at
http://guide.couchdb.org/draft/cookbook.html
These resources might also be useful
I am here looking for a simple solution to this question and unfortunately I think for most people there is not going to be one. However; it strikes me that for the most part we would not wish to make a complete transition from SQL to NoSQL.... for a start this would require re-writing entire programs and interfaces.
I suppose that in my case I am looking at this as part of a longer term development process. Thereby I expect that in the future all my data will be stored in NoSQL but that in the meantime the objective is just to liberate larger datasets.
So where you have SQL driven websites - leave them be, you will likely have to redevelop them over time anyway.
But where you are generating new content and especially integrating large new datasets - do so in a NoSQL.
I think that's what I'm going to so anyway.

- 83
SQL Server and CouchDB are extremely different technologies. There isn't a one-to-one migration path because neither SQL or Couch has all of the features of the other.

- 50,833
- 6
- 93
- 125
-
How about MySQL? If I have database in MySql would that be easy to migrate to CouchDB? – user1308190 Apr 02 '12 at 18:48
-
My answer would be the same for virtually any relational DB- MySQL, Oracle, Postgres, DB2, Access, you name it. – Chris Shain Apr 02 '12 at 18:50