ByteDance interview question

How to ensure Consistency between Redis and Database?