diff --git a/query/query_test.go b/query/query_test.go
index 136f171b9a2659f9c799d1155202b84411f1a62e..12713917a56d1584f536411b74d0339ef44d8780 100644
--- a/query/query_test.go
+++ b/query/query_test.go
@@ -103,7 +103,7 @@ func TestNewGraph(t *testing.T) {
 		t.Error(err)
 	}
 
-	worker.Init(ps)
+	worker.Init(ps, nil)
 
 	uo := flatbuffers.GetUOffsetT(sg.result)
 	r := new(task.Result)
@@ -134,7 +134,7 @@ func populateGraph(t *testing.T) (string, *store.Store) {
 	ps := new(store.Store)
 	ps.Init(dir)
 
-	worker.Init(ps)
+	worker.Init(ps, nil)
 
 	clog := commit.NewLogger(dir, "mutations", 50<<20)
 	clog.Init()
diff --git a/server/main.go b/server/main.go
index 86e2d765295002003af3964bae276f2dd2ee92c6..c1c122ef0df96877a027fb2d984d2418db028bb7 100644
--- a/server/main.go
+++ b/server/main.go
@@ -38,10 +38,15 @@ import (
 var glog = x.Log("server")
 
 var postingDir = flag.String("postings", "", "Directory to store posting lists")
+var xiduidDir = flag.String("xiduid", "", "XID UID posting lists directory")
 var mutationDir = flag.String("mutations", "", "Directory to store mutations")
 var port = flag.String("port", "8080", "Port to run server on.")
 var numcpu = flag.Int("numCpu", runtime.NumCPU(),
 	"Number of cores to be used by the process")
+var instanceIdx = flag.Uint64("instanceIdx", 0,
+	"serves only entities whose Fingerprint % numInstance == instanceIdx.")
+var numInstances = flag.Uint64("numInstances", 1,
+	"Total number of server instances")
 
 func addCorsHeaders(w http.ResponseWriter) {
 	w.Header().Set("Access-Control-Allow-Origin", "*")
@@ -140,7 +145,14 @@ func main() {
 	defer clog.Close()
 
 	posting.Init(clog)
-	worker.Init(ps)
+	if *instanceIdx == 0 {
+		xiduidStore := new(store.Store)
+		xiduidStore.Init(*xiduidDir)
+		defer xiduidStore.Close()
+		worker.Init(ps, xiduidStore) //Only server instance 0 will have xiduidStore
+	} else {
+		worker.Init(ps, nil)
+	}
 	worker.Connect()
 	uid.Init(ps)
 
diff --git a/server/main_test.go b/server/main_test.go
index 2d13e5515fb16f5a02b3c3677e83d16d7f104241..f2180849d5b0bc5243eec7c8235a984bb6e7e8e2 100644
--- a/server/main_test.go
+++ b/server/main_test.go
@@ -62,7 +62,7 @@ func prepare() (dir1, dir2 string, ps *store.Store, clog *commit.Logger, rerr er
 	clog.Init()
 
 	posting.Init(clog)
-	worker.Init(ps)
+	worker.Init(ps, nil)
 	uid.Init(ps)
 	loader.Init(ps, ps)
 
diff --git a/worker/worker.go b/worker/worker.go
index 5966a632afe1286ea589ac28d7e7462a59525396..cfa3b9541b1e519306a8b843a80d119e5a3d5a86 100644
--- a/worker/worker.go
+++ b/worker/worker.go
@@ -21,11 +21,12 @@ var workerPort = flag.String("workerport", ":12345",
 	"Port used by worker for internal communication.")
 
 var glog = x.Log("worker")
-var dataStore *store.Store
+var dataStore, xiduidStore *store.Store
 var pools []*conn.Pool
 
-func Init(ps *store.Store) {
+func Init(ps, xuStore *store.Store) {
 	dataStore = ps
+	xiduidStore = xuStore
 }
 
 func Connect() {
diff --git a/worker/worker_test.go b/worker/worker_test.go
index 06f4be87f02727da500464a9b077a47e34b3c8bf..8d2dbc8ed467e55d54844cf4867b911f88cefca5 100644
--- a/worker/worker_test.go
+++ b/worker/worker_test.go
@@ -58,7 +58,7 @@ func TestProcessTask(t *testing.T) {
 	defer clog.Close()
 
 	posting.Init(clog)
-	Init(ps)
+	Init(ps, nil)
 
 	edge := x.DirectedEdge{
 		ValueId:   23,