Using Multiple Database in project

Skip to first unread message

grant forrest

Oct 30, 2015, 6:57:40 PM10/30/15
to web4j-users
Hello  -  I've been playing with Web4J assessing it's suitability for a production app I'm building.

I'm intrigued as to the use of multiple databases in the fish example.

Does anybody know if this gives any performance improvements? I've never come across this design in large scale production systems before.

The complication it adds, is linking a user in the users database to data in the main database. 

What are your thoughts?



John O'Hanley

Oct 30, 2015, 8:07:43 PM10/30/15
to web4j-users
Hi Grant.

The fish example has 3 databases just to show that you aren't limited to 1. That's all.
In the fish example, the translations are off in a separate database, away from the main data. That might be appropriate in a large organization that has centralized translation facilities (for example).

For the user access control, there are two basic cases that an app may implement:
- per role (implemented with vanilla security-constraints configured in web.xml)
- per user
The fish example app is per role. The main data is not linked to users at all, so there are no joins between databases.  That being the case, I can't see any extra performance problem. The access-control database is queried by the security-constraint mechanism, before the main part of the app is exercised. (It's interesting that the access control can be separated out in this way from the main app, if desired.)

The 'predictions' example has per-user access control; it has 1 database, not 3.

grant forrest

Nov 2, 2015, 5:31:24 PM11/2/15
to web4j-users
Thanks John, 

Just wasn't sure if it was thought to be a better solution. 

Thanks for your time

Reply all
Reply to author
0 new messages