Personal thoughts and findings while playing around with Amazon remote database services.
- I compared LightSail managed database vs RDS vs Aurora.
TL;DR – they’re not worth it in terms of performance.
My idea was to play with remote databases and see how fast they were and how they might be used to deal with heavy websites with many queries. For the most part…they’re fast enough as a remote database service (assuming you’re in the same DC). But just not all that fast. Details below…
- I took a bloated client ecommerce site and cloned it to a Lightsail instance.
- Then fired up 3 different managed database services on AWS (Lightsail DB, RDS, and Aurora).
- Then benchmarked them all against each other, of course using the local DB as a baseline.
- I don’t remember but I believe the database instances were equal size or bigger than even the web server. (I think I put $5/month for web-server and then around $5-20/month for each database server.)
For the most part, remote databases just aren’t all that fast. Adding an extra proxy will definitely produce a noticeable increase in load time. So where are the gains and where are the tradeoffs/break-even point?
I feel like remote databases probably originated as a scaling solution to deal with the issue of database size rather than database performance. So managed database services work out well (producing performance gains) if you have a 500GB database that won’t fit on your server. But what if you’re just a 500MB database with inefficient queries? Remote databases won’t help you much there.
Or another way of putting it…driving 5 miles is way faster than walking 5 miles. But what if you only have to go 2 houses down the street? Walking is probably faster in that case. Even if you’re a super slow walker.
If you’ve got that many queries and really long complex ones, and millions of traffic…ok, you might start to see performance gains otherwise, it’s not worth the hassle for common folk.
Some things I noticed:
- Lightsail DB – kinda slow. It’s supposedly built on RDS but it feels slower than RDS, that’s for sure. It’s very easy to set up and cheap.
- RDS – faster and with tons of options. Can upsize or downsize. There’s performance monitoring, snapshots, metrics. Basically an airplane cockpit full of controls.
- Aurora – I didn’t notice any real difference over RDS. WordPress is probably way too simple to really maximize Aurora’s benefits.
Want to play with things yourself?
- Create Lightsail server – make sure you open all necessary ports in the server (ssh, etc).
- Create Lightsail managed DB – very easy and cheap but not such great performance…definitely slower than on local server. Enable for public accessibility if managing remotely (probably yes, because you’ll have to import DB with MySQL Workbench).
- Create RDS like mariaDB – open inbound port for all IP, enable for public accessibility.
- Create Aurora from RDS panel – same as above.
- Then compare all 3. Lightsail managed DB, RDS, and RDS Aurora.
- RDS is really technical.
- Oh yeah, don’t forget to make sure all your instances are in the same datacenter. Hahaha!
David Kersten
So what do you recommend if you have a Lightsail LAMP server with a website that needs to add a replicated failover for the database to ensure high availability/redundancy? Did you test a larger Lightsail or RDS instance, like with 4 or 8 cpu’s and 32+ gigs of ram vs a small Lightsail instance with a local database? Or did you just do the cheap ones?
I found the cheapest Aurora database is practically unusable for anything but a simple query and had to go to a much larger database for my data warehouse and my cost went up by 20x. My customer portal website has grown to become more critical to the company, so I need to add some failover/high availability and am looking at leveraging Aurora, but then I am paying for the bandwidth of each query and costs might spiral out of control. So I am also considering Lightsail High Availability Database to offload the critical data to something that has high availability and redundancy but is cheaper than Aurora. If they are both going to come at a performance hit though, I may need to find a different option.
Johnny
Hi David,
Remote databases are simply slower, period. I tested even a large expensive instance and was surprised how unhelpful it was. Speaking with other admins/dev-ops confirmed my same findings.
How much money will you lose if your site is down for 30 minutes? If not even $100, I wouldn’t bother with this.
I think if you really need HA, I would go the Jelastic elastic clustering route.
Yannick
Hello,
Could you give us some numbers so we can have an idea of what “slower” means, it is very subjective. Is it 5%, 10% ? From 4s page load to 6s?
Also it would be very useful to know what is the extra delay added by the network connection between the vps and remote db? Is it 100ms, 300ms ?
Thank you !
Johnny
Added latency isn’t much. But the speed decrease feels something like 20-50% slower (remote DB vs local DB). If you want to be scientific…test your application and see for yourself.
Yannick
Thanks for your reply, I will give it a try