kotalco / core-api

Kotal core API
0 stars 0 forks source link

Optimize User Activity Tracking by Directly Writing to Redis from Traefik Middleware #322

Closed mohamed-abdelrhman closed 8 months ago

mohamed-abdelrhman commented 8 months ago

Issue Description

we expose HTTP endpoint

endpoints := v1.Group("endpoints")
endpoints.Post("/stats", middleware.CrossoverAPIKeyProtected, endpoint.WriteStats)

that allows the Traefik crossover middleware to write the user activity using API calls guarded by an API key. This involves high number of calls which introduce unnecessary latency and load on the core-api.

As improvements i propose to remove this HTTP endpoint and Traefik middleware should writes user activity data directly to Redis. The core-api can retrieve this activity data directly from Redis.

Proposed Changes

Objectives

Challenges

mohamed-abdelrhman commented 8 months ago

Close as not planned for now.