Heigvd / Wegas

A Web Game Authoring System coded in Java and Javascript for rapid development of serious games without programming skills.
https://wegas.albasim.ch
MIT License
28 stars 15 forks source link

File storage backend update (MongoDB 4.4 EOL) #1950

Open xgo-work opened 3 months ago

xgo-work commented 3 months ago

File storage using Jackrabbit Oak implementation of JCR uses a MongoDB as backend storage.

Currently used https://jackrabbit.apache.org/oak/docs/nodestore/document/mongo-document-store.html

xgo-work commented 3 months ago

A possibility would be to use the RDB implementation https://jackrabbit.apache.org/oak/docs/nodestore/document/rdb-document-store.html Which supports many relation databases and has been tested with PSQL

This would harmonize the infrastructure having only postgres instances for the data.

The current implementation initiates the connection this way

DocumentNodeStore nodeStore = newMongoDocumentNodeStoreBuilder()
        .setLeaseCheckMode(LeaseCheckMode.DISABLED)
        .setMongoDB("mongodb://" + hostPort + "/?readConcernLevel=majority", dbName, 0)
        .build();

The new one would be very similar

DocumentNodeStore nodeStore = newRDBDocumentNodeStoreBuilder()
        .setLeaseCheckMode(LeaseCheckMode.DISABLED)
        .setRDBConnection(/* TODO figure out DataSource*/);// connexion info to DB
        .build();

Would be worth giving a try

xgo-work commented 3 months ago

DataSource might be obtained through PGSimpleDataSource in the psql package