Earlier this year, one of our clients (I'll call them ACME Industries) approached us with the following problem:
After a short conversation with the client, the following requirements were identified.
As conveyed by ACME and summarized by me:
- User population
- Contacted 10,000 at a time
- Single sign-on (SSO) from their intranet is required
- SSO will send along personal and shipping information
- Cannot sign on again after placing their order
- Look and feel
- ACME's client will provide a design specification
- Application flow
- Select a shirt size
- Confirm their selection or return to (a)
- Persist the order information to the database
- Data export
- Export the collected order information to some convenient format
- The application needs to be live for an initial 2-3 week period. Any needs for the application beyond that are currently undefined.
Proposed technology stack
To address the stated requirements, we proposed the following technology stack:
Heroku is “infrastructure as a service.” It handles the tasks of deploying, building, managing and scaling your application, allowing you to focus on the functionality of your application. I have blogged more extensively about Heroku here.
Postgres is a high-performance, open-source relational database. It competes with MySQL as the most popular open-source relational database. Of the two, Postgres is considered the more fully featured option.
Express.js is a minimal application framework that sits on top of Node.js and helps automate the most common tasks.
AWS S3 is short for “Amazon Simple Storage Service”. It provides simple, fast and efficient storage and is ideally suited for static assets like images.
Bootstrap is a framework for building web-based user interfaces that automatically adapt to the screen size, whether the browser is running on a desktop, tablet or mobile device.
We proposed that any email communication to the users (e.g. an order confirmation) would come from outside this application. For example, an administrator might download all orders for a given day using the data export feature, then import the list into MailChimp in order to send an order confirmation.
The beauty of Heroku is that it can scale your application on an as-needed basis. The downside to this convenience is that pricing becomes a bit nebulous. That said, the base prices are these:
- Postgres - $50/month (learn more)
- Application instances (a.k.a. “dynos”) - $25/month/instance (learn more)
If your application is getting modest volume and a single instance can keep up, then it will cost you $75/month total ($50 + $25 * 1).
If your application needs two instances to keep up at all times, then it will cost you $100/month ($50 + $25 * 2).
If your application normally needs two instances to keep up with usual traffic but you spike up to 10 instances for a single 12-hour period during the month, then it will cost you $103.23 for that month ($50 + $25 * 2 + $25 * 8 * 12 / 744 ), where 744 is the number of hours in a 31-day month.
Sadly, this project never came to fruition. The original requirement for 260,000 total users, 10,000 of them concurrent, was scaled back significantly (15,000 total users, 500 of them concurrent) so that one of ACME's existing, lower-throughput solutions could be used.
Of course, the problem statement is generic enough that we expect to be able to use our proposed solution in the future. Time will tell!