4 Surprising uses for GitHub as a cloud datastore

Darragh O'Riordan - Oct 13 '22 - - Dev Community

GitHub is a great place to store code. But it’s also a great place to store any data that you need backed up, versioned, accessible from anywhere and easy to use.

In this post I’ll show you some surprising uses for GitHub as a datastore like…

  • as a comments system for a website
  • as an operating system configuration management tool
  • as a datastore for personal data management
  • as a software update delivery platform <!-- end excerpt --> ## Is it a good idea to use GitHub as a datastore?

The tools I’m going to show you are all free and are built in a way to use Guthub as their primary datastore.

This is a “parasitic” use of Github and the usage could be banned in the future but they seem to be supportive of these kinds of uses as long as you don’t abuse them too much.

There are examples of accounts that have heavily used the github apis but because they provide utility to the tech community they are generally left alone.

Check out this post about how Github worked with CocoaPods when they were maxing out 5 CPUs on a server and using terabytes of Github’s data: https://github.com/CocoaPods/CocoaPods/issues/4989#issuecomment-193772935 - the Github team went out of their way to help them!

Limitations of GitHub as a datastore

One of the only limitations in using GitHub as a datastore is the file size limitation. The maximum file size is 100MB. This is fine for most use cases. But if you need to store large files you can use a service like S3 or Azure Blob Storage.

The seconds major limitation is the api request limit. On Github you’re limited to 1,000 requests per hour per repository. Personal tools are unlikely to hit this limit. But if you’re building a tool that is used by thousands of people Github may not be suitable.

Github as a comments system for a website

This blog uses utterences as a comments system. You can see it if you scroll right down to the bottom of the page (I prefer if people use twitter so I hide it).

Showing comments on my blog
Showing comments on my blog

Utterences is a free and open source comments system that uses GitHub issues as its backend. That’s right, Github issues! Quite clever use of that api and you don’t have to pay for a service like Disqus.

Showing comments on github
Showing comments on github

You can see exactly how I set utterences and github up on my Gatsby blog in this post: How to add utterences to your gatsby blog

In the time since utterences was built, Github added a community product called “Discussions” with a full api. So someone took utterences and made it work on the discussions API.

This is probably a much better api to use for comments on a blog. So if you’re thinking about using Github as a blog comments system today, use Giscus.

Get Giscus here.

Github as an operating system configuration management tool

If you’re a mac or linux user you have “dotfiles” that are used to configure how your operating system works for you. The dotfiles live in your home directory and they’re called dotfiles because they usually start with a ..

A file or folder that starts with a . is usually hidden by default in apps like Finder on Mac or ls in a terminal. This is handy because you don’t want to see all the files that are used to configure your operating system. They don’t change very often and would clutter up your view.

Use Command + Shift + . to show hidden files in Finder on Mac or ls -a on cli.

Showing hidden files
Showing hidden files

Now if all of your configuration for how the computer works, looks and feels to use are stored in files - what happens if you need to reinstall your operating system? Or if you have 2 computers and you want to sync your configuration between them? You’ll lose all your configuration and have to start from scratch.

This is where dotfiles come in. You can store your configuration in a git repository and then you can sync it between computers. You can also use it to backup your configuration and restore it if you need to reinstall your operating system.

Homeshick is a tool that uses Github as a datastore for your dotfiles. You can make a change to dotfiles on one system, commit it to Github and then homeshick will periodically check for changes and sync them to your other systems.

Showing homeshick in action
Showing homeshick in action

You can see how I configure homeshick and github in this post: Consistent modern shell tooling on MacOS and Windows WSL

Github as a datastore for personal data management

If you’re a developer and you take notes you might be interested in Obsidian - It’s like OneNote or Evernote but it’s based on markdown files. Obsidian has really nice tagging and linking between notes built in.

Showing obsidian
Showing obsidian

Obsidian has a healthy plugin ecosystem and heaps of functionality like automatic importing of kindle notes, a trello board replacement, daily journaling helpers and more.

Showing obsidian
Showing obsidian

Obsidian is available for Mac, iOS, Windows and Android. To keep your markdown notes synchronised across all of your devices you need a service. Obsidian themselves provide a paid synch-service but there is an Obsidian Git plugin that uses Github as a datastore!

You can read more details about how I configure and use Obsidian on Github in this post: Obsidian - A free personal data management system on windows, mac and mobile

Github as a software update delivery platform

I’ve recently created a tool called Local Dev Tools. The application is a toolkit for developers so they don’t have to paste things like JWTs or JSON into random websites to convert or decode them.

Local Dev Tools my first native application in maybe 10 years and expectations for applications have changed quite a bit since the last time I compiled a native app.

Customers expect automatic updates to be applied when they run the app. The infrastructure required to host and deliver updates is a lot of work!

Update functionality is provided by the app stores for android, windows and mac but if you’re in the stores then you’re limited in monetization strategies, you have to adhere to their policies and have to use their store fronts.

While I’m also deploying the apps to the various app stores, I decided to use Github as a datastore for my updates for anyone who purchases the application from Gumroad.

If you use Github actions you can create a workflow that will build your application and upload it to Github as a release. Then you can use the Github API to check for new releases and download them.

Nuts is a simple tool that monitors a Github release stream for updates and turns it into an RSS file that’s compatible with electron updater (and squirrel delivery).

Showing nuts in action
Showing nuts in action

So once you have semantic releases publishing your assets on Github you can run a nuts server and use it to deliver updates to your application.

You can get nuts at https://github.com/GitbookIO/nuts

Not surprising but worth mentioning - Github as a host for your personal website

Just in case you haven’t heard of it. Github pages is a product provided by Github that allows you to host a static website for free as an alternative to Netlify. You can use it to host a blog, a portfolio or a landing page for your business.

The benefits are a very close integration with Github and the ability to use Github actions to build and deploy your website.

Check out their product page here: https://pages.github.com/

You can deploy Gatsby sites to github pages

https://www.gatsbyjs.com/docs/how-to/previews-deploys-hosting/how-gatsby-works-with-github-pages/

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player