Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-38401

Provide a way to determine if the result set of a Query changes

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None

      A user proposed the following enhancement to reduce network traffic (they already use network compression):

      "One of the 'issues' of solutions like Atlas is the separation of database and backend server where communication latency between database(s) and backend server is limited by connectivity speeds.

      While we gain a tremendous amount with solutions like Atlas we lose 'intelligence' in managing transfer of data. I am looking at reading operations. It is common practice with networked devices to try and reduce network traffic as even with compression it slows down response times.

      If I was implementing it as part of Mongo Driver I would add a form of checksum (i.e. hash) of dataset I already have in my possession (generally stored in in-memory storage) and send read request(find({...}, {hashCode:1234AE893....}}) where database would execute the read, generate it's own hashCode on dataset (or somehow know data has not changed) and compare it's generated hashCode to what I sent in request. If hashCodes match it returns response NO-CONTENT-CHANGE along with it's generated hashCode indicating data is the same as I already have - thus drastically reducing network traffic.

      In an HTTP world this is done using eTAGs. For example, if data requested has not changed and using something along lines of eTags we could receive eTag from client, process call (most probably a cached response) check eTag received via eTag generated server side and simply respond data has not changed and requesting client (normally the back end server) will then used eTagged cached result and save on transferring network speed."

            Assignee:
            asya.kamsky@mongodb.com Asya Kamsky
            Reporter:
            harshad.dhavale@mongodb.com Harshad Dhavale
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: