Data Service
The following diagram describes our new application organization. Both the Reports and Strava service get some work from Redis and interact with the Data Service, as shown in the following diagram:
The Data Service is an HTTP API that wraps the database containing all the users and runs data. The dashboard is the frontend that implements the HTML user interface.
Note
When you have any doubt about whether it's a good idea to split out a new microservice out of your main app, don't do it.
Some of the information required by the Celery workers can be passed through the Redis broker, such as the Strava tokens for the Strava service.
For the Reports service, however, it's not practical to send all the info through Redis because the amount of data can be significant. If a runner is doing 30 runs per month, it's simpler to let the Reports service pull them directly from the Data Service.
The Data service view needs to implement the following APIs:
- For the Strava service--a POST endpoint to...