winds-mobi / winds-mobi-providers

Real-time weather observations: weather data providers
https://winds.mobi
GNU Affero General Public License v3.0
8 stars 11 forks source link

Add support for PostgreSQL/PostGIS DB #27

Open pka opened 2 years ago

pka commented 2 years ago

I'd like to add an additional data provider, but since I'm from the PostgreSQL/PostGIS/TimescaleDB camp, I've added support for Postgres first. I've tested compatibility with all providers which don't require a login.

Thanks for this great project and service!

ysavary commented 2 years ago

Hi @pka,

Thank you for this PR!

You are already using postgres, and you want to use this project for your own usage (I have no problem with this as long as you respect the license) or your goal is to write a new provider for winds.mobi?

Your abstraction class for the storage is a good idea, maybe could you do a separate PR for this?

I'm not fundamentally against migrating from mongodb to PostgreSQL/PostGIS but it will require many additional tasks:

What are the benefits to migrate to PostgreSQL/PostGIS ?

pka commented 2 years ago

As a first step I only want to test the new provider on my local PG database. If I have time for it, I'd like to combine it with https://github.com/Meisterschueler/ogn-python which also uses PostGIS/TimescaleDB.

I don't want to convince you to migrate to PostgreSQL, it's just that I never worked with MongoDB before. So no plans for porting frontend and API to PG. I'm absolutely fine with reducing the PR to a DB abstraction and maintaining the PG driver in a (private) branch. Maybe we could talk about this and other ideas?