# Will IPFS-Cluster work for this use case

**URL:** <https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987>\
**Category:** Help\
**Tags:** ipfs-cluster, use-cases-and-apps\
**Created:** [February 17, 2023, 12:01am UTC](https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987 "2023-02-17T00:01:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![username1](https://avatars.discourse-cdn.com/v4/letter/u/ee59a6/32.png) [@username1](https://discuss.ipfs.tech/u/username1)\
**Post date:** [February 17, 2023, 12:01am UTC](https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987/1 "2023-02-17T00:01:46Z")

</div>

I have 3 servers all geographically separated and would like them to all have a folder containing data that is replicated between the nodes so that any of the three nodes could create a file in the folder or update an existing file and the other nodes would get the new file or updated version. I found a few topics talking about similar things but it wasnt quite clear if it would.

---

<div class="post-metadata">

**Author:** ![danieln](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/danieln/32/6408_2.png) [@danieln](https://discuss.ipfs.tech/u/danieln)\
**Post date:** [February 17, 2023, 10:08am UTC](https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987/2 "2023-02-17T10:08:34Z")

</div>

Yeah that’s exactly the use case for IPFS Cluster. Essentially, the cluster will maintain a **pinset** , which is a list of pins the cluster should pin.

The replication factor will control how many redundant copies are replicated by the cluster. If you set `replication_factor_min` to `-1` all cids will be replicated to all nodes. See [IPFS Cluster docs](https://ipfscluster.io/documentation/reference/configuration/) for more inofmration.

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [February 17, 2023, 10:56am UTC](https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987/3 "2023-02-17T10:56:43Z")

</div>

Note cluster only works with IPFS pins. Folder mounting, or making sure changes in one place are pinned and then reflected somewhere else is something you have to build on top.

---

<div class="post-metadata">

**Author:** ![danieln](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/danieln/32/6408_2.png) [@danieln](https://discuss.ipfs.tech/u/danieln)\
**Post date:** [February 17, 2023, 12:20pm UTC](https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987/4 "2023-02-17T12:20:15Z")

</div>

@hector

Is it possible to use MFS with one node in the cluster and then pin the new MFS root using the `POST /pins/ipfs/CID` endpoint in the REST API of IPFS Cluster?

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [February 20, 2023, 10:10am UTC](https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987/5 "2023-02-20T10:10:43Z")

</div>

Yes, but MFS root in IPFS will not get updated and the user needs to manually add the new CID back to MFS.

Last time I checked there was no way to replace the MFS root in IPFS.

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [February 20, 2023, 10:11am UTC](https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987/6 "2023-02-20T10:11:26Z")

</div>

I actually wrote this last time I needed to do exactly that: [GitHub - hsanjuan/mfs-replace-root: A small program to replace IPFS MFS root](https://github.com/hsanjuan/mfs-replace-root)

---

<div class="post-metadata">

**Author:** ![danieln](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/danieln/32/6408_2.png) [@danieln](https://discuss.ipfs.tech/u/danieln)\
**Post date:** [February 20, 2023, 2:57pm UTC](https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987/7 "2023-02-20T14:57:45Z")

</div>

> Yes, but MFS root in IPFS will not get updated and the user needs to manually add the new CID back to MFS.

Not sure I understood what you mean.

My thinking was that it’s possible to use MFS on one node and after every change that needs to be persisted, run ` ipfs files stat /` to get the root pin which you then pin to the cluster.

* * *

From my understanding, `mfs-replace-root` is a tool to replace the MFS root which would be useful if you don’t want to actually use MFS to manage files or just want to reset the whole MFS tree.

Are we on the same page?

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [March 2, 2023, 9:48am UTC](https://discuss.ipfs.tech/t/will-ipfs-cluster-work-for-this-use-case/15987/8 "2023-03-02T09:48:39Z")

</div>

> [@danieln](#):
>
> My thinking was that it’s possible to use MFS on one node and after every change that needs to be persisted, run ` ipfs files stat /` to get the root pin which you then pin to the cluster.
> 
> * * *
> 
> From my understanding, `mfs-replace-root` is a tool to replace the MFS root which would be useful if you don’t want to actually use MFS to manage files or just want to reset the whole MFS tree.
> 
> Are we on the same page?

You can do that, but I think the user wanted not only to safeguard the data of MFS, but to have the MFS view in different nodes be the same (and that involves having the same MFS root everywhere).
