August 14, 2022

Before you design your API, model your API

I’m often asked which is the better style of API: REST, GraphQL, or gRPC. My answer is always: “I’m not sure. What does your API model say?” At this point, I’m often met with blank stares or given an answer about some database. What I’m really asking is: “What problems does your API solve and why?” Once we understand the needs better through modelling our API, we can then determine what API interaction style(s) are the best fit for your API.

Before you design your API, model your API Read More

Design Patterns for Handling Long-running Tasks

In today’s world, users expect applications or websites to be fast, and usually, a latency of around 100 milliseconds is considered reasonable. We can improve the latency of services by avoiding chatty APIs or leveraging materialised views for more expensive queries. However, for some long-running jobs like generating a PDF or performing a complex calculation, there is not much we can do to make them run faster rather than scaling up/out. In this article, I’m going to take a look at two patterns for handling such requests.

Design Patterns for Handling Long-running Tasks Read More