January 3, 2017

Managing Explosive Growth with Apollo Optics — A Case Study

Rohit Bakhshi

Rohit Bakhshi

Defining the Problem

NewSpring Church is a Southern Baptist megachurch headquartered in Anderson, South Carolina. In addition to its main location, which receives an average of 32,000 visitors per week, NewSpring has more than a dozen locations in cities and towns throughout the state.

NewSpring is one of the fastest-growing churches in the country. The church’s development team has had to build and maintain a variety of websites and applications for the various locations in order to adequately serve employees and congregants. The church also operates several institutions, including a leadership college and a youth ministry, each with its own technical needs.

Due to the massive increases in growth and attendance year after year, NewSpring’s technical team has cobbled together a number of internal and third-party solutions in order to keep everything running. “I came into an organization that had grown very fast, and needed very quickly to sign up for a number of different services to be able to sustain itself,” said James Baxley, NewSpring’s director of web systems development. “It was a very distributed data system, with a lot of stuff in the wrong place and not really in sync.” The team wanted to unify the various solutions put into place so that users could have one central hub of activity without signing into a dozen different portals.

Migrating to GraphQL

With this objective in mind, Baxley and the NewSpring team began to seriously look into adding GraphQL into its technical stack. The team already relied on ExpressionEngine, a PHP and MySQL content management system, as well as third-party church management software and a number of REST endpoints. Because the stack was so large, any new solution needed to play nicely with these existing technologies.

When deciding whether to use GraphQL, the development team had three main concerns:

  • First, GraphQL was a very new technology; the specifications had only been officially been announced five or six months previously. The team needed reassurance that GraphQL would have support for the foreseeable future and wasn’t just a flash in the pan.
  • Second, even a delay of 100 milliseconds is enough to push users away from a website, so speed would be a paramount concern.
  • Third, NewSpring keeps track of a large amount of sensitive data, including financial information and personal conversations. Protecting user data was a critical need for the new system.

“Whatever choice we made in how to handle our data had to provide the security and reliability to keep the lights on and set us up for future success,” said Baxley. “GraphQL is that choice.”

Insight With Apollo Optics

To supplement the adoption of GraphQL, NewSpring used Apollo Optics to provide system analytics. Optics let the NewSpring team target queries that were unnecessarily slow or causing problems with caching, allowing them to make numerous improvements and optimizations. Optics makes it simple for the team to find any significant spike in response time, offering a closer look in order to identify where the issue is coming from and determine how much of the problem is due to the application’s caching mechanisms.

Apollo Optics Trace View

By using Apollo Optics to sort by the length of time taken for a query, the NewSpring team can easily identify the weak spots in their application. For example, the development team noticed that looking up a person was one of the most time-consuming tasks because the application needed to move from a user account to a record for a person, which could potentially involve merge operations in SQL. Initially, developers assumed that one person would only have one user account and only require a simple check, but this proved not to be the case in production. Optics allowed NewSpring to troubleshoot the issue and tag this pain point for optimization.

“Optics was the fastest way for us to take GraphQL projects from prototype to production” — James Baxley

The operations team also uses Optics to analyze queries during major events, such as Sunday or holiday services. The application lets them view the different usage patterns in the form of GraphQL queries to give them an idea of how successful their efforts have been. By helping to identify inefficiencies, points of overuse and potential areas of improvement, Optics has become a key part of the NewSpring team’s daily toolbox. “Optics was the fastest way for us to take GraphQL projects from prototype to production,” said Baxley.

Looking to the Future

After working with GraphQL and Optics, the NewSpring team is excited about the chance to use what they’ve built and help other churches unify around a common schema. In addition, the team wants to implement some key system features that have been sorely missing so far.

First, Apollo is able to support subscriptions as they are implemented in GraphQL. The NewSpring team is hoping to use the subscriptions feature to build a chat platform using GraphQL, giving end users more functionality and putting a cutting-edge technology into production.

Second, NewSpring’s GraphQL server is currently written in JavaScript, but the team has developed an application in conjunction with other churches written in C#. Moving forward, one of the biggest tasks will be to transition the NewSpring GraphQL server to C#, so that they can promote GraphQL amongst the church tech community.

If you liked this case study, please show your love with the ❤ below! Have a story to share? Let us know in the comments below!

Have a GraphQL project you’d like to instrument? Try Apollo Optics for free » No credit card required.

Written by

Rohit Bakhshi

Rohit Bakhshi

Read more by Rohit Bakhshi