Hartley Brody

Dependencies: Why Building Modern Applications is Like Using Magic

faviconI launched another small app yesterday called Rooster, an SMS service that messages you the forecast every morning.

It only took a few days to build and polish. But while the interface is remarkably simple, there’s a lot going on behind the scenes:

  • User-provided location strings have to be converted to latitude & longitude pairs.
  • Weather reports from dozens of agencies have to be aggregated and their raw data has to be converted into human-readable forecasts.
  • Text message have to be delivered reliably through various carriers to phone numbers all over the world (so far including China, Australia, Germany, Canada and Algeria).
  • Timing information has to be reliably stored across various timezones around the world, so that messages are sent at the correct time, in the local user's timezone.

And those are just the specifics for the this particular app. As with any application that’s available over a network, I also had to ensure that the following conditions were met.

  • Web requests to the application's URL must resolve to the proper server where the application is hosted.
  • The application must be "always-on," hosted in a reliable environment that's resilient to hardware failure and other common networking issues.
  • Incoming requests must be dispatched to the correct view function, so the application can decide what to send back to the user.
  • User's data must be persisted quickly and securely for later retrieval.
  • If the user is browsing the website, the application should send back a beautiful HTML page that displays reliably and consistently across browsers and devices.
  • If the application encounters an exception, that information should be captured and delivered to a developer for debugging.
  • If the website ever goes offline, a developer should be alerted immediately so that they can bring the site back up with minimal downtime.
  • As users discover and visit the website, that information should be captured and stored in order to provide analytics to the application's creator.

Rooster has all of those features, but amazingly, I didn’t have to build a single one of them. My code simply acts as the glue between many other remarkably powerful services.

Even beneath the levels that most application developers see, there are programming languages, operating systems and network protocols that turn our programs into instructions that computer hardware understands.

Any sufficiently advanced technology is indistinguishable from magic.
Arthur C Clark

The best developers write only the code that’s necessary. They know when to stop building their own systems and instead, turn to the tools that are already available to them. It’s considered best practice to not reinvent the wheel. Our bag of tricks is mostly filled with the work of others.

Modern day application developers stand on the shoulders of giants. Our work would not be nearly as fast, easy or enjoyable without the dozens of other projects and services our applications rely upon.

A somewhat complete list of Rooster’s dependencies:

Google Geocoding API, Forecast.io API, Twilio API, Cloudflare, Heroku (which, in turn, relies in AWS), Flask, Python, Requests, Gunicorn, SQLAlchemy, Postgres, Bootstrap, Sentry, Pingdom, Google Analytics, Ubuntu, TCP/IP, DNS, SMS, HTTP, Git, GitHub