Engine Yard Blog RSS Feed

Why Your App Won’t Work In The Cloud

There are two kinds of apps for the cloud: ones that work and ones that don’t. The ones that work are called Twelve Factor apps, and they work because they were written specifically for the cloud. We call the ones that don’t work legacy apps. And these are designed to run on traditional VPS hosts.

Unfortunately, most popular apps are legacy apps. They weren’t written with the cloud in mind, so they generally won’t work without modification. Legacy apps include offerings such as WordPress, Magento, and Drupal. They might also include any in-house apps you are thinking about moving to the cloud.

So what’s to be done about this? Is there any way to run legacy apps in the cloud?


Some approach this problem by deploying the legacy app to a single server, and then scaling that up to meet demand. But this is no different from traditional VPS hosting! And you’re going to get a nasty shock when Amazon retires (read: shuts off) your host...

A better solution is to make changes to the app itself, so that it’s compatible with the cloud. Being compatible means that it can be distributed across a cluster. This way, you can scale out by adding more servers. When servers get sick, you can replace them with new ones.

If you start making significant changes to an off-the-shelf legacy app, however, then you are essentially forking that code base. Not only will this require dedicated developer time, but you’ll have to continually merge in upstream changes. You’d think there’d be a better approach.

Fortunately, there is!

April 18, 2014: This Week at Engine Yard

ChefConf 2014: truly delightful! Big congratulations to Nathen Harvey on another amazing conference. Check out the videos here (or watch Nathen running around a farm and making friends with a devops minded cow)!

--Tasha Drew, Product Manager

Engineering Updates

This week there were a couple updates to our main Gentoo stacks: alternate MTAs are now fully supported, and there are improvements to the behavior of Ruby on Sinatra applications using ActiveRecord and Unicorn.

Our Ubuntu team has taken its first pass at updating to 14.04 LTS, and plans to release this work for the Java environments soon!

All our updates are chronicled in our regular release notes!

Social Calendar (Come say hi!)

RailsConf, April 22-25, Chicago, Illinois: RailsConf, the largest gathering of Ruby and Rails developers in the world, will be held in Chicago. Join us and connect with top Rails talent, companies, and project owners from around the world. Stop by our booth to chat with our support engineers, deployment engineers, and product manager to ask questions and talk shop! We will also be doing a presentation on the future of Engine Yard on Wednesday at 2:10pm in Michigan AB, led by deployment engineer extraordinaire Edward Chiu.

Abril Pro Ruby, April 24-27, Porto de Galinhas, Brazil: April Pro Ruby is hosting some of the best Rubyists in business at this tropical conference in Porto de Galinhas beach, a paradise in the northeast of Brazil. Be sure to meet our own Daniela Valfre there!

Articles of Interest

Check out Seth Vargo’s release of Chef Sugar, a Gem and Chef Recipe that aims to make a cleaner, more lean reciped DSL, enforce DRY principles, and make writing Chef recipes an awesome experience!

The US Navy announces it has developed a way to make fuel from seawater.

Is My CDN Working? Announcing Fastly on Engine Yard

Fastly on Engine Yard

CDN integration is a request we've been hearing from our customers at Engine Yard for a long time now. So we are proud to announce the immediately availability of Fastly as an Engine Yard Add-on.

Fastly is built using the open-source Varnish Cache running in a network of data centers around the world. While supporting a number of advanced options for caching and cache-invalidation, Fastly is also super easy to setup as a basic asset cache.

This post will talk about setting up Fastly on Engine Yard and how to use Fastly Surrogate-Keys for purging individual objects from the cache. You may also be interested in the announcement from Fastly: Ruby on Rails on Fastly.

Setting up Fastly

The simplest, most bare-bones way to use a CDN is to just use it as an asset host. This means things like your javascript, css, and image files can be served by the CDN, leaving more resources available for your Engine Yard web stack to serve requests that run your app-specific code.

The example TODO application is a basic app using Rails 3, and so makes a good candidate for a simple Fastly integration.

April 11, 2014: This Week at Engine Yard

Gearing up for ChefConf and learning what all our DevOps friends have been up to next week, hope to see you there!

--Tasha Drew, Product Manager

Engineering Updates

Computers can be weird sometimes, and there are few people who appreciate the depth of that weirdness more than we do. Sometimes, for example, your application cluster may get into a pattern where application masters are being taken over repeatedly, and you really want to know why. To help expose that extra level of debugging, we have released an optional feature into GA: application master takeover preference.

App Master Takeover

If your application master keeps going on vacation without leaving a note saying why, this is the feature for you. When a takeover occurs, the old application master will be saved as a utility instance that is not serving any traffic, so you can SSH into the box and investigate what is up with its shoddy work ethic. As always, if you need extra help, you can always open a ticket with our support team too!

Utility Instances

This feature is intended only for that extra level of debugging, and is not recommended as a default configuration.

A bunch of other updates are chronicled in our regular release notes!

Social Calendar (Come say hi!)

ScaleConf, April 10-11, Cape Town, South Africa: a two day conference that focuses on the problems faced in building and running services on the internet today. Platform engineering legend Shai Rosenfeld will be presenting on concurrency and scaling!

ChefConf, April 15-17, San Francisco, California: Learn and share best practices for whipping up awesome in workshops, presentations and training with our favorite people in the world—the Chef Community. Ryan Souza, platform engineer extraordinaire, will be speaking, having made the long trek from the northern wilds of Portland, Oregon. Keep an eye out for his evil twin, the Fake Ryan Souza, he may make an appearance as well.

Articles of Interest

A brilliantly simple explanation of the Heartbleed bug by the excellent xkcd.

How To Dissect a Clojure Web Application and Deploy on Engine Yard

In this post, I’m going to build a simple Clojure Web app and deploy it to a Jetty application server running on Engine Yard’s cloud application management platform. In a follow-up post, I expand my Web app and show how to integrate it with a MySQL database server running in the Engine Yard environment.

To build my web app, I’m going to use the most common tools in the Clojure web stack:

  • Ring, a thin abstraction on top of HTTP request and response handling, and
  • Compojure, a small routing library for working with Ring.

Ring and Compojure are built on and interoperate with, the Java HTTP Servlet (API), so applications built with them can be deployed on any servlet container, such as Jetty or Tomcat.

In you already have a Clojure application, to deploy with Engine Yard, please jump to the packaging section.

If you are new to Clojure Web application development, read on.

What is Clojure?

The description at Clojure.org captures the essence of Clojure as a dynamic, functional language with a solid runtime foundation on the Java Virtual Machine:

Clojure is a dynamic programming language that targets the Java Virtual Machine (and the CLR, and JavaScript). It is designed to be a general-purpose language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming. Clojure is a compiled language - it compiles directly to JVM bytecode, yet remains completely dynamic. Every feature supported by Clojure is supported at runtime. Clojure provides easy access to the Java frameworks, with optional type hints and type inference, to ensure that calls to Java can avoid reflection.

Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system. Clojure is predominantly a functional programming language, and features a rich set of immutable, persistent data structures. When mutable state is needed, Clojure offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded designs.

What is Engine Yard?