Git Product home page Git Product logo

user-service's Introduction

user-service

Finds users living in, or currently near, a given city.

Compiling, testing and deploying

To compile the application and run the automated test suite:

mvn verify

JBehave tests require localhost port 8080. A runnable JAR is built at target/user-service-0.0.1.jar, suitable for deployment.

Running locally

To run the service locally:

mvn spring-boot:run

Example usage

curl -H "Content-Type: application/json" -H "Accept: application/json" \
  http://localhost:8080/users/living-or-currently-near/London?within-miles=60

Comments on scalability, security and high availability

  • To facilitate service autoscaling, load balancing and high availability, the runnable JAR could be deployed to AWS Elastic Beanstalk.
  • To ensure high availability and security, API requests can be rate-limited by deploying the service behind an Amazon API Gateway.
  • The API could be secured behind an Amazon Web Application Firewall to restrict access by IP address and prevent oversized API requests.
  • Service performance could be improved by caching BPDTS API responses in a local datastore such as MongoDB, assuming underlying BPDTS API responses change infrequently.
  • The service should paginate responses to avoid performance degradation due to arbitrarily large responses.
  • Similarly, a maximum within-miles parameter value should be imposed to prevent overly large responses.

Assumptions

  • The underlying BPDTS API provides the current latitude and longitude of each user, while the /city/{city}/users endpoint returns users living in the given city.
  • Automated tests assume that users are returned by the BPDTS API in a fixed order.
  • The BPDTS API is assumed to be accessible by the test suite. If this was not desired, WireMock could be used to stub the BPDTS API.

user-service's People

Contributors

hertzsprung avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.