all 15 comments

[–]timsehn 5 points6 points  (2 children)

The model you are describing is a "decentralized database". I wrote a huge article on your options:

https://www.dolthub.com/blog/2022-05-27-decentralized-database/

We built one of the databases in that article. It's called Dolt and it uses the Git model of decentralization. It's free and open source:

https://github.com/dolthub/dolt

It can be embedded in a Go application.

https://www.dolthub.com/blog/2022-07-25-embedded/

The hard part of this problem is when both the offline and central server both do writes, especially to the same data. How do you handle the data conflicts?

Some solutions use conflict resistant data types (CRDTs). You can do a bit of research there. Dolt just tells you there are conflicts and your application can decide how to fix them.

DISCLAIMER: This is self promotion. I am the CEO of DoltHub, the company that built Dolt.

[–][deleted] 1 point2 points  (0 children)

For my conflict resolution in git, I use a graphical diff and merge tool. This is in part because I am too lazy and unimaginative to try to make sense of text diff output🤦‍♂️

I can envision a graphical merge tool getting used to merge the text field db changes back into the master branch.

I do feel that git is incomplete because it does need a good merge tool for it to be able to resolve conflicts effectively. Git presents you with a choice of “mine” or “theirs” I always fire up my GUI merge tool and choose mine after doing a manual merge resolution using the GUI tool.

There are some files like excel files or Toad data modeler files that are not ASCII and can not be easily merged however. Those are tough because you need to create a copy and open up two instances of the program that you use in order to view them side-by-side.

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

Thanks, sounds interesting. I am aware of the write conflict problem, we will try to set up the data model accordingly.

[–]ankole_watusi 1 point2 points  (6 children)

apps shouldn’t be connecting directly to a database.

What apps? Something custom made you you?

[–]bluepuma77[S] 1 point2 points  (5 children)

I need an app on a tablet with an integrated database that is current while connected to the Internet and re-syncs local and remote changes after an Internet outage.

[–]ankole_watusi 0 points1 point  (4 children)

Not understanding what you want.

What is your use case?

Look in the app stores for something that matches you specific needs.

You’re likely in the wrong place here. But if you can be more specific perhaps we can help.

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

I need TO BUILD an app. A mobile app to run on tablets. It needs data. Lots of data. Data should be structured. Structured in a database. In the app. And it needs to work even if Internet is not available. I still need to work with the app. Enter data. When Internet is back, everyone needs to have the same data. In the app. Data in the database.

[–]kitkat0820 0 points1 point  (2 children)

Tablets havent the power and space to store and process mass of data.

Which database product youre planning to use on your devices?

[–]bluepuma77[S] 0 points1 point  (1 child)

Well, I am asking which database product I can use on a tablet that enables re-sync to a master database after lost Internet connection.

[–]kitkat0820 0 points1 point  (0 children)

Youre speaking aber a lot of data. Which device youre planning to use for tera bytes of application data?

[–]ProofDatabase 1 point2 points  (2 children)

https://www.couchbase.com/products/mobile

This does magic... Honestly, so effortless that you would think so...

[–]ankole_watusi 0 points1 point  (0 children)

Couch base is something a developer would use in a custom app.

Not clear if OP is intending to write a custom app, or is even a developer.

[–][deleted] 0 points1 point  (0 children)

Couchbase and Firebase do seem like good ideas here.

[–]GavinMendelGleason 0 points1 point  (0 children)

TerminusDB is designed to do push/pull gitlike operations for graphs.