Volver al blog

Síguenos y suscríbete

Sólo disponible en inglés

Por el momento, esta página solo está disponible en inglés. Lamentamos las molestias. Vuelva a visitar esta página más tarde.

How Fastly’s Heroku add-on helps improve experiences

Anna MacLachlan

Content Marketing Manager, Fastly

We will be joining Heroku’s developer ecosystem at Dreamforce 2015 on September 15-18 in San Francisco. A recurring theme is “real time,” and we couldn’t be more excited to share the details of our partnership with attendees.

Fastly will be presenting alongside MongoLab, Treasure Data, New Relic, SolarWinds Cloud, and SendGrid. This group represents a well-balanced mix of essentials for Heroku developers: two data stores, two monitoring solutions, transactional email, and caching. To hear about our partnership in action, check out EA and Nurun’s breakout session on September 17, 2015 from 1:00-1:40pm and hear about how they used Heroku and Fastly to handle over 350,000 fans during E3 2015.

Ahead of the event, I sat down with Fastly engineer Michael May and Peter Cho, Head of Heroku’s Ecosystem Program. In the following Q&A, they discuss the partnership and business benefits of Fastly’s Heroku add-on, and explain why it’s important for enterprises to focus on both developer and customer experiences.

Why was Heroku interested in partnering with Fastly?

Peter Cho (PC): Companies are coming to the realization that speed matters, and how fast your page loads directly relates to conversions. If we were sitting in front of a room of developers and we asked how many of them have fielded a request to "Make the page load faster," every hand would go up. Improve page-load performance and watch conversions rise? It's a no-brainer, until you have to implement it.

Michael May (MM): Before I founded the CDN Sumo Heroku add-on (later acquired by Fastly), I used Heroku extensively and knew it was the fastest way to get an app up and running. However, I would often need a CDN to achieve optimal performance and there was nothing that made that process fast or easy. I got tired of going back and forth with my CDN provider — switching to their config versus Heroku’s config required context shifts that were time consuming. With Fastly, the goal is to make the configuration super easy. Boom, you can have a CDN, ready to go — and you know everything’s going to be super fast.

PC: That’s an interesting point about context shifts. For developers, there’s a lot of cognitive overhead when you have to context shift, so streamlining that process lets you focus on what matters: the application and the end-user experience.

MM: Not to mention, there’s often a lot of learning required to set up a new CDN. Inevitably, you have to know something about how CDNs work and how they’re configured to achieve maximum performance, and that’s not always easy. With Heroku and Fastly, you don’t necessarily need prior education about CDNs. All you need to know is that you want to make your app faster, and both companies can help you do that.

How does the Fastly Heroku add-on work?

MM: The add-on is a streamlined Fastly experience, where one click (or one CLI command) provisions and configures a Fastly CDN that works with your Heroku app. After it’s set up, it usually takes only a few lines of configuration changes in your code to start serving content out of the CDN edge. For example, with Rails, you can just update your asset host in the production environment config. Then, by taking advantage of Fastly’s Instant Purge and surrogate keys, you can cache more while maintaining the flexibility to remove outdated content instantly.

PC: Heroku dynos can endure a lot, but the more you offload to services like Fastly the happier they are and the better they’ll perform. With mobile on the rise, caching is not optional anymore. Ten years ago, tools like CDNs were reserved for large teams, with large budgets, and specialized knowledge. Today, you can type ‘heroku addons:create fastly:rampage’ to add a CDN with 80 terabytes of bandwidth capable of handling 800 million requests and it’s available in an instant.

What are the business benefits of using Heroku and Fastly?

PC: There is value for both the customer and developer experience. Heroku provides productivity for developers. Fastly is a natural extension of that — it makes something that’s normally difficult really easy. Using both services, you can create fast, compelling experiences. Slow load times don’t directly affect developers; it’s all about what your users experience when they land on your page.

MM: Right, the tools we’re talking about are for developer productivity, but it’s the end-users that benefit the most. Reducing request response time not only makes customers happier (since they’re not left staring at a blank or partially loaded page), but it also keeps their attention, which increases conversion rates.

PC: Not only that, developers no longer have to trawl endlessly through Google searches and Stack Overflow posts to figure out how to scale their applications. They can scale their dynos with a few CLI commands, with tools that are already being used at scale by traditional companies like Macy’s and startups like IFTTT. Developers can spend less time on ops and more time on the customer experience.

Any best practices for using Heroku and Fastly together?

PC: Understand how your users interact with your application, and load-test accordingly.  It's gratifying to see just how much traffic an application can handle before falling over, but many an outage has occurred below the established threshold, because as it turns out, users rarely do what we expect them to.

MM: You also need to be aware of what you’re caching and what your cache strategies are (including being explicit about setting max-age or no cache for cache-control headers). I wrote a two-part series on Accelerating Rails that covers most of my best practices. Although Rails-specific, there are some good generalized takeaways.

PC: Though it might be tempting to do the basic setup for Heroku and Fastly and forget about it, I would recommend digging into the documentation. The one-click integration will get you up-and-running quickly, but you don’t want to miss out on great features like Instant Purge.

MM: Absolutely. The out-of-the-box Fastly configuration is meant to get you started so that you can immediately begin delivering your app’s static assets over Fastly’s network. To go further, the next step is to create a custom domain and update your DNS settings so that it points to Fastly. Doing this can yield large performance gains, since requests will now be routed through our optimized network.

Any thoughts on the future of building and running applications in the cloud?

PC: All things related to the developer experience are headed to the enterprise. Enterprise developers are no longer content using dated tools, and have started adopting modern developer tools like Heroku and Fastly, to allow them to innovate as quickly as startups can.

Companies are also starting to realize that a lot of developer productivity is being lost focusing on creating and maintaining hardware and software infrastructure. They’re getting more comfortable delegating that expertise to companies that are experts in those respective domains.

Enterprise companies shouldn’t have to worry about hiring caching experts or infrastructure specialists, they should be focused on building great applications to serve their customers. The most successful companies will be the ones that invest in better developer tools, because those tools will allow developers to focus on improving the customer experience.