Posts

Showing posts with the label architecture decision

Developer Portal

Image
  What is a Developer Portal? An API without good documentation is no better than having no API at all. A Developer Portal is more than having good documentation, it is a great way to showcase your thoughtfulness in designing and documenting the API, to engage with the API consumers, and be the central point of conversation between teams. It sounds great, doesn’t it? But what is a Developer Portal (referred to as portal below) really? To put it simply, a portal is the interface between a set of APIs, SDKs or other interactive digital tools and their stakeholders. It’s worth emphasising that the purpose of a portal is more than meeting the needs of its immediate team (developers, QAs or PMs etc), but also engaging with other business and development professionals. It is not hard to find a selection of example Developer Portal for the finance industry, like Nasdaq , Dow Jones , SWIFT ; or industrial leaders in tech, Twitter , Google , Meta etc.  Why should you build a Developer...

Event Sourcing

Image
The journey to break down the monolith to microservices in order to accelerate software delivery lies many challenges, including defining bounded contexts as DDD aggregates; connecting the contexts with domain events using either orchestration or choreography; and the mechanism to publish these domain events reliably and persist and consume the events consistently. An event-centric way of structuring the business logic and aggregate persistence is called event sourcing. Problem with Traditional Persistence Traditionally, aggregates are represented as classes or objects in applications. It has worked well for monolith systems. Despite being hard to change, maintain and scale, there are also several limitations to this approach. Object-Relational Impedance Mismatch The object-relational impedance mismatch problem describes the conceptual mismatch in serving relational data using an object-oriented programming language. This tends to have a few common symptoms. Relationships are represen...

Data Consistency across Microservices with Outbox Pattern

Image
Intent  When moving to microservices architecture, one of the biggest challenges is dealing with data consistency among a swarm of microservices. Microservices are loosely coupled and separated by bounded contexts, such as a transaction through the trade lifecycle, which needs to be broken into local atomic transactions that can be executed by individual microservices within their own domain (not the other way around, i.e. a microservice knowing the internal constructs of other microservices’ databases). In order to achieve eventual consistency within a business transaction , the microservices need to be able to: persist data in relation to their own domain, and  publish events to the event broker upon changes to asynchronously trigger the execution of other processing units. These are two distinct operations, often referred to as dual write . Because they are two separate operations of an atomic transaction, it became a source of consistency issues, performance dips and scal...

Idempotency

Image
Intent Idempotency , or idempotence , is a mesmerising word the first time you come across it. It is a concept rooted from abstract algebra in mathematics. Even though it may help understanding from a mathematical perspective, idempotency can be simply put as: The net result of multiple applications of the same method remains the same. Why is idempotency important, or relevant at all for RESTful APIs ? First, let us start by inspecting a real world example. Imagine an online payment scenario, the website suddenly becomes unresponsive and you have no idea if the payment you just made was successful or not. The temptation is to keep pressing the payment button, despite being advised not to. Soon you will find yourself swarmed by deliveries and a long bill.  Because networks are fundamentally unreliable in a distributed world , disruptions to connections will happen. In the circumstances that an API consumer sends a request but is unable to receive a response, it is impossible for the...