In a load test it turned out that database access was very slow and took many resources with the use of UUID in String format, used as index.
Example:
String fileId = FileUtils.generateUUID();
String actionsSql = "INSERT INTO actions (id,file_id, action) VALUES (?,?, ?)";
try (PreparedStatement actionsStmt = conn.prepareStatement(actionsSql)) {
actionsStmt.setString(1, FileUtils.generateUUID());
actionsStmt.setString(2, fileId);
actionsStmt.setString(3, Actions.START);
}
Calling a method ending with UUID and setting it as String on a statement is a violation.
It should be:
UUID fileId = FileUtils.generateUUID();
[...]
actionsStmt.setObject(1, FileUtils.generateUUID());
actionsStmt.setObject(2, fileId);
In a load test it turned out that database access was very slow and took many resources with the use of UUID in String format, used as index.
Example:
Calling a method ending with UUID and setting it as String on a statement is a violation.
It should be: