I am just thinking out loud at the moment, would it be an idea to use sqlite on Laravel aswell instead of MySql? And broadcast somekind of event or something withing a queue and check whether the clients have the same database locally and if not it will sync up? I would probably need some kind of websockets for this I guess...
Sync sqlite (offline) with mysql (online) database
Hi all,
I have a question, I am building an app for a client there is one requirement that is a MUST. And that is to be able to use the app completely offline. The app give the user the ability to fill in a form add some pictures/videos to it and save it (and store it in a sqlite db on the phone). As soon as the phone has a stable internet connection the data has to be pushed to the server (in this case to a laravel application which uses mysql as it's db).
I have looked in to firebase (firestore to be precise). And it provides exactly what I need, the down side is of using firestore. Is that I have to rebuild a part of my application and actually completely throw away what I have build in Laravel... I would rather not do that.
Furthermore there are going to be uploaded many pictures and videos, and firestore get's expensive when going this route. So I thought about uploading the pictures to a Laravel application and returning the path to this picture and storing that URL in to firestore. But than again I will be using, Laravel for storing asstes, firestore for storing data and the app (which is build in Flutter) stores it's data in sqlite.
It is a bit annoying to use so many services. So my question is, is there a possibility to not use Firestore, but keep my laravel backend as it is and tweak it a little (maybe install a package of some kind?) to be able to synchronize between the offline sqlite db and the online mysql db.
I can't believe I am the only one who encountered this issue but unfortunately I couldn't find anything on stackoverflow or google.
Thanks in advance for who is willing to think along with me to come up with a solution :)
@TaylorOtwell I don't know if this is the right place to do a request, but it would be really cool and would really boost the number of users of Laravel if something like db sync would be implemented in to the core (or a first party package) of laravel.
Please or to participate in this conversation.