Skip to content

Cache Writer optimization

Adam Fraser edited this page Mar 31, 2015 · 7 revisions

We want to optimize the cache writer to support:

  • parallel cache writes for tap feed entries

Current Cache read/write process

Write: For each tap feed entry:

  • 1 write for the _cache:entry document
    • stores the information sent by the _changes feed (DocID, RevID, Sequence, Flags)
  • per channel:
    • 1 read for the cache block
    • 1 CAS write for the cache block
    • 1 incr for the cache clock

Total ops per feed entry: 1 + (# channels * 3)

Read: For each poll iteration:

  • per channel:
    • 1 read of the cache clock
    • if clock shows changes
      • 1 read of cache block (low potential for additional cache block read):
        • per sequence:
          • read of _cache:entry document

Total ops per iteration: (# channels) * (2 + (#changes))

Clone this wiki locally