Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Compaction not sufficient for local CDR databases #48

Open
shimaore opened this Issue Apr 11, 2013 · 0 comments

Comments

Projects
None yet
1 participant
Owner

shimaore commented Apr 11, 2013

The comments in http://wiki.apache.org/couchdb/Purge_Documents seem to indicate that rotating the databases is probably a better option.
The DB name is static in json_cdr, but there can be many of them (not sure how that gets done in XML, can we repeat the same param multiple times?).

Order of operations with two databases would look like this:

  • The cleanup process is ran on both A and B.
  • Block access to A (CDRs are written on disk)
  • Create B (Can't do that before, or we'll get duplicate CDRs)
  • Start continuous replication of B
  • ...
    Though a simpler option (with the same limitations) is to block access to A, finish replication (mark all records deleted by calling the cleanup process at that time), once all are deleted remove the database, then re-create it, and let the swiper process finish the inserts.
    (With two databases, one of which is almost never present, we'll waste a lot of FreeSwitch resources.)

Another option would be to use a Node.js proxy (which would also allow to replace the _id with some unique value based on timestamp, calling/called number, microsecond duration), but that doesn't necessarily make it more robust. (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment