How ActiveCampaign Transitioned From PHP to Python and Java
More than a year ago, ActiveCampaign’s tech team realized its programming language of choice — PHP — wasn’t cutting it. The processing language had served the marketing tech firm well to a point in forming the backbone of its web services, but its limitations were becoming too cumbersome to scale. It couldn’t handle modern web development techniques like database connection pooling, and the number of engineers who specialized in the language was dwindling, said Zach Bright, ActiveCampaign’s director of engineering.
With a goal to hire 10 engineers a month, winnowing the search down to PHP engineers would make that growth impossible.
“As we were talking about our hiring goals, we started looking at whether it would make sense to bring in a new language from the technology side as well as on the recruiting side,” Bright said. “And the long and short of it was, yes.”
After surveying the language landscape, ActiveCampaign landed on Python for its scripting language and Java for compiling. Though Chicago, where the company is based, is known for its Ruby engineers, Python appealed for its simplicity and reputation as one of the fastest-growing programming languages around. Java, meanwhile, was a language several engineers were familiar with, making it an easy choice to use going forward, Bright said.
“As we were talking about our hiring goals, we started looking at whether it would make sense to bring in a new language from the technology side as well as on the recruiting side.”
Still, it’s one thing to pick a new language, and quite another to start building services in it. Bright estimated that only a quarter of the company’s engineers had used Python extensively before.
Here’s how he worked with them to make the transition.
How to Teach Your Team a New Programming Language
- Picking a common language can make onboarding easier. Python’s simplicity and popularity made it easier for ActiveCampaign to adopt it.
- Provide a variety of training opportunities. Not everyone learns best through a training seminar; some prefer to do it alone using books or web seminars.
- Forming small programming groups can make it easier for engineers to pick up a new language. ActiveCampaign found groups of three or four engineers helped teams deploy services faster and work through challenges.
- Document the legacy codebase so that history isn’t lost. ActiveCampaign added an ability to look through old code to understand why decisions were made.
- Not everything needs to change to the new language at once.
Offer a variety of training options
If you know one programming language, odds are picking up the syntax of another, especially one as straightforward as Python, isn’t going to be challenging.
Still, figuring out how to integrate it into existing technology requires nuance and experience. To help engineers adjust, Bright said ActiveCampaign rolled out three different onsite training courses to learn the language, along with a variety of other training opportunities to support each engineer’s learning style.
“We tried to push the thought that people learn in different ways, and we wanted to support that.”
“We made it very clear to engineers internally that if they didn’t feel like taking an in-person course was the best approach, we would pay for other ways,” Bright said. “We bought books for some people, while others preferred online courses. We tried to push the thought that people learn in different ways, and we wanted to support that.”
Most of the training opportunities were designed to give engineers an introduction to Python coding fundamentals, but Bright said those sessions weren’t very helpful. It wasn’t until a session that involved building a web app using Python’s flask framework that engineers started seeing benefits.
“What we learned was that most people, unsurprisingly, learn by doing,” Bright said.
That insight filtered into a conservative rollout of projects in the new language rather than doing it all at once, Bright said.
Engineering leaders like Bright worked with ActiveCampaign’s product managers to determine what projects should be transitioned to Java or Python. And when they picked up those projects, they built in longer deadlines to allow engineers to learn on the job and build in a more sustainable way, Bright said. Sometimes that meant an extra week or two for a project, other times a month.
This gave the engineers time to figure out how to authenticate requests between a Python service and a PHP one, and find ways to make sure its pay-per-click services can communicate with each other.
If there was one mistake Bright wishes he could take back in their training rollout, he said, it was rolling out the training for all engineering groups at the same time. Instead, he’d stagger the dates so that engineers could learn Python and Java when they were actually working with it, so they could apply their training.
Three engineers are better than one
Even with the training and methodical rollout, ActiveCampaign’s engineers still hit snags in the development cycle working with Python and Java. It didn’t take long for them to realize they needed to do things differently.
ActiveCampaign’s engineers are split between product and infrastructure teams, and then further divided into smaller scrum groups. When they first started developing in Python and Java, managers assigned these projects to product engineers squads just like they always had, independent of the infrastructure squad. But the product side quickly started running into infrastructure issues that required waiting for the other team to solve them.
With so many moving parts as both product and infrastructure tried to scale their services and introduce new languages, ActiveCampaign concluded that the old way wasn’t working.
Instead, ActiveCampaign formed a new squad called the Accelerate Team, made up of a mix of experienced infrastructure and product engineers. They worked together to build a single application in production in the Kubernetes cluster in three months. Along the way, they helped solve for any issues others might encounter. This gave other engineers a blueprint for how to solve issues they might encounter working in Python.
“For people who are picking up the technology, even just navigating the file structure at times can be daunting for new engineers. Getting everyone in the same room and working together has helped to overcome these challenges.”
The process worked so well, ActiveCampaign has started using these temporary groups of experienced engineers and leaders more often.
“By forming these virtual teams, we just give people the luxury of focus and then get out of their way and let them do what they’re good at,” Bright said.
Within the scrum teams, Bright said they also started mob programming to kick projects off. Like pair programming on steroids, mob programming involves a group of three or four engineers starting a project together discussing how it would be built and initially writing code together. Gathering as a group allowed engineers to pass knowledge back and forth and overcome any experience gaps that might delay a project.
Once they kicked off the coding and had everyone moving in the same direction, they would divide the tasks and build concurrently to finish the project. It was one of the most helpful changes the team made to make adopting a new language easier, Bright said.
“It’s really effective in making sure that everyone is starting at the same point and moving in the same direction,” Bright said. “For people who are picking up the technology, even just navigating the file structure at times can be daunting for new engineers. Getting everyone in the same room and working together has helped to overcome these challenges.”
Documentation is key
Beyond introducing new programming languages, ActiveCampaign also had to scale its engineering team rapidly. To make sure every engineer knew what to do when they joined, Bright said engineers prioritized documenting the company’s services.
“It should be dead simple to go from getting your computer and getting up and running on day one,” Bright said.
Most of its documentation revolved around developing helpful READMEs that described the structure of an application, but engineers also started to track how a service was built. Engineers made it clear why certain decisions were made, and, perhaps most helpfully, provided a section that allows a user to look at the history of a service and see how it’s evolved.
“With any codebase it’s really easy to look at a piece of code or a set of files and say, ‘I have no idea why anyone would have done it this way,’” Bright said. “So we’re trying to get ahead of that problem.”
As engineers continue to build new services in Python and Java, they’ll begin to have a better understanding on how to weave the language into other parts of the codebase. Still, Bright said ActiveCampaign’s tech is now at the point where there are more Python services than PHP. Python and Java are increasingly becoming the default, and the projects that used to take them six or seven weeks to go from inception to production will soon take less than a day.
“With any codebase it’s really easy to look at a piece of code or a set of files and say, ‘I have no idea why anyone would have done it this way.’”
The transition has generated excitement from current engineers and new ones thrilled to work in a more modern and fast-growing language.
Now that they’ve completed the hard part of onboarding the language, they can focus on the fun aspect — scaling it.
“It’s great to announce you’re using a new language, but not everyone can be using that new language right away,” Bright said. “Each day, more people are seeing their teams picking up the new languages. They’re having conversations about where it makes sense to deprecate some of the PHP code, what’s the safest path to do that and figuring out how they will migrate production data and traffic. Those are the problems engineers love to solve.”