B4J Question Local vs Remote DB - Need advice

Cableguy

Expert
Licensed User
Longtime User
Hi guys,

I have a very minimal experience with Database and Remote Database. Yet, I do see the need for such and I am starting a project were I need to give the user the ability to either point to a local path (being it the same computer the app is running on or a local network computer) or to an online domain path(?) to set and save the DataBase...

What info do I need for such cases? what should I prompt the user for?

Any insight would be welcome
 

Cableguy

Expert
Licensed User
Longtime User
Hi Erel, Thanks for the reply...
but my question is more focused on how to present this option to the user.... like, in a Dialog, what info do I need to gather?
 
Upvote 0

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Remote dB will make your app feel slow, it will always add some seconds between user click and information showing. Security is also a concern.

The reason to use a single remote db is that it will be more maintainable and better debugging.

My suggestion? If security is a concern, use remote db with a middleware such as jrdc2

Http protocol is faster on long distances with more data
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
I'm guessing for the local DB instead of ip address I gather the path?

local db... you target at: localhost or 127.0.0.1 (mysql, mariadb, ms)
so for them is more complicated the backup (future step)

gather path only for sqlite,mdb... those types
(for these backup is just a copy)
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Hi Erel, Thanks for the reply...
but my question is more focused on how to present this option to the user.... like, in a Dialog, what info do I need to gather?

in a settings page you can give the use 2 choices. local sqlite db or remote connection.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Remote dB will make your app feel slow, it will always add some seconds between user click and information showing. Security is also a concern.

The reason to use a single remote db is that it will be more maintainable and better debugging.

My suggestion? If security is a concern, use remote db with a middleware such as jrdc2

Http protocol is faster on long distances with more data

Http protocol may be is not faster from direct (because is a middleware) - but for sure is safer and sure (sure that you will know the record got at the place) !
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Use jrdc2. Haven't tried using localhost on the client but localhost works fine in jrdc2 if the jrdc2 is on the same computer as the DB but don't forget it must be a fixed IP if you use the IP Addr. Otherwise the connection may be lost on reboot.

I present the user with a dialog to type the ip addr. It starts out looking like this: "192.168.?.?".
For the port I have 10 ports in the jrdc2 config file, one of which I unrem to use. The client gets a dropdown list of those 10 ports, there is also a button to try them all. This way all the user really has to know is the ip addr.

Now all of this is, for us always running on a LAN. Never internet which I have yet to try. Over a LANI have found speed is just not an issue.

If you have multiple user on the same DB, as we do, the other thing I did is add QR code get/set buttons so a new user can download the app, point his device at the QR code from an already connected device, and bang, he is in.
 
Upvote 0
Top