← All projects

2026

Emergency Resource Request Service

A microservices course project (CS366). My service collects disaster victims’ requests for food, water, and medicine, and works with services built by my classmates through direct API calls and SNS events.

Key points

  • Calls a classmate’s Incident Service over REST
  • Publishes events to SNS for other services
  • Elysia API on Bun, deployed on ECS
  • Idempotency keys stored in Valkey
  • Lambda dequeues from SQS and writes to the DB
  • Terraform infrastructure
  • Lambda deploys with GitHub Actions and OIDC

Overview

Emergency Resource Request Service is my part of a disaster response system built for CS366, a microservices course. Each student owned one service, and the services had to work together. Mine receives requests for help, such as food, water, and medicine, from disaster victims and front-line agencies, and turns them into structured data that rescue teams can act on.

Problem

The service couldn’t work alone. Every request belongs to an incident, but incidents are owned by a classmate’s Incident Service, so my service had to check them through someone else’s API. Other services, in turn, needed to know when a new request came in. On top of that, requests arrive over unstable networks during a disaster, so the same request can be sent many times.

Approach

My service talks to other services in two ways. When a request comes in, it calls the Incident Service directly over REST to check that the incident exists, with a 5-second timeout and a trace ID header so a request can be followed across services. If the incident is found, the request is marked as verified. It then publishes the new request as an event to Amazon SNS, so any service that cares can subscribe without my service knowing about it. My own SQS queue subscribes to that topic, and a Lambda function dequeues each message and inserts the request into PostgreSQL. To stop duplicates, state-changing calls need an idempotency key, which is checked in Valkey. The API is built with Elysia on Bun and runs on Amazon ECS. I defined the AWS infrastructure with Terraform, and GitHub Actions builds the Lambda images, pushes them to ECR, and deploys them using OIDC instead of stored keys.

Result

The service works with classmates’ services both directly and through events, and it keeps accepting new requests even when the database is slow, because writes go through the queue. Building it showed me how much harder microservices are than one application. A feature that would be a function call in a monolith becomes a network call that can time out, fail, or return something unexpected. Each service depended on another student’s API, its contract, and whether it was online, so we had to agree on request and event formats up front. Debugging meant tracing one request across several services, and testing needed the other services, or stand-ins for them, to be running.

There were real benefits too. Each student could build, deploy, and change their service on their own, in their own stack. A failure in one service stayed in that service instead of taking down the whole system. With SNS, new consumers could subscribe to events without any change to my service, and each part could scale on its own.

Learning

Microservices trade simple code for a complicated system. The hard parts are the edges between services: clear API contracts, timeouts, retries, idempotency, and tracing. I learned to design for failure at every boundary, and to choose between a direct call, when I need an answer now, and an event, when I only need to tell others that something happened.

Tech