This topic describes how to set a cache update policy for a MongoDB or Redis database when you use the change tracking feature. The cache update policy allows you to achieve high reliability and low latency.
Prerequisites
Background information
Preparations
Create an AccessKey and obtain the AccessKey ID and AccessKey Secret. For more information, see create an AccessKey pair.
Notice If you use a RAM user to subscribe to data, you must have the AliyunDTSFullAccess permission. For more information , see Authorize a RAM user to use DTS.
Procedure
IntelliJ IDEA (Community Edition 2018.1.4 Windows) is used in this example.
Result
- Log on to the source database and insert several data records into the source table.
Then, the program tracks the inserted data records and writes the data records to
the destination database.
- Running result of the demo code for MongoDB
- Running result of the demo code for Redis
- Running result of the demo code for MongoDB
- Log on to the destination database and query the inserted data records. Then, the
data records are written to the database.
- Query result for the MongoDB database
- Query result for the Redis database
- Query result for the MongoDB database