How to hybrid Mysql and MongoDB in Play framework?

Should I choose MongoDB or MySQL for a Play Framework based web application?

  • I plan to implement a web application based on the http://www.playframework.com/. My decision to choose Play is based on my background in Java, the way Play approaches the development process of web applications and its claim to be http://www.reactivemanifesto.org/. The rough feature scope of the web application is a pretty common use case and can be compared with Q&A community sites like stackoverflow or Quora comprising user profiles, questions, answers, comments, tags, flags and the like. Moreover it should be possible to store pictures and videos with questions and answers (which will be stored on something like Amazon S3). The web application will expose its services through a REST/JSON interface which will be accessed by native mobile apps as well as (mobile) websites. I plan to deploy the service on a PaaS provider (like Cloudbees or Heroku) with the aim to benefit from their elastic scale-ability. On the Play Framework website the following statement can be found: Though Play does come with support for relational databases out of the box, there is nothing stopping you from using the Play framework with a NoSQL database. In fact, this is a very common way to implement models in Play framework. As it seems to be common to use NoSQL databases with Play, I wonder which benefits can be generated by choosing MongoDB over MySQL? Especially considering the qualities of a "reactive" application design which is based on scale-ability, resilience and responsiveness. On the other hand, though, what drawbacks do I have to deal with when choosing one over the other in terms of support, maturity, community, and administration considering the deployment on a PaaS provider? For which database would you opt?

  • Answer:

    Speaking from my own experience and looking at the same issue in the last 6 months I would suggest going MySQL route. In my own evaluation I was tempted by the ease of use offered by MongoDB but in the end the twin factors of massive amounts of information and resources and matured technology made me pick MySQL. It's a proven tried and tested technology. There massive amounts of docs for it. It is robust and supported almost on every PaaS out there. Finding developers for it is far easier. It felt like the safe right choice. Because honestly moving entire data structures form one solution to another months down the line is a nightmare you do not want.

Farhad Agzamov at Quora Visit the source

Was this solution helpful to you?

Other answers

I think it depends solely on your data structure. You're comparing here a relational database with a non-relational database. If your data structure fits into a relational database, don't push in into MongoDb and vice versa. Consider in which direction your application might evolve. Will the chosen database still be sufficient?

Waldemar Erhardt

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.