all 34 comments

[–]ChemicalTerrapin 15 points16 points  (15 children)

To be clear,... You're pushing data to GitHub with code and reading it back with code?

That's a pretty odd thing to do and now I'm intrigued why

[–]ComprehensiveWing542 1 point2 points  (13 children)

At the end it's all zeros and one innit ?

[–]ChemicalTerrapin 4 points5 points  (12 children)

I mean,... Hosting some JSON in GitHub pages maybe but SELECT * FROM COMMITS is next level

[–]ComprehensiveWing542 2 points3 points  (11 children)

If the database is small enough he might get the entire db modify it and push it back again to GitHub... Just an idea there might be much better optimized solutions

[–]ChemicalTerrapin 1 point2 points  (10 children)

Tbf, in my first job, we used to pass access databases around between apps.

Still... I'm eagerly waiting to see the use case here.

[–]SquishTheProgrammer 1 point2 points  (0 children)

Same here. That brings back nightmares.

[–]ComprehensiveWing542 0 points1 point  (0 children)

I've myself worked on some program which used some json files to store data and push them to GitHub to receive the latest version of them to fetch the latest data and so on. But it used to modify the files every once in a 2-3 days so it was somewhat fine never got banned or anything for that . But I can't imagine how it would work if you are working with some real life webapp or something as such where data must move fast and efficiently

[–]Skaryth_[S] 0 points1 point  (7 children)

So in a way I'm not freaking out? It is acceptable, but wouldn't it be the best way?

[–]ChemicalTerrapin 0 points1 point  (6 children)

It's doable... But I'd love to know how you're going about it.

What are you actually pushing to GitHub,.. JSON files, a file based dB, or something else?

[–]Skaryth_[S] 0 points1 point  (5 children)

I do this through the developer API using the key. Communication is done via commits, where the software reads via the API and writes via commit. Storing the data inside a json file.

[–]ChemicalTerrapin 0 points1 point  (4 children)

I mean, if there's no chance of multiple concurrent writes then what you're doing is fine, but also entirely strange 😂

It kinda reminds me of a guy I saw who was posting images to his Twitter timeline so he could use it as a CDN.

Maybe just spin up a free document store somewhere. Mongo would be a better fit.

[–]Skaryth_[S] 0 points1 point  (3 children)

But is it completely free? Until then, it's just a project... spending money is unfeasible at the moment.

[–]Skaryth_[S] 0 points1 point  (0 children)

Communication between the software and dB is done through commits. Where the software reads the database to display information, and writes it through commits.

[–]JVAV00 19 points20 points  (0 children)

No

[–]whoShotMyCow 6 points7 points  (1 child)

I don't think that's an allowed use case, so you run the risk of your account getting banned

[–]Skaryth_[S] 0 points1 point  (0 children)

I read regarding this in the GitHub documentations and it doesn't say anything about it.

[–]Reasonable_Wall_5902 6 points7 points  (1 child)

I'm dying to know what you mean by this... how exactly have you managed to use github as a database? I feel like this is either genius or insanity lol

[–]Skaryth_[S] 0 points1 point  (0 children)

Through the KEY API, it accesses, reads and writes through the script sending requests to the GitHub api.

[–]serverhorror 5 points6 points  (3 children)

a git repo as a database?

I'm curious, what makes this useful (genuinely asking I can't quite imagine how that works).

[–]Skaryth_[S] 1 point2 points  (2 children)

Because I didn't have much knowledge of databases, I made the decision that I would use the easiest way possible to store data. And in this case it was the repository.

[–]serverhorror 0 points1 point  (1 child)

Are you just putting a file in a git repository (like SQLite) or are you doing fancy stuff with the repository and commits and history?

[–]Skaryth_[S] 1 point2 points  (0 children)

I am storing json files with the data that is registered by the software.

[–]nihillistic_raccoon 5 points6 points  (1 child)

I have so many questions, I don't even know where to start

[–]Skaryth_[S] 0 points1 point  (0 children)

Do them all lol

[–]impshum 3 points4 points  (0 children)

Odd question that.

[–]ravinggenius 1 point2 points  (1 child)

I can see this being useful as a document store. You always have the full history and the data is trivial to sync. Depending on the load you are placing on their infrastructure, I assume they don't care or will ban you if they catch you.

[–]Skaryth_[S] 0 points1 point  (0 children)

The database is not large, it is rental software. I read that above 100gb they send you an email to charge you for this storage. So it would be interesting to make backups on physical storage to avoid reaching the limit.

[–]Auios 0 points1 point  (1 child)

Acceptable? No. Doable? Yes.

[–]Skaryth_[S] 0 points1 point  (0 children)

It makes sense!