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
Before you begin
Create an AccessKey pair, which consists of an AccessKey ID and AccessKey secret. For more information, see Create an AccessKey pair.
Notice If you track and consume data as a RAM user, the AliyunDTSFullAccess permission must be granted to the RAM user. For more information, see Use a system policy to authorize a RAM user to manage DTS instances.
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.
- Execution result of the demo code for MongoDB
- Execution result of the demo code for Redis
- Execution 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