How can you ensure data integrity between the cache and the underlying data source in a Spring Boot application?
- Use a write-through caching strategy with cache synchronization.
- Disable caching entirely to rely on the underlying data source.
- Use optimistic locking techniques to prevent data conflicts.
- Manually refresh the cache at regular intervals.
To ensure data integrity between the cache and the underlying data source in a Spring Boot application, a write-through caching strategy with cache synchronization is effective. This approach ensures that any changes made to the data source are also reflected in the cache in real-time. Options 2, 3, and 4 are not recommended practices for maintaining data integrity between the cache and the data source.
Loading...
Related Quiz
- In Mockito, the _____ method can be used to stub a return value for a method call.
- You are developing a Spring Boot application which has conflicting auto-configuration classes. How would you analyze and resolve these conflicts to ensure the correct configurations are applied?
- What is the significance of the @MockBean annotation in Spring Boot testing?
- Which of the following annotations is used to map a web request to a specific handler method?
- What is the main goal of Reactive Streams in Spring Boot?