DEV Community

Cover image for Turning Git into an application database

Turning Git into an application database

Peter Ruttkay-Nedecký on December 28, 2019

Today when you are creating an application, you have many options for a database to choose from. What you might not realize is that you could consi...
Collapse
 
thepeoplesbourgeois profile image
Josh

This is a really innovative use case for Git, and it's great that it fits your application's specific data requirements! For the reasons you mentioned (and a few others I can think of), I feel like I'd hesitate to tell anyone on my team that we should consider using this in our application, but nothing interesting is ever created without someone being brave enough to think outside the box 👏😁

Collapse
 
pruttned profile image
Peter Ruttkay-Nedecký

Thanks. Yeah, it was sort of a crazy experiment 😊

Collapse
 
thepeoplesbourgeois profile image
Josh

Crazy experiments are the best kind of experiments 🙌

Collapse
 
misobelica profile image
Mišo

You might be interested exploring Dolt what is basically git for data with built-in SQL engine. It's kind of SQL DB with the benefits of the git like history, branches, ...

Collapse
 
pruttned profile image
Peter Ruttkay-Nedecký

Thanks for the hint

Collapse
 
omerxx profile image
Omer Hamerman

Cool idea! Was going to ask about performance and handling async actions but then I read the last paragraph:)
I wonder if this would actually suit another use case other than small hacking projects...
Another thought: you’d probably want to think about encryption at rest.
And a last one: you never keep an open connection like with a standard data store which means that in the slightest scale / network load on your git provider data could get lost or conflicts may occure when you sync.
Thought provoking stuff! Cool work !

Collapse
 
pruttned profile image
Peter Ruttkay-Nedecký

Thx.
Data is stored in text files, so it would be possible to use ordinary fs protection like BitLocker or EFS (at least on Windows) for encryption. Of course, you have to trust your GIT provider (Github/Bitbucket). Otherwise, it should be possible to use things like git-crypt, but I never tried it out.
Regarding losing data, I`m not entirely sure what you mean because I never encountered a problem, where I would lose data during git push. Well.. few times it happened, that auto-merge in Git made wrong decisions – usually in case of CSS files, but that is easily solvable thanks to full history.

Collapse
 
sominemo profile image
Sominemo

Whoah, that's a great idea! I think we can extend it

Collapse
 
stevetaylor profile image
Steve Taylor

This is what CouchDB/PouchDB is for.

Collapse
 
hkgx profile image
Hubert

no, this is what Git is for. don't underestimate our powerful version control tool