Designing APIs
Having an API ready for production should mean more than just deploying functionality. Certain architectural aspects often get overlooked, only considering them too late in the process, if at all.
In this workshop, we will design APIs with respect to the non-functional requirements that are paramount to any serious application running in production.
We will cover the design process of several API types, including REST, and then we will transition towards messaging, always with an eye on the Cloud.
This is a hands-on workshop, so be prepared to write code! We will start by designing an API with all the production-ready quality attributes. Then, we expand the feature set so that, in the end, we have an overview of the steps we have to take to have robust APIs that are reliable and capable to effortlessly manage heavy loads without breaking a sweat.
By the end of the workshop, you will know how you can evolve your architecture from simple to complex that has the most sought-after quality attributes, from RESTful to messaging-based. We will deep dive into a new world that covers queues, topics, brokers, different abstractions, and patterns like outboxes or sagas specific to distributed systems.
We will see what the usual steps are to do that and what transformations we have to make in our architecture to accommodate everything.
This is a hands-on workshop, so be prepared to write code!
Workshop Structure & Contents
- Why API design matters
- How we address the NFRs
Introduction to API design
We will cover
- Guiding principles for API design
- Modular design
- what makes a good API
Desiging REST - based APIs
In this section we delve into intricacies of REST-based APIs, the client/server nature of it and we explore the decision-making process behind choosing REST, by offering a detailed guide to the API design process, documenting and the most common usage scenarios.
- Http methods
- Http status codes
- Http headers
- Endpoint naming
- Media-type selection, design & custom media types
Designing gRPC APIs
This section we cover gRPC and we outline the RPC API design process. We start by exposing and defining operations, particularities of consuming these APIs and document them. This succinctly summarizes the key components covered in this part, providing an overview of the gRPC protocol, considerations for RPC, and the step-by-step process for designing RPC APIs.
Messaging-based APIs
In this section we take our previously designed API, and we start doing the necessary changes to make use of asynchronous messaging.
We deep dive into a new world that covers queues, topics, message brokers, different abstraction and patterns and we will see what changes are needed to adapt our previous architecture.
In this section we will see how we can introduce patterns like Outbox, Competing consumers, Sagas, Routing Slips and learn what we gain from using them, as well as looking at how we can monitor our system.
Addressing non-functional requirements:
- Versioning strategies for backwards and forward compatibility
- Observability
- Reliability
- Error Handling
- Fault tolerance
- Resilience tactics
- Documenting the API
- Why document and why is it important
- Performance, Optimization and Scalability
- Throttling
- Measuring performance
- Compression and caching types
- Rate limiting
- Caching & Conditional caching
Prerequisite
This is a Bring Your Own Device (BYOD) workshop. Therefore, attendees are required to bring their own device with the necessary software already installed:
- Need to have Visual Studio, or an IDE you are familiar with
- .NET 9 or higher
- Docker
- Github
- RabbitMq installed as standalone instance or we will install it in Docker
Who should attend?
- The workshop targets .NET Software developers that want to have a more architecture-focused approach
- C# developers that want to understand what are the communication patterns, and the best practices for APIs in distributed architectures.
At the end of this workshop you will be able to:
- understand which APIs are best suited for which scenarios
- understand what are the non-functional requirements needed for a production-ready APIs
- evolve a ‘traditional’ architecture to a more complex one that uses asynchronous messaging
- Understand what asynchronous messaging brings to the table and where it can benefit our distributed systems
Software Architect @Particular Software, Microsoft MVP for Developer Technologies, Microsoft Certified Trainer, always in a quest for the latest trends and best practices in architecture, .NET, and the world around it.
Irina has more than 1000 hours of delivered training, workshops, and presentations, is passionate about .NET and the world around it.
She is the founder of DotNet Iasi User Group where she tries to gather people who are willing to share their knowledge with others, and from time to time publishes articles on her blog: http://irina.codes