platform icon indicating copy to clipboard operation
platform copied to clipboard

Allow using a second DJ instance as a database

Open aeberhart opened this issue 2 years ago • 2 comments

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

aeberhart avatar Oct 11 '23 08:10 aeberhart

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;
  }

aeberhart avatar Oct 11 '23 08:10 aeberhart

if possible, integrate this into the RemoteDatabase driver

  • database set - remote Data
  • database not set - remote Database

aeberhart avatar Oct 11 '23 08:10 aeberhart