Real-Time Messaging Service

Angular + .NET 8 + SignalR + AWS (Event-Driven Architecture)

View Details on GitHub

Executive Summary

Symptom

Fix

UNIQUE (room_id, client_msg_id)
INSERT ... ON CONFLICT DO NOTHING RETURNING ...

Outcome

Symptom
Fix

room_seq issued by the server on save
UNIQUE (room_id, seq)

Outcome

High-Level Architecture

Angular SignalR Client SignalR Hub .NET 8 · Elastic Beanstalk Amazon SQS FIFO Queue AWS Lambda Message Processor DynamoDB Live Message Store Archive Worker Batch / TTL Export RDS Chat History Archive WebSocket History Archive

Technical Stack

Frontend

  • Angular 12
  • SignalR JavaScript Client

Backend

  • .NET 8 (ASP.NET Core)
  • SignalR Hub

AWS

  • Amazon SQS (Standard + FIFO)
  • AWS Lambda
  • DynamoDB
  • Elastic Beanstalk
  • Amazon S3 (Presigned URL)
  • CloudWatch

System Scale

Metric Value
Organizations 2 Hospitals
Users Hundreds
Daily Messages Thousands ~ Tens of thousands
Average Response Real-time
Core Features

Messaging

File Upload

Performance Optimization
Technical Decisions

Conclusion