grails - ease of scaling mongodb vs mysql -


i creating grails application backend mobile application. deployed on amazon ec2. persists data mysql database. 1 instance pointing database. plan deploy multiple instances of app behind load balancer , have read requests go slave instances of db. plan release in coming months , have beta group of couple of thousand users. more read intensive write.

we have looked using mongodb instead of sql , see solution.

not having lot of experience scaling mysql ( or mongodb ) easier scale mongodb since has features such auto sharding. ( looking thoughts people have done both ) of thinking easier switch mongodb rather in 'production' , having migrate.

thoughts?

mongodb has 2 versions of "scaling":

  1. read scaling via replica sets.
  2. write scaling via sharding.

they're not silver bullets, they're both easy set up. replica sets have auto-failover practically essential when using ec2 (they have history of randomly failing nodes). when need write scaling, mongodb has documented processes upgrading replica set series of sharded replica sets.

the unfortunate limitation (last checked), things scalr don't support automatic scaling. you'll have roll own solution adding , removing nodes set.

some important considerations:

  1. disk io performance sketchy in cloud. performance amount of ram can throw @ problem.
  2. if you're using replica sets reads, ensure driver / data wrapper capable of handling distribution of reads. mysql it's not "free", you'll need decide "write vs. read".
  3. 64-bit machines. mongodb wants operate on 64-bit hardware. cost consdieration you'll have ramp 4gb machines instead of 2gb machines (i don't think big limitation, know it's startup).
  4. mongodb still new tech. lists active, , people using in production large data sets. still new product, have prepared work command-line , parse through docs , ask questions.

would easier scale mongodb

at level scaling going "hard" problem. mongodb provide way scale out lots of boxes horizontally replication. in experience, mysql tops out @ around 2 boxes writes. can configure co-masters, after have start mucking around kinds of partitioning , lose ability joins.

i of thinking easier switch mongodb rather in 'production'

it will.

thoughts?

start small. 1 piece working , see if how works. if have access ec2 account, it's easy spin couple of machines , play. mongodb not panacea, works lot of modern web problems. measure how badly need joins :)


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -