Skip to content
Advertisement

It is possible to use git as sql database [closed]

I know it’s not logical question,but if git is best solution for code save and work around with team and its use for many things.

So why not its use like sql database.
Or just store small amount of mobile data like firebase uses.

Because as I read this article
https://www.google.com/amp/s/www3.dbmaestro.com/blog/using-git-for-database-why-and-how%3fhs_amp=true
I am little bit confused,why git not focused on use its self modifying itself as SQL database or like server storage like firebase and AWS.

Again I ask,its not possible now,but I just ask,because I am so curious about this why it’s not possible .

Advertisement

Answer

First of all, git has no interpreter for SQL language, so it wouldn’t be an SQL database. But why can’t it be a NoSQL database?

Because there are already other implementations of databases that solve the needs of a database much better than Git can.

Git as a NoSql database is a pretty thorough blog post describing the possibility of using Git as a NoSQL database. It has a lot of drawbacks, including but not limited to:

  • Merge conflicts occur. Sometimes these require human intervention.
    That would basically cause the database to halt until someone could
    clean it up.

  • Queries and updates can only search by key. There’s no concept of
    indexing by some other attribute, and there’s no concept of
    set-oriented queries like in SQL.

  • Write performance sucks because every commit goes to disk.

  • Updating
    data create copies. This causes storage requirements to increase
    rapidly, until git gc consolidates space.

You can also ask why can’t a screwdriver be used as a hammer? Maybe you could tap nails in very slowly and carefully, but it would make a lousy hammer compared to, you know, a hammer. It’s clear the screwdriver is designed for a different purpose.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement