Skip to content

johnsharp97/explore-service

Repository files navigation

Explore Service

Overview

This is a backend explore service that allows users to explore and match with other users.

Prerequisites

  • Go
  • Docker
  • Make

Getting Started

To run the service:

make server

This command spins up the service in a Docker container along with the database.

To run the client:

make client-service

This command runs the client that sends requests to the service.

To run the unit tests:

make test

This command runs all the unit tests for the project.

Scalability considerations

  1. As mentioned in the requirements some users have made hundreds of thousands of decisions. I have added an index on the decisions table so that we can improve the read performance, when querying the decisions of a specific user. I have also included the updated_at timestamp on the index. This is because if the user has been on the platform for a long time we might want to just fetch recent decisions.
  2. Decided to add a like_counts table to store the number of likes for a user. Rather than querying the decisions table. We can just query a single record from this table. (Increases processing done on write)

Future Improvements if I were to take this project further

  1. Increase unit test coverage, I haven't covered all the functions.
  2. Add an integration test suite
  3. Add Read and Write replicas for the database, helps with read scaling. (would need to consider replica lag)
  4. Add infrasructure as code, to define what compute resources would be needed to deploy this service
  5. Add authentication and authorization
  6. Store environment variables in a secret manager rather than in the codebase.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published