A production-minded, memory-optimized ASP.NET Core Web API that simulates telemetry ingestion from IoT devices. This project showcases advanced backend design patterns, low-level memory awareness (stack vs heap), and a clean layered architecture ideal for high-performance, energy-constrained environments like IoT. Perfectly suited for portfolio demonstration and technical interviews.
-
Brushup on ASP.NET Core and design concepts – Layered architecture, service abstraction, and clean dependency injection
-
Highlight IoT-relevant patterns – Struct-based DTOs, batching, lightweight validation, GC avoidance
-
Implement a memory-conscious design – Stack vs heap, async I/O, and efficient EF Core usage. Profiling heap vs stack usage for educational insights (BenchmarkDotNet Integration).
This project implements a robust 4-layer architecture to ensure separation of concerns, scalability, and maintainability:
| Layer | Folder | Responsibility |
|---|---|---|
| Presentation Layer | Controllers/ |
Exposes REST API endpoints, handles HTTP logic |
| Business Logic Layer | Services/ |
Central logic (e.g., CRC validation, data transformation) |
| Data Access Layer | Repositories/ |
EF Core queries, stored procedure calls, batch operations |
| Database Layer | Data/ |
SQLite schema, migrations, and DbContext configuration |
- ASP.NET Core Web API – Modern, cross-platform framework
- Entity Framework Core + SQLite – Lightweight, embedded relational DB
- C# 12 – Using
recordandreadonly structfor memory-sensitive DTOs (Data Transfer Objects) - Swagger/OpenAPI – For self-documenting API and manual testing
- Optional Frontend – React + Axios + Chart.js/Recharts (planned)
This app is tailored for environments where memory allocation matters:
| Technique | Benefit |
|---|---|
readonly struct for DTOs |
Uses stack memory → avoids GC overhead |
AsNoTracking() |
Reduces EF Core memory pressure during reads |
| Async/Await on EF methods | Efficient I/O, responsive threads |
| Batching and Pagination | Prevents memory spikes, improves DB performance |
| Scoped Services | Avoids memory leaks from long-lived dependencies |
| Lightweight CRC validation | Realistic low-cost check for data integrity |
(2025-06-04)
| Method | Route | Purpose |
|---|---|---|
| POST | /api/telemetry |
Submit new telemetry data with CRC validation |
| GET | /api/telemetry/{deviceId} |
Retrieve the latest readings for a device |
| DELETE | /api/telemetry/cleanup |
Batch delete old data (e.g., older than 7 days) |
🧾 Stored Procedure Integration: Use SQL Server for performance-heavy cleanup logic
🖥️ React Dashboard: Live UI with telemetry charts using Recharts or Chart.js
🔁 Real-Time Telemetry via SignalR: Push updates from backend to frontend without polling
🔐 JWT Authentication: Secure access to telemetry endpoints
🐳 Dockerization: Containerize backend and optional frontend for deployment
🔄 GitHub Actions CI/CD: Automated testing, linting, and deployment pipelines
🧪 Unit & Integration Tests: Coverage of services and controllers using xUnit or NUnit
🧠 Redis or LiteDB Caching: Optional low-memory persistent caching layer