saveourtool/save-cloud
Vedi su GitHubBackend: JPA / spring-data / hibernate improvements
Open
#575 aperta il 15 feb 2022
enhancementgood first issue
Metriche repository
- Star
- (38 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Mark entities / columns / transactions:
- readonly (
@Transactional(readOnly = true)): reduces memory consumption - non-nullable as per DB constrains (
@Column(nullable = false)) => properties can have non-nullable type - Make all associations lazy
- others?
- https://vladmihalcea.com/jpa-persist-and-merge - The redundant save anti-pattern
Hibernate L2 caches:
- https://www.baeldung.com/hibernate-second-level-cache and https://stackoverflow.com/questions/31585698/spring-boot-jpa2-hibernate-enable-second-level-cache
- https://vladmihalcea.com/how-does-hibernate-query-cache-work/
Some entities that are worth caching:
- Users, user-project associations (#580, #649) - won't change often, but are required for all permission checks
- Projects, organizations - won't change often, but are often required by frontend