For our school project we created a testing programs and a data to populate testing databases. I thought that would be helpful to you as well. I created a little description about the testing we were doing in the following phrases.
Here our main target was to test the performance of different queries of application level multi-tenancy.
There are 3 different application level multi-tenant approaches
1. Shared Machine - in this approach each tenant has a dedicated database
2. Shared Process - in this approach each tenant share the same database but have different schema.
3. Shared Table - in this approach all tenants share the same database and same
Here we tested Apache Derby for first two approaches.
To the testing part we create one bash script program to create and populate database structures and two programs to do the tests.
In the first program we test Shared Machine approach 1-10 tenants with 1000/10000 users in which we use java threads as tenants.
In the first program we test Shared Process approach 1-10 tenants with 1000/10000 users in which we use java threads as tenants.
I will come up with the results once they are finalize and Here I am attaching the programs we used if you are interested.
Instructions for use:
First you need to create the databases (to create a real scenario we use a Airline reservation system as our database schema which can be found at http://www.databaseanswers.org/data_models/airline_reservations/index.htm
). This can be done using run the bash scripts(every tenant populating folder has a CreateAndPopulate.sh). In this bash script it need to set DERBY_HOME. After running the script it will use the Derby ij too to create and populate databases.
Then you need to put all the database created by the ij tool into a one folder and start the Derby network server there or specify the database places to that folder.
Now it's ready to do the tests.
In the client program you can specify,
number of tenants(currently we created the databases for max-10 tenants for SharedMachine approach and 4-tenants for SharedProcess Approach). You can specify more tenants if you like using the existing data.
number of users per tenant
sql query which need to test. In shared process approach every table name must be prefix by ' schema"+id+" ' which specify the tenant.
Output: This will output the time taken to run the query for each tenant(with 1000 or 10000 users) in milliseconds.
If you have any problem with this please feel free to ask any question.