The Aviantes-Framework is multitenant where each tenant uses its own database. Another database is used as the system database. For example data of users, roles, modules, menus and so on is stored in this system database. It is also possible to use one of the tenant databases as system database. Of course the use of only one database for system and tenant is possible too. Further tenants can be added easily to an existing system. There exists a client module for managing the tenants. In this module new tenants can be created or existing ones can be removed without restart of the server.
All databases are set up as needed by the framework while the server starts up. XML files describe the required database schemes. For one database table this looks as follows for example:
<!-- User --> <table name="jafUser" description="User"> <column name="nNr" type="int" nullable="false" /> <column name="sUsername" type="varchar" length="32" nullable="false" /> <column name="sPassword" type="varchar" length="32" nullable="true" /> <column name="sSurname" type="varchar" length="32" nullable="true" /> <column name="sFirstname" type="varchar" length="32" nullable="true" /> <column name="sRemarks" type="varchar" length="1024" nullable="true" /> <column name="sStatus" type="char" length="1" nullable="true" /> <primaryKey name="pk_jafUser"> <column name="nNr"/> </primaryKey> </table>
If it is necessary to adjust the database structure for a program update, the developer will simply change the XML files accordingly. The database will be updated automatically next time the server starts up after deploying the changed application. This ensures that the application can always depends on the desired state of the database structure.
Each server module owns an object which easily allows executing database requests. The server uses a connection pool which provides database connections to all server threads and in this way also indirectly to all clients. Of course it is also possible to use persistence frameworks for the object-relational mapping (storage of Java objects in the database).