Back to Education

gRPC and API design

Design gRPC services with Protobuf contracts, version them safely and expose them to browsers and mobile clients behind an API gateway.

Duration: 5 days (40 hours) Level: Intermediate Target Audience: Backend developers and API designers
gRPC Protobuf API Design .NET API Gateway

Overview

A good API is one the teams using it can work with without calling you. In this training we write the contract first, design gRPC services with Protobuf, grow fields without breaking clients and expose the services to web and mobile clients through an API gateway. The examples come from MicroFrame, where dozens of services are fed by one shared contract repository.

Course content

1. Introduction to API design

  • REST, gRPC and GraphQL compared
  • Resource-oriented design
  • Contract-first approach

2. Protobuf

  • Messages, field numbers and types
  • enum, oneof and map
  • Well-known types: Timestamp, wrappers
  • Naming conventions

3. The contract repository

  • One repository, many consumers
  • Linting and code generation with buf
  • Breaking-change checks
  • Distributing as a submodule or package

4. The error model

  • gRPC status codes
  • Typed error codes and oneof results
  • How clients show errors to users
  • Validation with protovalidate

5. Lists and queries

  • Pagination: pages and cursors
  • Filtering and sorting
  • Field masks
  • Lab: writing a service contract

6. gRPC in ASP.NET Core

  • Implementing a service
  • Interceptors
  • Deadlines and cancellation
  • Streaming calls

7. Security

  • Authentication via metadata
  • Binding permission checks to methods
  • Marking anonymous methods explicitly
  • mTLS

8. Browsers and mobile

  • gRPC-Web
  • The Connect protocol and TypeScript clients
  • The gateway’s role: routing, rate limits, CORS

9. Versioning

  • Rules for backward-compatible change
  • Adding, removing and renaming fields
  • Package versions: v1, v2

10. Testing

  • Unit and integration tests
  • Contract tests that check both ends
  • Lab: a service called from the browser through the gateway

Schedule

Each module takes about 4 hours, half a day; 40 hours in total.

  • Day 1: modules 1 and 2
  • Day 2: modules 3 and 4
  • Day 3: modules 5 and 6
  • Day 4: modules 7 and 8
  • Day 5: modules 9 and 10

Prerequisites

  • Experience building APIs with C# and ASP.NET Core
  • Familiarity with HTTP and JSON APIs
  • A laptop with Docker Desktop and the .NET 10 SDK

Training format

  • On site or remote: at your office or in live virtual sessions.
  • Hands-on: every day ends with lab sessions where you apply that day’s topic to a working example.
  • Lab environment: participants get a prepared working environment and a sample code repository.
  • Tailored to your team: content and examples are adapted to your stack after a short call before the training.
  • Materials: slides, lab guides and reference code stay with you after the training.
Ready to Start?

Ready to start your project?

Let's discuss how we can help bring your ideas to life.