This question is quite hypothetical but I’ll ask anyway. Let’s say you start a project with Play and you use a mysql database. Later on you decide you want to move your application to something like Google App Engine or Amazon EC2. Or maybe even switch to a NoSQL database like MongoDB or Cassandra.
Are there any tools for this? Or would you basically need to rewrite your models? Especially since mysql is a relational database and has nothing to do with something like Monogo, I’m guessing it’s quite hard?
I’m asking because, when you start a project, obviously, you might be hoping to scale your application at one point, and maybe you’ll need something like Mongo, but you never know how things turn out. MySQL could end up being more than enough for your needs for a long time. So why go to the trouble of learning to work with Mongo, when you’d be much more productive with MySQL and you could switch later, if necessary?
I’m asking more specifically in combination with using the Play! framework.
What are your thoughts?
we had the experience on this the other way around (from GAE to DB). I would not recommend switching. Ever. For many reasons:
Siena, although it’s a very cool idea, it has a big problem: it’s trying to merge two completely different worlds. The way GAE works is very different than a Relational DB. This means that to work in both worlds the library has to do some assumptions and hide some functionality. Ever heard of leaky abstractions? Yes, Siena as an idea is really cool, but no, it’s not what you want for a medium-big project.
The aim of a NoSQL and a Relational DB are very different. There are usage cases for each one, and places where you will want the SQL approach while in other areas a NoSQL approach will be better. Trying to do everything with one or the other it may be the wrong approach/design
By using NoSQL just in case you may be starting the root of all evil. Let’s be honest: banks have used SQL machines for very heavy transactional loads for ages and they had no problems. And i’m not adding Memcache to the equation. Nor SQL optimization, nor code profiling.
If your website will get to that level of traffic, great for you! But most likely then you will be getting money to scale the database as required (or your web will go bankrupt before). If it gets to the point where you need to scale a whole lot more, then you can always add a MongoDb/Cassandra/etc layer to store the information you may want to store there (relation graphs and other stuff like that). But until then you won’t need it, and now a days you may be having your full db in RAM. Don’t worry about scalability, it will be quick 🙂