Walk through one request path step by step, naming each component, why it exists and what you owned. A structured example (adapt to your real system): 1. Login and identity - The user opens the React (or Angular) app and clicks Sign in. The app uses the OpenID Connect Authorization Code flow with PKCE (MSAL) to redirect to Microsoft Entra ID (or Auth0, Cognito, Keycloak). - After authentication (with MFA), the app receives an ID token and an access token for our API; the library refreshes tokens silently. - Alternative: a Backend for Frontend keeps tokens server-side and issues an HttpOnly cookie. 2. Edge and gateway - Static frontend assets come from a CDN (Azure Front Door or CloudFront). - API calls go to an API gateway (Azure API Management or YARP), which validates the JWT, applies rate limiting and CORS, and routes to the correct service. 3. Backend services - ASP.NET Core services on Kubernetes or Azure Container Apps. Each validates the token again (audience and scopes), applies authorization policies, and checks resource ownership (users only see their own trips or bookings). - Example flow: GET /api/trips calls the Trips service, which queries its SQL database with EF Core projections and a Redis cache for frequently read data. - Service-to-service calls use managed identities or client credentials, with Polly timeouts, retries and circuit breakers. 4. Business transactions and events - POST /api/bookings: the Booking service validates input, reserves inventory with an atomic update, creates the booking in a transaction, and writes a BookingCreated event to the outbox. - An outbox publisher sends events to Service Bus or Kafka. The Payment, Notification and Analytics services consume them idempotently. - Multi-step workflows (booking, payment, confirmation) are coordinated by a saga with compensating actions, such as releasing seats if payment fails. 5. Data stores - Each service owns its database (Azure SQL or PostgreSQL); Redis for caching and distributed locks; Blob Storage for documents; a search index for trip search; a data warehouse for reporting. 6. Background processing - Workers and Azure Functions handle emails, report generation, reconciliation and clean-up jobs. 7. Observability and security - OpenTelemetry tracing across the gateway, services and message consumers with one trace ID; centralised logs and dashboards; alerts on SLOs. - Secrets in Key Vault, network isolation with private endpoints, WAF at the edge. 8. Deployment - CI/CD pipelines build and test each service, push images to a registry, and deploy with rolling or blue-green strategies; infrastructure as code with Bicep or Terraform. 9. Your responsibility and a trade-off "I was responsible for the booking and payment services and the event-driven integration. One trade-off we made was eventual consistency for booking confirmations, handled with a 'processing' state in the UI."
Ravindra Wadile · · 0 likes