This is a special version used for database performance testing. There are added and removed features, endpoints and dependencies. Changes:
- Most of the logging was removed
- Query retrying was removed
- Prometheus' metrics are no longer exposed
- Added generate load endpoints. Option to set number of worker threads and connections.
- Tracks time of requests.
This is currently in alpha state so there are not many features completed and the ones that are finished aren't tested properly.
Database/feature | Postgres | Mongo | Mysql | Oracle | SqlServer | Db2 |
---|---|---|---|---|---|---|
Create table | X | X | X | |||
Insert | X | X | X | |||
Upsert and alter/create table | X | X | X | |||
Delete | ||||||
Drop table | X | X | X | |||
Reset Database | X | X | X |
The Json schema is DatabaseEntry
class from the DMT-schema project.
{
"name": "pepici",
"primary": "name",
"columnEntries": [
{
"columnName": "name",
"dataType": "VarChar(255)",
"value": "PepaZDepa5"
},
{
"columnName": "age",
"dataType": "Integer",
"value": "30"
},
{
"columnName": "money",
"dataType": "Double",
"value": "15.5"
}
]
}
It is imperative to use the primary key so that the created tables can have primary key and can be correctly updated. Primary keys must always be unique and once set cannot be changed. Therefore, I recommend using GUID or other system that ensures these properties.
When Creating tables, the columnEntries
value determines the columns and their types.
You can reset all databases on DMT start with property onstart.reset.database
.
POST
/Main/Insert
(Inserts json into all enabled databases)
POST
/Main/CreateTable
(Creates table/collection in every enabled database)
POST
/Main/CreateTableAndUpsert
(Upserts json into all databases and creates tables if they did not exist or adds columns so the json can be upserted)
DELETE
/Main/DropTable
(Drops table/collection in every enabled database)
GET
/Main/ResetDatabase
(Drops all databases/schemas and creates them again)
POST
/Main/TimedInsert
(Inserts json into all enabled dbs and returns timestamp of query execution)
GET
/Utility/GetAll
(Gets all created tables and their current state)
POST
/Utility/TestSchema
(Test if the input json schema is correct)
POST
/Main/GenerateLoad?count={count}&maxRows={maxRows}
(Creates set number of queries with maximum table size and upserts them into databases. Returns the time length of the whole request and just the execution of the queries)
POST
/Main/GenerateBatchLoad?count={count}&maxRows={maxRows}
(Same as GenerateLoad but uses batch statements for better performance)
You can run your application in dev mode that enables live coding using:
./mvnw compile quarkus:dev
NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
The application can be packaged using:
./mvnw package
It produces the quarkus-run.jar
file in the target/quarkus-app/
directory.
Be aware that it’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/
directory.
The application is now runnable using java -jar target/quarkus-app/quarkus-run.jar
.
If you want to build an über-jar, execute the following command:
./mvnw package -Dquarkus.package.type=uber-jar
The application, packaged as an über-jar, is now runnable using java -jar target/*-runner.jar
.
You can create a native executable using:
./mvnw package -Pnative
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
./mvnw package -Pnative -Dquarkus.native.container-build=true
You can then execute your native executable with: ./target/database-manipulation-tool-1.0-SNAPSHOT-runner
If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.
Easily start your Reactive RESTful Web Services