Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

443
Vistas
SCD (slowly changing dimension) Type 4/6 - how to implement in spring boot app, hibernate envers

I am trying to solve the problem how should I create "logs" for my app and store them to database.

Let's assume I have this database structure:

FIRST TABLE:

weatherstation_id | weatherstation_name | weatherstation_ip_address

SECOND TABLE:

sensor_id | sensor_name | sensor_number | weatherstation_id

THIRD TABLE:

measurement_id | value | measure_date | weatherstation_id | sensor_id

from this I should be able to get the "log" so the measurement value and informations about the weather station and sensor !AT THE TIME WHEN THE MEASUREMENT WAS MADE!, so I need to implement history somehow.

I am trying to solve this for more than two weeks and I have discovered that I should probably go with something like SCD type 4 or 6.

One option which came to my mind is spring-data-envers which should handle the history, but here I don't know how I should "link" the measurement to the revision.

Second option is to write it on my own and use JPA Lifecycle Callbacks and have in my WeatherStation entity list of WeatherStationHistory and before any update or persist add the copy of current WeatherStation there and then have the Measurement pointing to this WeatherStationHistory.

So what I want to know is what is the best way to solve this problem and how to implement it in spring boot application.

I hope I have described my problem clearly. I will be grateful for any advice.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I think you should use the database level options for SCD. Although I don’t know if there’s any benefit to this if it’s implemented at the application level.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda