Milan Jovanović (@mjovanovictech) 's Twitter Profile
Milan Jovanović

@mjovanovictech

Practical .NET and Software Architecture Tips | Microsoft MVP

📰 The .NET Weekly: bit.ly/45T0U7i

▶️ YouTube: youtube.com/@MilanJovanovi…

ID: 1541479855660961792

linkhttps://bit.ly/45T0U7i calendar_today27-06-2022 17:54:38

15,15K Tweet

40,40K Followers

725 Following

Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

How can you pass in a Tenant ID in multitenant applications? You have at least 3 options: - Request header - Cookie - JWT The Tenant ID comes from the HTTP request header in this code snippet. A few other options to get the TenantId are passing it in the query string or

How can you pass in a Tenant ID in multitenant applications?

You have at least 3 options:

- Request header
- Cookie
- JWT

The Tenant ID comes from the HTTP request header in this code snippet.

A few other options to get the TenantId are passing it in the query string or
Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

You don't need complex CI/CD on day one Instead: - Start with repeatable scripts - Automate one step at a time - Focus on fast feedback loops Deployment systems should grow with your needs. Build a pipeline that catches problems early without overburdening small teams.

Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

The ASP .NET Core in-memory test server is awesome. Are you using it to write your tests? You can spin up an application instance for running tests. Then write awesome integration tests with Testcontainers. Create a custom web app factory: - Create and configure a

The ASP .NET Core in-memory test server is awesome.

Are you using it to write your tests?

You can spin up an application instance for running tests.

Then write awesome integration tests with Testcontainers.

Create a custom web app factory:

- Create and configure a
Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

What's a Cron job, and how can you configure one? Let me explain. Cron is a tool for scheduling future tasks on Unix-like systems. But I've also seen the term used for recurring jobs in general. The essence of cron jobs is an expression defining the schedule. Here's an

What's a Cron job, and how can you configure one?

Let me explain.

Cron is a tool for scheduling future tasks on Unix-like systems.

But I've also seen the term used for recurring jobs in general.

The essence of cron jobs is an expression defining the schedule.

Here's an
Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

If you are using distributed messaging, stop treating it like direct calls. Do these 5 things: - Plan for multiple delivery - Make handlers idempotent - Use correlation IDs - Set up retry queues - Keep messages simple Messaging is meant to be reliable, not brittle.

Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

Why aren't you using Central Package Management in .NET? I remember the days when managing NuGet packages across multiple projects was a pain! You know what I mean. You open a large solution and find out every project uses a different version of the same package. Not fun!

Why aren't you using Central Package Management in .NET?

I remember the days when managing NuGet packages across multiple projects was a pain!

You know what I mean.

You open a large solution and find out every project uses a different version of the same package.

Not fun!
Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

Want to be a great software engineer? You have to know about State Machines. Here's the definition for the nerds. "A state machine is a mathematical abstraction used to design algorithms. A state machine reads a set of inputs and changes to a different state based on those

Want to be a great software engineer?

You have to know about State Machines.

Here's the definition for the nerds.

"A state machine is a mathematical abstraction used to design algorithms. A state machine reads a set of inputs and changes to a different state based on those
Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

.NET + Sentry = awesome app monitoring But how do you get started? In my new video, you'll learn: - Configure Sentry in .NET - Distributed tracing - Debug N+1 problems and fix them - Investigate exceptions across services Click here to learn more: youtu.be/U4BkIfj_CYw

.NET + Sentry = awesome app monitoring

But how do you get started?

In my new video, you'll learn:

- Configure Sentry in .NET
- Distributed tracing
- Debug N+1 problems and fix them
- Investigate exceptions across services

Click here to learn more: youtu.be/U4BkIfj_CYw
Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

Here are 4 excellent DevOps practices I use in my projects: - Infrastructure as code - Feature flags for safe releases - Canary deployments - Automated database migrations What would you add?

Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

What is HybridCache? The traditional caching options in .NET have limitations. - In-memory caching is fast but limited to one server - Distributed caching works across servers but is slower HybridCache combines both approaches. You get two-level caching (L1/L2): - L1: Fast

What is HybridCache?

The traditional caching options in .NET have limitations.

- In-memory caching is fast but limited to one server
- Distributed caching works across servers but is slower

HybridCache combines both approaches.

You get two-level caching (L1/L2):

- L1: Fast
Milan Jovanović (@mjovanovictech) 's Twitter Profile Photo

Controlling what gets exposed The key to a good software architecture. The hardest part of designing public APIs is deciding what to expose. Here's my rule of thumb: 1. Start with nothing public 2. Expose only what other modules actually need 3. Design the API around use

Controlling what gets exposed

The key to a good software architecture.

The hardest part of designing public APIs is deciding what to expose.

Here's my rule of thumb:

1. Start with nothing public

2. Expose only what other modules actually need

3. Design the API around use