openfun / mork

📧 A FastAPI application to warn and manage FUN inactive users
MIT License
0 stars 0 forks source link

[Design] Approach to delete user data accross applications #44

Open wilbrdt opened 2 hours ago

wilbrdt commented 2 hours ago

Proposal

Currently, Mork handles the identification and deletion of inactive users in edX databases. However, other FUN applications (Ashley, Joanie etc) also contain user data that needs to be deleted/anonymized. These applications can run in different namespaces. Each application should be responsible for deleting its data, but Mork should be the source that informs each application which users need to be deleted.

To do so, 3 potential architectures.

1. Message Queue architecture

Mork publishes the list of users to be deleted in a message broker (Kafka, RabbitMQ).

Not retained because:

2. Central datastore architecture

Mork stores a list of users to be deleted in a Redis, other applications read and pop those entries in the Redis.

Not retained because:

3. Central API service (in my opinion what we should do)

Mork exposes endpoints to query users that need to be deleted. Each application periodically checks and processes its own data deletion.

I think this is the best solution because:

Proposed implementation

Each application runs a daily cronjob that pull from Mork the list of users to be deleted, then confirm which users it has deleted by updating a status. Mork exposes some the following endpoints:

List users to be deleted

Update User delete status

Batch Update user deletion status

wilbrdt commented 2 hours ago

What do you think @quitterie-lcs @lunika ?