We value your privacy. We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Read our Privacy Policy for more information.
back arrow icon
Engineering
Methodology

Bringing this SaaS product up to modern technical standards through an impactful refactoring trajectory

Wednesday, May 8, 2024
Sebastiaan Viaene
Engineering manager

In a recent cooperation we assisted a well-established SaaS company in the medical industry to renew their technical foundations. Prior to our involvement, the application was facing performance issues, rising operational costs, limited infrastructure extendability, and increasing code complexity. These factors negatively impacted the user experience and placed constraints on the development team's ability to efficiently evolve and adapt the product. To tackle these challenges, we initiated a comprehensive refactoring trajectory of the application and the cloud infrastructure. This post outlines the technical decisions and actions taken, showcasing the improvements made to the API's overall functionality and system architecture.

Transitioning from DigitalOcean to Google Cloud Platform

Prior to our involvement, the application was hosted on DigitalOcean where our client was essentially just renting server capacity, putting significant responsibility in the hands of the technical team over the infrastructure configuration and maintenance.

As part of the refactoring trajectory, we decided to migrate the entire infrastructure from DigitalOcean to Google Cloud Platform (GCP), leveraging GCP’s managed services. 

Utilizing BigQuery, we unlocked powerful data analysis capabilities. For background processing, the integration of Pub/Sub and Cloud Run enhanced the application's efficiency and scalability, offering robust solutions for asynchronous tasks and microservices architecture. 

This comprehensive suite of tools not only advanced the scalability, reliability, and security but also streamlined the development and deployment processes. The familiarity of our team with GCP enabled a smooth transition, leveraging existing knowledge and practices to maximize these new capabilities.

Below is a visual overview of the Google Cloud Platform components utilized in our project.

Versioning

A significant portion of our refactoring effort focused on elevating the API's security and modernizing the technology stack. By migrating to the latest stable versions of Symfony (upgrading from 4.1 to 5.3) and PHP (upgrading from 7 to 8), we not only tapped into the latest features and improvements but also bolstered the API against potential vulnerabilities. These updates were crucial in ensuring that the API remained secure, performant, and ahead of the curve.

The transition to PHP 8 was particularly noteworthy, bringing with it the introduction of PHP attributes. This shift from annotations to attributes enhanced our code's readability, maintainability, and type safety. PHP attributes provided a more robust typing system, complete with autocomplete and the ability to navigate directly to referenced objects. This improvement was a significant leap forward in our efforts to ensure that our codebase was as efficient and developer-friendly as possible.

To better illustrate the advancements achieved through our technology updates, the table below highlights the most significant benefits realized from upgrading our stack.

Simplifying the API & database setup

In our mission to refine and optimize the API, we placed a strong emphasis on simplification—both in terms of our route architecture and our database schema. Simplifying our routes involved reducing the number of parameters, enforcing naming consistency, and eliminating unused routes. This not only made our API more intuitive for developers to navigate but also significantly improved its overall performance and maintainability.

Similarly, we simplified the database. We used a custom script to migrate data from the old schema to a new, more streamlined structure. This process involved removing unused tables and fields, adopting enums for consistent data representation, and ensuring uniformity in createdAt and updatedAt fields. The result was a leaner, more efficient database that was easier to manage and query.

Reflecting on our journey

Going into this endeavor together with our client, our objectives were to enhance robustness and scalability of the application and to optimize costs. The refactoring turned out to be a major success with the technical improvements resulting in significant operational efficiency gains as well. Looking ahead, these changes provide a strong foundation for continued growth for the technical team and the broader company as a whole.

Could you use some extra hands in your technical refactoring journeys? Don’t hesitate to reach out!

See also

Let's build!

Are you looking for an entrepreneurial digital partner?
Reach out to hello@panenco.com.

Egwin Avau
Founding CEO
Koen Verschooten
Operations manager

Subscribe to our newsletter

Quarterly hand-picked company updates
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.