Migrate mongodb to mysql? [closed] - mysql

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
as google isn't really helpful here:
what's the best way of migrating a mongodb database to a mysql database? any best practise examples?
thanks!

After you have completed scarpacci's exercise and have an idea of the mappings, I would then look at mongoexport - you should be careful about type fidelity though and then you will have to import the CSV/TSV into MySQL in a sane manner also.
The other option, especially if you run into typing issues, is to simply pull all of your data out programmatically using your language and driver of choice and insert it directly into MySQL, again using your favorite driver - this gives the most control, but is also the most work.

This might be a bit of a non-starter, because people usually implement things in Mongo or other NoSQL databases in order to have a schemaless design. That is diametrically opposed to the concept of a relational database.
Without looking at the sort of data structures you have in Mongo, this would be impossible to answer.

#Tronic I would start by utilizing the mappings MongoDB provides on their site:
Mapping Guide
I would then try and take your documents in each of your collections and try to break those out into the proper DB Entities (Tables). The entities / attributes could be difficult to design based on the schemaless design of Mongo (As #Mike Brant indicates)
Hope this helps.
--S

Related

Is Mongo DB better than Mysql DB for notification storage and retrieval? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I had a mobile app backend written by someone else in node(express). He is managing all data in mysql DB but storing notification for new cutomer signup etc in mongodb is there a performance gain or I should use one d.b throughout the project?
MySQL is highly organized for its flexibility, high performance, reliable data protection, and ease of managing data. Proper data indexing can resolve your issue with performance, facilitate interaction and ensure robustness.
But if your data is not structured and complex to handle, or if predefining your schema is not coming easy for you, you should better opt for MongoDB. What’s more, if you're required to handle a large volume of data and store it as documents, MongoDB will help you a lot!
The result: One isn’t necessarily better than the other. MongoDB and MySQL both serve in different niches.
Reference
MongoDB is good for handling large unstructured data. The best thing about MongoDB is that it is not bound to schema design.
To store notification you can use MongoDB though notifications can be in billions or trillions in number. So, MongoDB could be the choice to store and retrieve that data. Data retrieve is faster in MongoDB if we compare MySql.
Checkout the link MongoDB v/s MySql

Is there a MongoDB to MySQL adapter [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have a Javascript library (SincIt) that I would like to use to synchronise my WebApp with a MySQL Database. However, this SincIt only works with MongoDB at the moment.
I could probably write an MySQL adapter for SincIt, since the library is modular, but I wonder if there is an adapter that translates MongoDB instructions to SQL.
MySQL is a relational database and uses SQL for manipulation of relational algebra. MongoDB is a document database that doesn't support relations or joins.
It does allow for hierarchical nesting of documents, but it's simply an entirely different paradigm.
The most important distinction in this case, is that MongoDB is schema-less. With a mongo collection you never need to do the equivalent of a "CREATE TABLE" statement. Furthermore, mongo has no problem with you starting with one document with a specific json structure, and then adding additional documents to that collection with entirely different structures.
As Mongo works with json data, you would also have the problem with a relational database of needing to convert table data to json documents and vice versa, which really isn't possible in any generic sense.
With MySQL you of course have to have table structures that are maintained in the data dictionary, and if anything changes you need to ALTER the table. You could probably implement a generic table structure of rows where the entire data store would be in a blob, stored in the same json format that Sinclt expects, but at that point you might as well just use mongo.
With that said, if there's some business rule that necessitates it, the fastest way to get it working with MySQL would probably be to do what I just suggested and have a generic row structure with something like:
id
optype (set, update, delete?)
data (blob storing the json payload)
parent_id
Just from a quick perusal of the SincIt docs it appears you'd need something to support the "linked list" aspect of the system.

Why is Mongodb prefered over MySql for NodeJs development? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Please read before you answer: I don't need any opinion-based answers or "nosql vs sql which is better" debates on the subject, just facts.
I want to slowly convert a php+mysql website I wrote with Symfony2 into a real time application using backbone with nodeJs + websockets.
I want to make a slow transition by changing single features, since I don't want to break a fully functional site.
I have been educating myself about NodeJs by reading books and watching Tutorials and there is one thing I noticed, I own more than 5 nodeJs books and none of them use MySql although its fully supported by node.
They all use MongoDB.
Here is my situation
1. My Website is already integrated into MySql(Doctrine)
2. My MySQL setup is fully functional and needs no improvements so far
I'm really frustated and I have a few questions:
Why is MySql not prefered although its a more mature piece of technology?
What are the advantages of moving to MongoDB over MySQL for the purpose of having a real-time application??
I've seen people choose Node/Mongo development because of the simplicity of the all-JavaScript stack, I've seen people choose Mongo because it's the New Hotness, and I've seen people choose Mongo because it's actually the right tool for the job: they have a large amount of document-like, unstructured data and/or they want to take advantage of Mongo's support for horizontal scaling, among other differences between MySQL and Mongo.
I'm not sure it's possible to answer this question in a non-opinion-based manner and without touching on Sql vs NoSql. Mongo is simply a tool, and it happens to be free and commonly used in the field with Node. If I were writing a Node tutorial, I'd probably choose Mongo too, because it's common and it's cool.
If Mongo is the right tool for your site's use cases, then the transition is probably worth it. If MySQL is the right tool for your site, then congratulations! You've just saved a bunch of time rewriting your DB in Mongo.
As an aside- if your question uses the word "preferred", I can't really think of a way for it to not be opinion-based, by definition.

Which database engine is best for node.js apps? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am looking for a database engine which is the best for storing thousands of records. I first wanted to use MySQL, because I know it best, but I'd like to have strong answer.
I need predefined columns, database can be as small as 10 MB or as "big" as 10 GB of data and it would be cool if that engine is fast for reads (insertions may be a bit slower). I don't need fast-fulltext-search or regexp searching. To give you an example - selecting items via slug extracted from link.
I saw this site before but I still don't know what is best option for me.
So here is my question: Which database engine is best for uses like mine?
You should look at MEAN stack. Personally, I like MongoDB - I use an ORM tool like mongooseJS - It increases your development speed rapidly. The one thing i really like about having Node JS, Express body parser, mongodb and mongoose is I deal everything on the server side in one language - Javascript and I expose REST services which can be consumed on Web (typically Angular - the A in MEAN stack or backbone) based application.
database can be as small as 10 MB or as "big" as 10 GB of data
At that size, you could use virtually any database you want. Remember, 10 GBs of data is small enough to fit into memory on a modern server.
I need predefined columns...
Sounds like SQL. Take you pick: MySQL, PostgreSQL, SQLite... at that size it will barely matter, just use what you like.
The performance difference on a "few gigs" of data will be negligible.
Look at MongoDB.
And don't forget to look at TokuMX - it's very promising!

Start with MySQL and change to MongoDB in the future? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm new to node.js
I have plan to use database other than MySQL (lets say MongoDB), but I'm only familiar with MySQL.
Do you think better to use MySQL first and change to MongoDB in the future? or learn MongoDB quickly and use MongoDB from beginning?
If you know how to appropriately use MySQL, then use it.
If you want to learn about MongoDB (or any other thing), then find some time to play with it on toy systems, just as you did when learning MySQL (or any other thing).
If, after having reasonable experience with both things, you think MongoDB has a place in your system, then use it. Either replacing or complementing whatever you already have.
But don't do it just because it's the cool thing to do.
First of all, you have to wonder why you want to use a NoSQL database. Is it because it's easier to develop for your application ? More efficient ? Scales better ? because of the hype ?
Then, if you think MongoDB is a good choice, go ahead with it. Implementing a first solution in SQL, then switching, looks like a waste of time to me (you will have to change a lot of your design).