iFit: splitting a legacy fitness app monolith into microservices
Alongside the split, the Brocoders team fixed iFit's vulnerability tickets: 60% handled in the first 2 to 3 months
Industry
Fitness software
Location
USA
Client since
2021
Status
Finished
60%
Vulnerability path tickets in 2 to 3 months
Under 2 weeks
To independent work
13 months
On iFit's live platform
1
New service built end to end
iFit is the connected-fitness company behind NordicTrack, ProForm and Freemotion equipment. Its subscription platform streams trainer-led classes and global routes to connected treadmills, bikes, ellipticals and rowers, and by August 2021 iFit reported over 6.1 million members in more than 120 countries.
From February 2021 to March 2022, a Brocoders team of senior Node.js developers worked inside that platform. It owned iFit's backlog of vulnerability and bug tickets and built new services for iFit's move from a monolith to microservices. Another Brocoders team built iFit's integrations with Apple Health, Strava, Garmin and Google Fit, described in its own case study.
iFit at a glance
Client
iFit (formerly ICON Health and Fitness), Logan, Utah, USA
Product
Connected-fitness subscription platform for treadmills, bikes, ellipticals and rowers
Scale
Over 6.1 million members in more than 120 countries (August 2021)
Engagement
A Brocoders-run team inside iFit's live platform, beside iFit's own engineering teams
Domain
The vulnerability and bug backlog, and new services, Feb. 17, 2021, to March 2022
Team
A team lead, 3 senior Node.js developers (4 from February 2022), a QA engineer and a PM
Stack
Node.js, JavaScript, TypeScript, PostgreSQL, AWS
How iFit found us
Google search and reviews, then an interview with the team
Ramp-up
Independent work in under two weeks
Result
60% of vulnerability path tickets handled in 2 to 3 months
The situation: two programmes on a live iFit platform
In early 2021, iFit had two pieces of engineering work running on its live platform, and our team took part in both.
The first was a backlog of vulnerability and bug tickets in iFit's existing JavaScript and Node.js codebase, which Brocoders had not built. Our team started on it on Feb. 17, 2021.
The second was iFit's move from a legacy monolith to microservices. In the view of our team lead, the platform had grown so large and interlinked that a change in one part could affect another. iFit had decided on the move before we joined, and its own team had already moved the first and largest piece: the base functionality the rest of the platform relied on. Our team joined that programme and took on services that sat to one side of the core.
iFit's VP of Engineering at the time, Brad Kramer, later summed up the programme on LinkedIn: "My teams re-platformed the connected fitness platform from VMs to containerized microservices, cutting cloud costs 50%."
The iFit vulnerability backlog
The tickets covered security issues and bugs. In its first 2 to 3 months, our team handled 60% of iFit's vulnerability path tickets. iFit then kept the team on, and it worked through the backlog until March 2022.
“For the bug fixing, we had all the tickets written up and assigned a few of our team leaders internally to help them ramp up. Within less than two weeks, they were jumping right in and working independently.”
Moving a function out of a live monolith carried five risks, and the team planned for each.
Risk 1
Members on the site during the move
Members had to keep using the platform while a function moved out of the monolith.
Solution
The team planned the data migration and data compatibility before each switch.
Risk 2
Data lost if the new service failed
Risk 3
Members noticing a difference
Risk 4
A circular dependency
Risk 5
A monolith under continuous change
Members had to keep using the platform while a function moved out of the monolith.
Solution
The team planned the data migration and data compatibility before each switch.
Members' data had to be saved even if the new service stopped responding or slowed down under load.
Solution
At the start, data went to both the monolith and the new service, so the platform could fall back to the monolith.
A moved function had to behave as before.
Solution
The business logic stayed the same. The team rewrote inefficient queries and dropped unneeded data, and left the behaviour alone.
Two entities requested each other in a loop. The first called the second, and the second, to build statistics on the first, needed data about itself, so it ended up requesting itself. With that loop, the data could not be split into a separate service.
Solution
The team removed the request for the second entity's own data from the statistics logic, which broke the loop. Each service kept its own data, and the one that builds statistics requests the rest from the other services.
Other iFit teams kept fixing bugs and adding features in the monolith during the move, so the code being moved could change while the team worked on it.
Solution
The team tracked changes in the main project while it extracted each function.
How the team moved a service out of iFit's monolith
1
Map
Work out how the function behaves in the monolith today.
2
Wrap
Put a wrapper over the function's current data provider, such as a database, and design the new service's database.
3
Switch
Point the wrapper at the new service.
4
Adapt
Change the old application to work with the new service.
The team built one service end to end this way, and part of a second.
Our team: the second Brocoders team at iFit, 2021 to 2022
The team arrived already working together and joined iFit's process, which is how our senior engineering pods work.
Team
lead
Senior Node.js
developers (3, then 4)
QA
engineer
Project
manager
1
Feb. 17, 2021
A team lead, two senior developers and a PM start on the backlog.
2
March 2021
The team works independently, and a third senior developer joins.
3
April 2021
A QA engineer joins.
4
2 to 3 months in
60% of the vulnerability path tickets are handled.
5
February 2022
A fourth senior developer joins.
6
March 2022
The team finishes its work for iFit.
5.0
“Having team composed and ready for us that already knew how to work together set them apart for me. We've had a few staff augmentation teams, but we can rely on them because of how they work together.”
Questions about security backlogs and microservices on a live product
iFit led its move to microservices. Our team built one service end to end and part of a second, and adapted the old application to work with them.
In the view of our team lead on the iFit project, when the expected load is high and the functions can be separated. Self-contained jobs move out cleanly, such as sending email, SMS or push notifications, or a background task that runs a few times a day. A dashboard that groups data from many entities, or an entity tied to many others, is hard to split. Moving a monolith is slow and expensive, so a software audit should come first. More in our monolith vs microservices guide.
Optimizing what is already there: rewriting inefficient queries, returning only the data a screen uses, and scaling the server up or out as a short-term fix. Another path is to keep the monolith and build new features as separate services.
Yes, if only part of the functionality moves at a time. Part of the team moves functions, and the rest ships features and fixes. Moving everything at once pauses the product, and splitting the work across two teams that touch the same code makes the move longer.
At iFit, data went to both the monolith and the new service at the start, so the platform could fall back to the monolith if the new service failed. The team also planned the data migration and its compatibility before each switch.
At iFit, in under two weeks, with the tickets written up and iFit's team leads helping the engineers ramp up. In its first 2 to 3 months, the team handled 60% of the vulnerability path tickets.