Start with the project’s domain, without a database or API. Model rules that stand on their own and use interfaces where behavior can vary; payment authorization stays simulated throughout the track.
Backend Software Engineering with C#/.NET
Vinicius Tirabassi · ~96 hours · 0 of 26 resources
Object-oriented programming in C#
Abstraction, encapsulation, inheritance and polymorphism in the language.
Access →Classes, structs and records in C#
Types, members, visibility and object identity in the domain model.
Access →Exercises
- Create a .NET 10 solution with Order, OrderItem and Payment classes; keep the order total consistent when items are added or removed
- Define interfaces for shipping calculation and simulated payment authorization; implement two strategies for each
- Use encapsulation to reject empty orders and negative payment amounts; verify these behaviors with simple tests
Create web APIs with ASP.NET Core
Routes, HTTP methods, validation, results and error responses.
Access →Exercises
- Expose POST /orders, GET /orders/{id}, GET /orders and POST /orders/{id}/payments using temporary in-memory storage
- Define 201, 200, 400, 404 and 409 responses for creation, retrieval, invalid input, missing resources and conflicts; use Problem Details for errors
- Review paths to use resources and nouns; document why each method and status code was chosen
Turn week one’s model into an ASP.NET Core API. Focus on the HTTP contract before adding persistence: predictable paths, validation and responses that accurately describe the result.
Docker guide for .NET
Dockerfile for .NET applications, multi-stage builds and running with Compose.
Access →Exercises
- Create a multi-stage Dockerfile to build and run the API from week 2
- Create a compose.yaml that starts the API and PostgreSQL with environment variables, a data volume and a health check
- Start and stop the environment with Compose; confirm the API code does not depend on machine-specific addresses
Prepare a reproducible environment for later labs. Start with only the API and PostgreSQL; add MongoDB, Redis and brokers to Compose in the weeks when they are needed.
PostgreSQL provider for EF Core
Connect C# models and DbContext to PostgreSQL through Npgsql.
Access →Exercises
- Create orders, items and payments tables with keys and constraints; persist API data with EF Core
- Write a SQL query with a join and aggregation to list orders and totals; compare it with the EF Core query
- Create a migration, an index for a frequent query and a transaction that leaves no partial payment after failure
Make PostgreSQL the source of truth for orders and payments. Learn SQL directly and use EF Core to connect the model to the API without hiding the effects of queries and transactions.
Get started with the MongoDB C# driver
Connections, collections and document operations in a .NET application.
Access →Exercises
- Add MongoDB to Compose and create an order-history collection with events and states that are read together
- Load sample records from existing orders without writing to PostgreSQL and MongoDB in the same request
- Query history by order ID, create a suitable index and compare the model with tables and joins
Use MongoDB for a document view of history while PostgreSQL remains the source of truth. This week, populate the collection in a separate lab; event-driven updates come in the messaging week.
In-memory caching in ASP.NET Core
IMemoryCache, expiration, limits and reading the source when the cache fails.
Access →Distributed caching in ASP.NET Core
IDistributedCache and Redis across application instances.
Access →Exercises
- Add an in-memory cache to the product catalog lookup used by orders, with expiration and a size limit
- Add Redis to Compose and implement the same read with distributed caching; observe what happens after restarting the API
- Invalidate the entry when a product changes and confirm that reads still work when Redis is unavailable
Compare the reach and limits of each cache. The catalog remains in PostgreSQL; the cache is a temporary copy with expiration, invalidation and a read path that works without it.
Work queues with RabbitMQ and .NET
Publishing, consuming, acknowledgements and task redelivery.
Access →Exercises
- Add RabbitMQ to Compose and send simulated payment authorization requests to a work queue
- Add Kafka to Compose, publish order events and consume them to update history in MongoDB
- Compare acknowledgements, offsets, retention and redelivery; identify the failure risk between writing to PostgreSQL and publishing an event
Use RabbitMQ to distribute work and Kafka to record events consumed by a projection. They address different needs; keep producers and consumers minimal at this stage and observe what happens when they fail.
Idempotent Consumer pattern
Persistent deduplication to prevent repeated effects after message redelivery.
Access →Idempotent method semantics in HTTP
Definition of idempotency and expected behavior of HTTP methods.
Access →Exercises
- Accept an idempotency key when creating a simulated payment; store the key, request fingerprint and result in PostgreSQL
- Return the same result for a repeated request and reject reuse of the same key with different content
- Redeliver a Kafka event and a RabbitMQ task; use persisted identifiers and unique constraints to prevent duplicate effects
Examine idempotency in both the HTTP contract and asynchronous processing. Deduplication must survive restarts and concurrency; also discuss the outbox pattern to reduce the risk of losing an event between a transaction and publication.
Hosted services in ASP.NET Core
Worker lifecycle and implementing jobs with BackgroundService.
Access →Exercises
- Mount a CSV directory in Compose, add an import request to the API and process it in a BackgroundService
- Stream a large CSV and write bounded batches, for example 500 records at a time, without loading the entire file into memory
- Persist progress and errors in PostgreSQL; interrupt and resume the import after a failure without duplicating orders
Use the Docker Compose environment from previous weeks to run the API and its dependencies while the import proceeds. Compare memory use with loading the whole file and expose the import status through the API.
Microsoft.FeatureManagement library for .NET
Registering and evaluating flags in a .NET application.
Access →Exercises
- Create a new simulated payment rule and guard it with a flag evaluated by Microsoft.FeatureManagement
- Configure the flag locally and demonstrate both behaviors in the same payment flow without changing the HTTP contract
- Record which rule was applied and write a test for each flag state
Use the flag to release the rule gradually and practice rolling it back. Document the default value and a criterion for removing the flag once the rule is stable.
Integration tests in ASP.NET Core
Testing the HTTP application with WebApplicationFactory and test dependencies.
Access →Exercises
- Write unit tests for order, payment and idempotency rules, including the new rule with its flag on and off
- Test the API against PostgreSQL and run an end-to-end scenario from order creation to the simulated payment result
- Create a k6 load test for order reads and creation; set thresholds and compare results with and without cache
Organize the suite by cost and purpose: many fast behavior tests, integration tests for real boundaries and a few end-to-end scenarios. Record baseline latency and failure rates before interpreting the load test.
Observability with OpenTelemetry in .NET
Instrumentation and the three main signals in the .NET ecosystem.
Access →Exercises
- Add structured logs with order and correlation identifiers while excluding sensitive payment data
- Measure API and background processing rates, latency and failures; create traces linking a request to the consumer and worker
- Simulate a payment failure and investigate it with logs, metrics and traces; record the cause, impact and fix
Finish the project by showing an order’s journey from the HTTP call through asynchronous tasks. Use all three signals to distinguish slowness, duplication and processing failures in the local environment.