anchor.diff:      attach_nodes(Rest, [S#shard{node=Node} | Acc], Nodes, [Node | UsedNodes]).
   
   write_db_doc(Doc) ->
  -    {ok, Db} = couch_db:open(<<"dbs">>, []),
  +    DbName = ?l2b(couch_config:get("mem3", "shard_db", "dbs")),
  +    {ok, Db} = couch_db:open(DbName, []),
       try
           update_db_doc(Db, Doc)
       catch conflict ->
  
positive.code:     end.
  
  delete_db_doc(DocId) ->
      {ok, Db} = couch_db:open(<<"dbs">>, []),
      try
          delete_db_doc(Db, DocId)
      catch conflict ->
  
negative.code:     N.
  
  load_shards_from_disk(DbName) when is_binary(DbName) ->
      X = ?l2b(couch_config:get("mem3", "shard_db", "dbs")),
      {ok, Db} = couch_db:open(X, []),
      try load_shards_from_db(Db, DbName) after couch_db:close(Db) end.
  
  load_shards_from_db(#db{} = ShardDb, DbName) ->
  