Skip to content

torodebout/url-shortener

Repository files navigation

url shortener

this project was created to practice the url shortener system design from system design school: https://systemdesignschool.io/problems/url-shortener/solution

microservices architecture with grpc for internal communication:

  • gateway: fastify http api + static web app
  • urlgen: generates and stores short codes
  • redirect: resolves codes to original urls
  • analytics: tracks click metrics
  • cache: redis
  • db: dynamodb

quickstart (docker only)

pnpm install
make up

then try it:

handy make targets:

  • make logs -> follow logs for all services
  • make tail S=gateway -> logs for a single service
  • make ps -> status
  • make restart -> rebuild and restart
  • make down -> stop and remove containers + volumes

microservices implementation

completed

  • service separation - each service runs in its own container
  • grpc communication - services communicate via grpc instead of direct calls
  • single responsibility - each service has focused purpose
  • independent deployment - services build/deploy separately via docker

improvements for true microservices

  • database per service - split shared redis/dynamodb per service ownership
  • remove shared business logic - move data access into each service
  • proper data ownership - analytics shouldn't directly read urls table
  • event-driven architecture - services publish/subscribe to events

About

URL shortener built with microservices architecture using Fastify, gRPC, Redis & DynamoDB - practice project for system design concepts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors