https://github.com/yorgosbas/devicetypemetricsapi
Efficient Tracking and Management of Device Type Metrics
https://github.com/yorgosbas/devicetypemetricsapi
Last synced: about 1 year ago
JSON representation
Efficient Tracking and Management of Device Type Metrics
- Host: GitHub
- URL: https://github.com/yorgosbas/devicetypemetricsapi
- Owner: YorgosBas
- Created: 2024-01-14T09:37:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-18T21:42:37.000Z (over 2 years ago)
- Last Synced: 2024-01-18T23:16:30.461Z (over 2 years ago)
- Language: Python
- Homepage:
- Size: 350 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
The initial approach was to separate the WebAPIs into StatisticsAPI and DeviceRegistrationAPI each with their own source code, deployment, service, dockerfile, image and then I would add ingress to expose the services and netowrk policies for security with the respective secrets.
Generally each service is simple and straightforward, isolated, potentially easier to manage if the scope remains small. Each service can be scaled and maintained independently. But it would have a lot a duplicated code, especially for apis that are closely related.
For a theoritical scenario that the application would grow, by adding more endpoints or functionality, managing these could become more complex, might have overlap between them thus inefficient resource utilisation. Then we might have consistency problems across data models, business logic etc
The latest approach was to organise it into a single project that has to do eveything related to Device Type Metrics specifically. Code can be reused, offers common functionality, models can be shared, easier to maintain, to read and it is consistent. Maybe scaling would be harder, single point of failure.
We could have a service mesh like istio to use Destionation Rules, Virtual Services and Autharisation Policies for the endpoints and application level security with keycloak or other Level 7 authentication. Network Policeis would be hard to implement.
Changed the default values for postgresql chart to be accessible from specific nodes and not be available externally. Added simple pipeline to create a docker image and push it to [docker hub](https://hub.docker.com/repositories/dbnmrs). Helm chart for the application for the ease of deployment. And tried to integrate it with Keycloak. Implemented in python with fastAPI
How to use
```
curl -X POST "http://:8000/Log/auth" -H "accept: application/json" -H "Content-Type: application/json" -d '{"userKey": "testUser", "deviceType": "testDevice"}'
```