24 Jun · 16 min read
FinTech is industry-oriented towards developing novel financial applications and solutions to traditional ways of dealing with finance. But building a FinTech application is not easy, and many people need to have FinTech explained to them, both when it comes to development and general use. Mooncascade’s mission for today is to do just that. This ‘FinTech Explained’ guide will go through the key principles that Fintech developers need to know in order to make their projects a success.
Before we get started with our ‘FinTech Explained’ guide in earnest, however, we want to provide a little background information first. Today’s financial market is a true digital battlefield. Its landscape is vast, its opportunities are endless, and the weapons available to its warriors are varied. This battlefield is regulated by different authorities who always seem to be raising the entry barrier for newcomers. The fact that you need to react quickly to the changes and requirements they impose to stay in the game is just icing on the cake.
There are many ways of developing modern software applications. One of the biggest challenges that any development team faces is how to choose the right tools for doing so from the ocean of technologies out there.
Having built core banking solutions for Solarisbank and been at the forefront of adopting popular approaches here at Mooncascade, as part of our ‘FinTech Explained’ guide I will be shedding some light on how you can build winning fintech products, and I’ve included a list of pros and cons for each one, so you’re guaranteed to walk away from this article with some food for thought.
Keep in mind that a FinTech application always depends on the context and specific requirements it’s built for and that there’s no such thing as a one-size-fits-all solution. Moving ahead though, let’s have a look at some key terms you’ll need to be familiar with before we really get started with our ‘FinTech Explained’ guide.
FinTech Explained: Monolithic Architecture
Despite the fact that many people have strong opinions about monolithic architecture — especially considering the recent boom in microservice-related topics—it’s usually the best way to start developing applications. Many successful services have started with a monolithic architecture, including Paypal, Amazon.com, and Netflix.
FinTech Explained: The Pros of Monolithic Architecture
Monolithic Architecture is a perfect fit when you don’t know the clear boundaries of your system’s components or how they interact with each other; it reduces operational overhead (sometimes significantly); it simplifies developing, testing, deployment, and the implementation of crosscutting concerns (logging, monitoring, etc.).
FinTech Explained: The Cons of Monolithic Architecture
The cons of monolithic architecture are centered around the following areas:
You’d be right to think that there are quite a few more cons than pros here. But with FinTech applications, it’s often important to get up and running as soon as possible, to “prove your concept” and get your first round of feedback from your client. Moreover, your initial requirements, goals, or even vision might be adjusted or shifted elsewhere as development progresses. To learn more about why a monolith can be helpful in this context, I’d recommend reading Martin Fowler’s article “MonolithFirst”.
FinTech Explained: Microservice Architecture
Microservices are still quite a hot topic nowadays, and there are lots of resources out there for using them. This is a more advanced architecture than the monolith, and adopting it typically requires an experienced team along with careful planning. However, the next step in our FinTech Explained guide is to point out that once a monolith reaches a certain size, it’s time to divide it into specific services. Just as we did for monolithic architecture, below you’ll find the pros and cons of using microservice architecture (especially compared to a monolithic approach):
FinTech Explained: The Pros of Microservice Architecture
FinTech Explained: The Cons of Microservice Architecture
This approach entails high operational complexity—you have to deal with things like inter-service and inter-team communication, partial failure, cross-cutting concerns (logging, monitoring), configurations, requests that span across multiple services; harder testing of interactions between services; hidden coupling; and data consistency.
Another implicit problem with this approach is that startups tend to take it by default, aiming to solve problems that might not even exist in their use case. This in turn slows down development and could possibly damage a product or even a business down the line.
For example one of our clients - Solarisbank - started their digital banking service with a monolithic architecture, then turned to microservices once they grew big enough.
Nevertheless, this approach provides a great opportunity for your product and business to scale, grow, and evolve over time. Plus, it enables implementing distributed event-driven architecture and helps decouple your services even more.
Domain-Driven Design (DDD) is a popular approach to building software applications. I won’t take a deep dive into this as part of this ‘FinTech Explained’ guide since it’s a broad, complex topic. Plus, it’s just as popular as microservices, so it would be easy to go wild here and thereby make our ‘FinTech Explained’ guide much longer than it needed to be.
The main concept here — domain — is what defines your business. For example, Solarisbank’s domain is digital banking; Wise’s domain is money transfers; but Amazon has multiple domains such as e-commerce, cloud web-services, video streaming, etc.
With DDD, you’ll use a set of the main building blocks from Tactical Design (Entities, Value Objects, Service Objects, Aggregates, etc.) and Strategic Design (Bounded Context, Context Maps, Ubiquitous Language).
One thing I’d like to elaborate on here is Ubiquitous Language (UL) and its importance. UL is a set of terms and concepts in the business domain relevant for a specific Bounded Context and developed with the agreement of all parties — the domain experts, the technical team, and others. It helps eliminate ambiguity, understand the business, and speak using the same “language.”
Ubiquitous Language must be expressed in the software model you’ll be using, and evolve alongside the business and the model it’s applied to. The FinTech industry is really broad, so eliminating ambiguities at this stage will really help your team avoid getting lost as things move forward.
Having said all that, this ‘FinTech Explained’ guide wouldn’t be complete unless I went on to give you an example, so let’s do that with two (Bounded) contexts: Loans and Savings. The Loans context contains terms like Account (customer account), Interest (loan interest), Payment Due (the loan payment date), and Overdraft. The Savings Context contains terms like Account (savings account), Interest (interest on savings), Payment Due (payment of the interest), and ISA.
Using similar terms without context and a shared understanding between teams can bring uncertainty to business decisions, break software, and affect the end-user. In addition, the amount of time wasted on clarifications and “mental” mapping will only increase over time. By applying and enforcing UL within an organization, teams from different departments will be able to understand one another and tackle obstacles much more quickly. For instance, the support team might directly tell technical team members that customers complain about incorrect Interest calculation on their savings accounts (i.e., related to a Savings Context).
The traditional way of making an application state persistent is to save it into storage. This means that you’ll always see the application’s final state. It’s a common way of dealing with data, especially with a CRUD monolith. As business grows and the team decides to split a monolith into different (micro-) services, questions about how to decouple these services and deal with distributed data (in case of using multiple databases or database per service) will start to pop up.
Furthemore, if a company wants to get a banking license or if it performs financial operations, it must conform to the regulatory and compliance requirements of the specific country or region in which it is operating. For example, the German Federal Financial Supervisory Authority requires an audit log of all operations taking place with customers’ accounts.
One of the ways to do this is Event Sourcing, and so, Event Sourcing is the next stop in our ‘FinTech Explained’ guide. It’s become popular due to increased interest in DDD and microservices. The essence of this design pattern is that changes to application states are stored as immutable sequences of events. Basically, it saves the history that leads to said state. By replaying these events, the state can be reconstructed completely or for an arbitrary period of time. Pro tip: use state snapshots to improve performance.
Usually, events represent domain-related facts that have occurred within a system. It might be a good idea to do Event Storming sessions in advance to identify these kinds of events. DDD also comes to the rescue here with the idea of Domain Events.
Take your bank account, for example. The bank doesn’t save your current balance - it stores deposits and withdrawals that happen over time. For example:
Events are typically stored in an ‘Event Store’. It could be MongoDB, MySQL, Apache Kafka, etc. You can have different event stores for different subdomains (or Bounded Contexts)—for example, one event store for Account & KYC and another one for Payments.
FinTech Explained: The Benefits of Event Sourcing
Of course, these benefits don’t come without a cost. This style of building applications is different and usually unfamiliar to developers, so it implies a learning curve. See the list below for some food for thought regarding Event Sourcing.
FinTech Explained: Things to consider before proceeding with Event Sourcing
Obviously, Event Sourcing is not a good fit for every application and can be overkill. But if you need traceable changes, audit logs, the ability to easily extend a system, different forms of reporting and analysis, and modeling of alternatives, then this is a solid solution. Plus, you don’t even have to implement ES for the whole system; it can be done for only some of its components.
Developers generally use the same models to read and update the information when building CRUD applications. This simplifies and unifies how they work with data. Also, it’s easier to understand a mental model of creating, reading, updating, and deleting a record. That is until your system and its requirements become more sophisticated.
You may need to make up virtual fields, like the number of days left to pay for a credit card, required for mobile app UIs only. It could be a list of transactions for a specific date, noting the remaining amount of money after each transaction. Alternatively, you might want to update your information system based on specific business rules and data that allow only specific data within the model, or store data that is completely different from the data you provide the system with.
This is where CQRS (and the next part of our ‘FinTech Explained’ guide) comes to the rescue. It’s a pattern that was initially described and popularized by Greg Young. CQRS stands for Command Query Responsibility Segregation. It’s related to the idea of Command Query Separation, or CQS.
So, what is CQRS? It’s a design pattern where the model that’s used to read the information (Query) differs from the model that updates it (Command). The main purpose of the pattern is to decrease the complexity of dealing with data in sophisticated, distributed, and/or event-driven systems.
Imagine an investment application where a customer can buy some form of assets. An asset’s read model might contain a ticker name, company info, historical price data, current price, balance sheet, different ratios, with some of them being optional. In parallel, when the customer buys the asset, the write model might also require data like the customer’s account number and available balance, the asset ticker and current price, a number of shares to acquire.
Read and write models can share the same database, in which case the database acts as the communication layer between the models. Another popular approach is to have separate databases for the models—a master database and read replicas—in which case there should be some communication mechanism between them, such as messaging/events.
FinTech Explained: The benefits of CQRS
FinTech Explained: The drawbacks of CQRS
The way that CQRS and Event Sourcing work means that the two can function together hand-in-hand, and the next part of our ‘FinTech Explained’ guide will explain that relationship. As noted, CQRS fits event-driven architectures, and Event Sourcing in particular, very well. The reason for this is that CQRS helps resolve problems that come with ES, like performance, events processing, and complexity.
In general, the read model consists of (query) services that expose APIs to get the info and projectors that consume events and update databases (project the state of events). As an event store in ES is a source of truth, it allows us to replicate events and generate different views for different purposes. Also, you can easily remove and replace query services if requirements get changed and new query services get shipped.
The write model typically consists of command services and reactors. The command services accept and validate requests/commands, build an Aggregate (a reference to DDD), check invariants, and then generate and store events in the event store. The reactors basically do the same, apart from being triggered by an event other than command, i.e., they react to events and might produce new events. Commands can be processed immediately or can be placed into a queue, i.e., they can be processed synchronously or asynchronously.
Before we end this part of our ‘FinTech Explained’ guide, we want to say a few words about aggregates, with reference to Martin Fowler’s description: an aggregate is a collection of entities and value objects that can be treated as a single unit. It has one main object from the collection as an aggregate root. All of the external interactions with an aggregate from outside pass through the aggregate root. The purpose of the root is to keep data integrity, consistency, and check business invariants. Transactions shouldn’t cross the aggregate’s boundaries. Aggregates are stored to and loaded from storage as a whole. For example, a bank might have the following requirements in order to open an account: your age should be 18+ and you should be a resident of the UK. These are clear business invariants that must be enforced by the account aggregate.
FinTech Explained: Some questions to consider when using the combined CQRS + ES approach:
As we hope that this ‘FinTech Explained’ guide has shown you, nowadays building software requires you to make a host of business-related, operational, and technical decisions. If you ask an experienced developer how you should make these decisions, the most common answer you’ll hear is: “it depends”. Your decisions should always depend on context, requirements, capabilities, expertise, experience, and money - while starting simply, improving iteratively, seeking feedback quickly, and accepting trade-offs within the technologies you use will all help your product grow to impressive heights.
As we draw our ‘FinTech Explained’ guide to a close, we would like to point out that building next-level FinTech products in an increasingly unpredictable, demanding, and regulation-heavy market is an uphill struggle. The market waits for nobody, so if you want a chance at winning, you’d better know how to play its game. You’ll want to join forces with someone who can give you an edge over the competition.
An experienced FinTech partner with a proven track record can do just that, by taking a big part of the product development load off your shoulders. They can make sure your platforms are built with cutting-edge technology and the highest standards in security and usability, giving you time to focus on the rest of your business.
Here at Mooncascade, that’s exactly how we help our clients, whether they’re a startup or an established player. So to learn how we can help, or even to have the benefits of FinTech explained with reference to your own individual business circumstances, why not drop us a line today?
Author: Roman Shandurenko
Leave a comment