Slinky is a super simple url shortner written in Ruby
with the help of docker
, Postgres
, Sinatra
and Rspec
docker-compose up
It will migrate the database automatically. No need to do anything else.
docker-compose -f docker-compose.rspec.yml up
- The initial implemantaion is using a simple micro serivce architecture as illustrated below:
- However if we are going to scale the system, probably these points can be improved:
- Decoupling the
stats
service from themain
service and create a separate service forstats
- Adding a
job
service to prevent micro seconds delay of writing tostats
before retrieving urls - Adding a Router,
Sinatra
could be an option - Adding a load balancer, probably
Nginx