platform
platform copied to clipboard
Allow using a second DJ instance as a database
We have three ways of interacting with remote systems:
Setting a relationship that points to another system
- this requires a small change in the display link logic
- we'll omit these for incoming links due to the performance impact
Using a RemoteDatabase
- this allows writing a database adapter in another container / possibly using another language
- configuration is done via container parameters
Using another DJ as a Database
- similar to the solution above
- attached system has its own ACL and user management
- access is done via the data interface
- sub system must be configured via UI / App
implementation notes
- we need to replace the database and query metadata
- the configuration requires hostname, database, user and pwd
@Override
public Map<String, Object> connectAndCollectMetadata() throws Exception {
Map<String, Object> res =
(Map<String, Object>) call("crud/config/dj-database/" + e("dj/" + this.database), null);
res = (Map<String, Object>) res.get("tables");
for (Entry<String, Object> entry : res.entrySet()) {
Map<String, Object> table = (Map<String, Object>) entry.getValue();
table.put("parent", ID);
table.put("ID", ID + "/" + e(entry.getKey()));
// TODO: change props also
}
System.out.println(res);
return res;
}
if possible, integrate this into the RemoteDatabase driver
- database set - remote Data
- database not set - remote Database