pricing-engine-0c236ed1-4e6b-4e68-99e8-17f9ff5fb7cf

Pricing Engine

Unnamed Global Payments & Commercial Fleet Solutions Provider

Flowmoco is a trusted integrated development partner for a Fortune 1000 B2B payments company. We were tasked with solving a major pricing system challenge that spanned four fragmented monolith systems, each serving a major line of business for our partner.

These monolithic systems, each with varying capabilities, presented significant obstacles in providing a unified pricing approach across multiple business lines, particularly for key sales functions. While the newest system had advanced "risk-based pricing" features, the other legacy systems lacked such key capabilities, creating severe limitations to the scope of sales offerings. Replicating the same new pricing capabilities from scratch for each line of business was unfeasible due to budget constraints and delivery timescales.

Our Solution

Our solution focused on extracting the pricing functionalities and developing a standalone, event-driven services-based system. This new pricing service was designed to be modular and could integrate with the legacy systems without altering their monolithic architecture, addressing the need for both batch-based processing for legacy environments and real-time transaction pricing for modern use cases, such as electric vehicle (EV) pay-at-pump services.

By developing an externalised pricing service, we helped streamline pricing capabilities across all systems, ensuring consistent sales features, improved scalability, and faster deployment times—all while avoiding the costly and time-consuming process of modifying the original monolithic systems. The extracted service reduced manual processes, improved version control, and eliminated decades of accumulated technical debt.

This was a high visibility project within the business, working with key strategic stakeholders, and has become a great success story for our client, with a measurable impact on their sales flexibility and competitiveness.

Read on to dive into some details around our technical approach.

Technical Approach

Flowmoco collaborated closely with our client's offshore business-as-usual (BAU) team to address the challenge of extracting and reimplementing complex pricing logic from a monolithic SQL Server-based system. The goal was to build a distributed, scalable solution while preserving key aspects of the existing system, such as data storage and batch processing, but introducing modern, real-time transactional pricing capabilities.

The technical approach focused on creating a separation between the platform and application logic. The platform itself was developed using Clojure and JVM-based libraries, while the core transactional logic was implemented through a custom Domain-Specific Language (DSL). This DSL broke down the complex pricing logic into smaller, manageable steps, executed through a sequencer that handled orchestration. The sequencer was designed with concurrency and scalability in mind, interweaving coroutines with NATS (a non-persistent message broker) to process pricing transactions in real time.

Pricing Engine High-level component diagram

A micro-service architecture was central to the solution, with the monolithic pricing stored procedures being reimplemented as .NET Core-based microservices. These services communicated via AMQP (RabbitMQ), enabling persistent message queuing for ingress and egress, and integrating seamlessly with MuleSoft as the intermediary between the legacy monolith and the new distributed pricing service. MuleSoft read from the monolith's tables, triggered the Pricing Service, and handled the output from the Pricing Service before writing back to the monolith.

The event-driven architecture ensured flexibility and scalability, allowing the pricing logic to run in distributed environments, either on-premises in the client's data center or in a cloud-based AWS VPC. All components were containerised, resulting in a complex deployment of over 32 microservices, and the clear separation of orchestration logic from the worker processes ensured that the workers remained simple and scalable, with central monitoring and alerting managed by the sequencer.

This solution not only modernised the client’s pricing infrastructure but also laid the groundwork for a long-term shift from legacy monoliths to a more modular, service-oriented architecture.