A
A
Alvaro2013-04-29 11:04:33
NoSQL
Alvaro, 2013-04-29 11:04:33

How to clean up stale data in a high load collection?

Hello. There are two shards, a collection with a load of about 600 add and update requests per second. There was a problem with cleaning up obsolete records. The first solution was to write a utility that would run during the minimum load and remove obsolete entries. But after launching the utility, the removal blocked the work (as expected) and at the same time worked for 12 hours, which is unacceptable. Then we introduced a TTL index, but this also led to a large number of queues and an increased load on the CPU. Advise on the best approach to deleting obsolete data on a heavily loaded system. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
Max, 2013-04-29
@7workers

Have you tried capped collection?

1
1nd1go, 2013-04-29
@1nd1go

Add 2 more shards, and periodically switch from one to another. While the second one is working, clear the first one.

A
Alvaro, 2013-04-29
@Alvaro

Yes, and how to synchronize data between two clusters?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question