ropensci / fishbaseapi

Fishbase API
https://fishbaseapi.readme.io/
MIT License
42 stars 12 forks source link

version database #104

Closed sckott closed 5 years ago

sckott commented 7 years ago

Then provide parameter to query based on a certain date for reproducible results

@cboettig worth trying? we sometimes talk about this, but DBs seem to never be versioned, but we can try with this

cboettig commented 7 years ago

Good idea. We could at least emulate this by keeping each snapshot we get from them online at a versioned endpoint in the API. Should probably work to them about following some more regular snapshot interval as well, so far I think we've just been asking for an update whenever a user complains about our version being out of date

sckott commented 7 years ago

Right, that's what I meant by versions, just snapshots - hopefully there's a formal way to swap DB versions quickly

If there's a way to get updates more often, that'd be great, but can keep going as we are if not

cboettig commented 7 years ago

I think we should import each to a separate SQL DB, and then edit the rest API to take an argument which we use to select the right database, just like we currently do to choose between fishbase and sealifebase. Does that sound workable?

sckott commented 7 years ago

Right, that sounds good to me

cboettig commented 7 years ago

Related to this, wonder if we could provide some sort of diff indicating what has changed in the FishBase database with subsequent updates.

sckott commented 7 years ago

We can certainly try

and then edit the rest API to take an argument which we use to select the right database, just like we currently do to choose between fishbase and sealifebase.

hmm, but sealifebase is requested via a path component

Wonder if we should toggle versions with a header - as the Github API does - that way if no header for version is passed the user gets the current version with latest data. Clients like rfishbase though can make the user interface look like a parameter and internally pass the appropriate header. thoughts?

There's the issue of how/where to store the different database versions. Any thoughts on that?

cboettig commented 7 years ago

Putting the version in the header seems really elegant to me, particularly if that's a common pattern for this kind of thing in APIs. (I've never been super pleased with APIs doing that through the URL).

A separate question I suppose is that it would probably be cleaner to put sealifebase on a separate subdomain on the same server rather than serving it off a separate path, but not really a priority.

sckott commented 7 years ago

A separate question I suppose is that it would probably be cleaner to put sealifebase on a separate subdomain

Agree, that would be nice, and if we do any other APIs we could just add new subdomains for those

sckott commented 7 years ago

Working on this now - will push up a new branch soon, getting database version loaded on server cc @cboettig

sckott commented 6 years ago

@cboettig this is live now, let me know if you find any problems