Skip to content

Long term maintenance plan: raw-data-api & export tool #300

Description

@spwoodcock

The current setup

Data export on demand

  • Export tool is a Django backend containing:
    • Metadata for export jobs.
    • Static templates containing frontend code, that have variables injected on load.
  • The actual data export for Export tool is done by raw-data-api underneath.
  • raw-data-api doesn't store much metadata - only jobs and related info in the temporary redis queue until complete.

Note

The key distinction between Export Tool and raw-data-api, is that raw-data-api metadata is ephermeral. The data is extracted and stored, but the job history is not retained. Export tool is a platform where people make 'exports' and the metadata persists, so the user can visit their dashboard and view all of their exports over time.

HDX data exports

  • Managed via Github workflow crons.
  • Send a specific request to raw-data-api to export to HDX too.
  • raw-data-api mostly handles this.

Alternatives to raw-data-api

  • Overpass: difficult to work with & not very viable to do country-level exports (works on diffs).
  • SliceOSM: run by OSMUS, can export OSM XML only. Could be an option to handle certain use cases. Would be good to do a comparison of raw-data-api / sliceosm capabilities, but I have a hunch SliceOSM won't offer everything raw-data-api does.

The problem

  • raw-data-api also needs maintenance long term
    • infrastructure --> kubernetes
    • dependency updates
    • need to update database indexes
    • also needs new features, such as adding pcodes
  • Export Tool is starting to age. We don't want another OAM experience, where it is not maintained for years and eventually becomes too difficult to fix.
    • The backend needs a Django version upgrade. Dependencies need upgrading.
    • The code needs a cleanout, removing all the old code related to data exporting (all handled by raw-data-api now).
    • The frontend is good! But unfortunately it's in Django templates, so not transferable.
  • The HDX exports need to be handled by someone. Likely @spwoodcock. We need a good catalogue of what is running & docs for how to increase frequencies (during an 'activation') / add new exports over time.

Important

Export Tool aging is something we need to keep on top of - it needs to be addressed in 1-2yr time period - but it's not a burning high priority item right now. Still, the earlier we start addressing it in parts, the easier it will be.

Strategy

  1. First check how many people return to same export multiple times? The metadata in Export Tool serves this purpose, but do we actually need it?

    • If possible, just replace the backend of export tool entirely with raw-data-api directly?
    • This would mean we don't keep extra metadata, such as which username the export is linked to.
    • The same export also couldn't be updated (via Export Tool 'linking' capability in the db).
    • With this approach, the metadata from export tool would be deleted in time (give a banner warning for half a year).
    • However, if it's a critical feature for users, then we need another approach: upgrade and maintain the Django API.
  2. Next steps (mid-term)

    • Migrate raw-data-api --> Kubernetes
    • Possibly replace parts with SliceOSM, or other tools? Do an assessment?
  3. Long term goal: additional integrations for raw-data-api.

    • We already have export tool frontend for exports.
    • A QGIS plugin to do this would be a bonus. Should be simple as we have https://github.com/hotosm/raw-data-api-py
    • Look at options for creating exports directly in uMap?

@kshitijrajsharma I can't find my notes I took at FOSS4G 😬 I'll keep looking!
In the meantime, which repo were the github workflows / cron schedules for the HDX exports stored?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions