Serverless functions are becoming increasingly popular, but not everything fits into that model. And although it is possible to create an API with a f

Micro APIs with OpenFaaS and .NET

submited by
Style Pass
2021-07-13 10:00:05

Serverless functions are becoming increasingly popular, but not everything fits into that model. And although it is possible to create an API with a function for every operation on a resource, it would easily become something difficult to manage.

Luckily, OpenFaaS can host various types of workloads, not just functions, as long as they serve HTTP traffic, assume ephemeral storage, and be stateless. That means that we can, if we want (not that we should), bundle an entire API behind a workload.

The idea behind a micro API is to have a microservice that implements an API for a particular context — usually one or a very limited set of resources. That particular context ensures you don’t duplicate too much code and that you focus the behaviour of the microservice.

The rule of thumb is that it should be small enough to focus only on what matters (the context) and just big enough to avoid code duplication and fragmentation (beyond the context).

Leave a Comment