Designing your SaaS web-app for global scale on AWS (Amazon Web Services)
Designing your SaaS web-app for
On the Cloud
Software as a Service offers irresistible benefits for organizations of all sizes —
from cost savings to scalability to mobile accessibility.
What is Saas?
As a term, 'Software as a Service'
has been in common usage for
nearly a decade.
And before SaaS, users generally
rented software via an 'Application
Service Provider' or ASP.
For businesses, there are many potential benefits to be had from adopting your
Cost savings - Moving from the capital-heavy expense of installing, maintaining and upgrading on-
premises IT infrastructure to the operational cost of a SaaS subscription is a tempting business
proposition (particularly in the short-to-medium term!)
Scalability - As your business grows and you need to add more users, rather than investing in
additional in-house server capacity and software licences you can adjust your monthly SaaS
subscription as required.
Accessibility - A browser and an internet connection is all that's usually required to access a SaaS
application, which can therefore be made available on a wide range of desktop and mobile devices.
Upgradeability - AWS deals with hardware and software updates (If running Amazon Linux), removing
a significant workload from your in-house IT department (whose extra human bandwidth can, be
released for different tasks, such as integration with existing on-premise applications).
Resilience - Because your application’s infrastructure & data, resides on AWS, if some form of disaster
should strike your client’s business premises, you can get back up and running relatively easily from
any location with internet-connected computers.
Why should you be building SaaS?
Who’s running their SaaS on AWS?
One third of all internet users now visit an Amazon Web Services
cloud hosted site/saas daily!!!
You want to scale as big as Twitter?
Start using the the AWS API’s with the AWS SDK. Be adventurous and use
DynamoDB, ElastiCache (Now with redis support!), SQS, and EMR!
So where do we start?
In under 20 lines of code you can create a simple API to read from
Dynamo, this example will return JSON to the browser, Dynamo will
handle the throughput / scalability!
Dynamo’s secondary indexes now means you can get items other than the
primary key without needing to query an index service (such as elasticsearch)
Dynamo now with Secondary Indexes
DynamoDB only stores a limited amount of data.
If you need to store large amounts of data Utilise S3 and Dynamo combined.
Architect your api for scale
Let your front-end application query
your API and fetch Results from
Dynamo & S3 … It’s good to let the
browser do the work as this will use
less load on your servers :)
Use Route53’s Geographic DNS! - You can Auto-Scale your instances in each
region, and let Route53 determine which endpoint to send traffic to depending
on where your users are located geographically… (Route53 now supports
Health Checks also!!)
Geographic DNS Rocks!
Intaro Pinboard (Pinba - Board)
Is a fantastic OSS tool that you can
spin up on an EC2 Instance to
monitor your application’s Health &
It’s a fantastic, FREE, Open Source
Alternative to NewRelic!
Use OSS & CloudWatch!
Socket.io does not work out of the box even with a TCP ELB because it makes
two HTTP requests before upgrading the connection to websockets.
In-memory stateful data is the enemy of load-balancing. Thankfully, socket.io
supports using Redis to store the data instead. If you share your redis
connection with multiple servers, they essentially share the sessions of all
Using Websockets and ELB?
See the socket.io wiki page for details on setting up Redis:
Questions, Beer & Thank You!
Designing your SaaS
web-app for global scale