Julien Mortuaire, Chief Technology Officer (CTO) at Treezor, and Nicolas Bordes, AWS Architect at Treezor, recently engaged in an insightful interview with Matthieu Napoli, the founder of Bref.sh, a renowned serverless framework tailored for PHP applications. This discussion revolved around Treezor, the European Banking-as-a-Service (BaaS) leader, and its notable shift from a legacy PHP monolithic application hosted on traditional servers, to an advanced serverless architecture empowered by AWS Lambda and Bref.sh

Why serverless?

Julien Mortuaire and Nicolas Bordes emphasized the specific and high expectations set by Treezor: “We face two fundamental challenges, ensuring robust security and enabling seamless scalability. Security is paramount to protect our data and infrastructure, while scalability is crucial to handle fluctuating levels of user activity. Treezor requires a versatile API capable of meeting diverse customer needs. To address these imperatives, Treezor made the strategic decision to migrate to the cloud, opting for serverless technology and managed services.”

The selection of the AWS Cloud as the preferred platform was driven by the need for resilience, multiple availability zones, robust security, scalability, and value-added services enhancing Treezor’s architecture.

The Migration Process:

The migration was successfully executed in three key steps:

  • Validating serverless infrastructure: Treezor began by building a new serverless PHP application to test the AWS Lambda stack’s capabilities. This application handled daily banking operations to evaluate serverless technology’s scalability and resilience.
  • “Lift-and-Shift” of the monolith legacy application: Instead of embarking on a time-consuming rewrite, Treezor leveraged Bref’s PHP-FPM runtime to transition its monolithic code to AWS Lambda. Treezor deployed the application on both servers and Lambda, facilitating a gradual migration. The critical route for live credit card transactions successfully migrated to AWS Lambda in October 2021, paving the way for further endpoint migrations.
  • Refactoring into serverless microservices: After the successful API migrations, Treezor shifted its focus to breaking down the monolithic structure into manageable microservices. We employed the “strangler” pattern, using API Gateway routing for seamless traffic transitions to new services as domains were split.

What are the results? 

Although challenges emerged, the results were positive:

  • API response times improved by 2.5 times
  • On-call alerts were reduced by 2-3 times
  • API endpoint timeouts for card transactions decreased by a factor of 10.

Ongoing work involves further migration to microservices, with approximately 90% of its stack now residing in a serverless environment on AWS.

Two approaches, one success story: 

Treezor’s use case illustrates two distinct approaches to serverless adoption:

  • “Lifting-and-shifting”: Transitioning existing PHP applications to AWS Lambda with minimal modifications, offering scalability and simplicity.
  • Event-driven microservices: Leveraging AWS Lambda’s integrations with various AWS services to create highly scalable and adaptable microservices. This demonstrates that the initial migration can be a stepping stone to a more advanced, event-driven architecture.

Treezor’s transformation not only reflects a successful serverless migration but also highlights the flexibility and robustness of cloud technology, offering scalability and security.

Do you want to know more? For further information, please read the full use case here.

Do you want to grow your payment project? One of our experts will get back to you as soon as possible.
Contact us!