B4J Question Call for hints: multiuser approach

udg

Expert
Licensed User
Longtime User
Hi all,

I'd like to hear from you about your considerations on how to "design" a multi-user B4J software given a few constraints.
The sw will run exclusively on a LAN. Portable devices will sync to the common DB while on the same LAN (most customers won't be able to install a VPN, so the LAN constraint). A powerful enough PC (having a fixed IP) will play the server role.

Currently I have a working single-user sw based on Sqlite which ease deployment (I mean, the user simply copy my jar file to a dir and run it; that will build the DB and all its tables).
In a recent past I ported a similar project to b4j+Mysql so I'm inclined to follow the same path. But I'm worried about the ability of any customer to install and activate MySql on a "server" PC on the LAN and how well multiple copies of the same sw will cope with record locking and concurrent access/update of data.

Another option could be to deploy a middle-layer in the form of a no-UI b4j server app that is the sole accessing the DB (which could be again Sqlite) while listening for commands and serving responses to all the client copies of the sw.

Edit: a possible webapp is not listed here because that would involve a major rewrite of the existing sw.

What do you foresee as pros and cons of the above designs and what did you use on real-world deployments?

TIA

udg
 

udg

Expert
Licensed User
Longtime User
Hi @Erel,

so you advice in favor of the middle-layer option? As I wrote, it will be a non-UI deployment, so it seems to me you're confirming my design plan.
Please correct me if I understood it wrong.

Meanwhile I'll follow the link you suggested for a general overview. Thank you.
 
Last edited:
Upvote 0

udg

Expert
Licensed User
Longtime User
Ahh, ok. Now I see your point.
My original idea was to expose in a mid-layer b4j server app some high-level functions which a few pc clients will call in order to read/update data, leaving to client sw the role to interact with the user through simplified forms (with some validation for data before submitting to the "server").
I mean something like:
command 1: give me the list of Nations' prefixes
command 2. add a Nation
command 3: add population, prefix and flag for Nation with id = IDNation

It will the mid-layer responsibility to interact with Sqlite DB to read/insert/update data and to communicate with active clients when needed.

Currently I have a working "client" sw which uses its local Sqlite, so the only change would be to move higher-lever functions to the yet-to-be designed mid-layer and add some code to work with it (this looks promising).

But your approach sounds even simpler. Each client connects to the Jserver which in turn reads/writes to the DB. Next week I'll be on vacation so I should have enough time to test the alternatives.

What i forgot to clearly mention is that my question relates to a classic client-server on LAN deploy, with less than 10 clients. My main concern was about the ability for a customer to install/configure MySql. That made me favor the SQlite option.

Thanks for your comments and any further hint you may feel useful.

Edit: today I found your excellent summary on communication options.

udg
 
Last edited:
Upvote 0

Harris

Expert
Licensed User
Longtime User
USBWebserver (http://www.usbwebserver.net/en/) is what I use for my development.
You essentially get a WAMP in a small, useful (next to zero deploy) package.
When you have it configured with tour populated DB, zip it up and distribute it. It's great to deploy for small projects as you describe.

Now you have the power of MySQL (connection pools and the like) in an industrial DB.
I use RDC to put stuff in and get stuff out. I also use HTTP to up and download files when required (much like you app update)

Now, with ABMaterial (and B4J), you get a modern server webapp that will run on a local lan, or a VPS - in any web browser - on any device.
Typing the url in the address bar is all the config required by your users (and saving the bookmark).

Create a batch file to start the wamp and jar file on boot of the server (eg. desktop PC would be plenty) and away you go...

Oh, did I mention that this method gives you a modern webapp easily deployed in a lan or VPS?

My 2 pesos...

Thanks
 
  • Like
Reactions: udg
Upvote 0
Top