0

I have a set of complex data, which I use on various subdomains of my project. Data are static most of the time, it changes few times per year.

Currently, it's hardcoded in every project which needs it, but I am looking for a way how to make one "source of truth".

Of course, I can build another api.example.com service to provide those data, but I want to ask. Are there any drawbacks of using public repository on GitHub and accessing them via https://raw.githubusercontent.com/.../.../my_data.json? I already saw some project provide (for example geo) data like this.

Data are fully public and of course I will do some kind of caching on consumer side, but am I missing something why this is not a good approach?

3 Answers 3

2

Using a repo probably violates their terms of service and in any case would be fragile. They have GitHub Pages, which is probably going to be free at your scale. I would suggest looking into that or some other free hosting service.

Not an advertisement, not even a happy user.

0

In general it's not a good idea to use something in a way that falls outside its stated purpose.

If you do you run the risk of changes to the product breaking your system, or your system outgrowing the products provided features.

There are some additional considerations. You add an off site dependency, security etc but this is the main reason for me.

2
  • 1
    Can I counter this with a YAGNI? In the unlikely event that GitHub changes its API, you can then replace it with something else.
    – Bossie
    Commented Feb 24, 2023 at 12:55
  • 1
    no. YAGNI is just excuse making. You can do a full risk assessment and accept the risk of your app going down randomly for an unknown amount of time until you can develop an alternative, Or getting sued because of some small print on the licence conditions though.
    – Ewan
    Commented Feb 24, 2023 at 17:29
0

In my opinion, it is not good to use a GitHub repository as an API. GitHub API is not designed to be a scalable or reliable way to provide API functionality. Instead, dedicated API platforms or frameworks should be used to create and manage APIs.

There are several API platforms that you can use instead of using a GitHub repository as an API, including Amazon API Gateway or Microsoft Azure API. For example, here is an example of using Microsoft Azure API for ERP system development.

Not the answer you're looking for? Browse other questions tagged or ask your own question.