Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4261

Observer do not need a serverid

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.6.2
    • None
    • server
    • None

    Description

      I am working on a project which uses Zookeeper as the authority KV store, the write TPS would be quite low, but the read TPS would be some like 10K from 10K clients. So my idea is quite simple, I will use a cache layer(like http) in front of ZK, then my problem become how to keep my cache updated.

      After some investigation, I come up with 2 solutions:

      1. Run the Observer inside my cache, so that the cache would be updated incrementally, and could be persisted with the stable ZK data dir.
      2. Use https://curator.apache.org/curator-recipes/curator-cache.html.

      With approach 2, the disconnection of the session would lead to read all the keys inside the KV store, and I have to implement a persistent store myself if I want to store the data locally.

      For the approach 1, I come up with the question:

      Each server inside ensemble should have a serverid, which is read from data/myid, it is limited to range [0, 255]. I my case I would like to have thousands of Observer process running, which would easily break the limitation. 

      After look into the code, I don't think each observer has unique serverid is not necessary (I tested the Observer with a quite large number, it works though). I think we should remove the serverid of Observer so that we could build application on Observer easily and benefit from the streaming of transaction log.

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            synckey Jian Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: