Datastore cleaner

Diagram for Datastore cleaner system

Because the best data is the data you do not keep, I wanted to periodically clean up old entries from the database of cadeaux-entre-nous.fr. The data is store in Google Cloud Datastore, so I built a tool to automatically clean up old Google Cloud Datastore entities.

I built a serverless microservice that deletes Cloud Datastore entities that are older than a certain age (at year by default), to be run as a cron job every day (using Cloud Scheduler)
It uses a Cloud Run microservice that is privately invoked every day by a Cloud Scheduler job. When invoked, it queries your Cloud Datastore for entities that are older than a year and deletes them. The entity name and attribute containing the date must be provided as parameters. The number of entities and the time period can be customized.

Get it on GitHub at github.com/steren/datastore-cleaner