User-ID Models
In developing Spring Boot applications, deciding on the type of ID model for the user entity is crucial. The ID model determines how a user entity is uniquely identified in the system, and it can significantly impact the system’s scalability, performance, and complexity.
In this configuration, there are three options available for the User-ID model. Each model is provided as a separate library that can be included in your project as a Maven dependency:
Sequence Model
This model uses a sequence to generate unique IDs for user entities. The sequence can be a simple incrementing number or more complex based on specific business rules.
<dependency>
<groupId>de.frachtwerk</groupId>
<artifactId>essencium-sequence-model</artifactId>
<version>${essencium.version}</version>
</dependency>UUID Model
This model uses a Universally Unique Identifier (UUID) for each user entity. UUIDs are 128-bit values that are globally unique without any centralized authority.
<dependency>
<groupId>de.frachtwerk</groupId>
<artifactId>essencium-uuid-model</artifactId>
<version>${essencium.version}</version>
</dependency>Identity Model
This model uses a database’s identity columns to generate unique IDs for each user entity. The database automatically generates these IDs when new records are inserted.
<dependency>
<groupId>de.frachtwerk</groupId>
<artifactId>essencium-identity-model</artifactId>
<version>${essencium.version}</version>
</dependency>Own User
If u like to use only the essencium-backend package, you have to create your Own User by extending and implementing the classes of the default user. This option gives you the flexibility to customize the user entity and its services according to your specific needs. If you choose this option, you will need to implement the User entity and all associated services (UserService, UserRepository, UserRepresentation, UserRepresentationAssembler and UserController) in your application.