thephpleague / flysystem-replicate-adapter

Flysystem Adapter Decorator for Replicating Filesystems.
24 stars 11 forks source link

Use the replica for read if exists #3

Open sagikazarmark opened 9 years ago

sagikazarmark commented 9 years ago

I am currently migrating a filesystem to another which is much more performant. I am looking for a way to read files from the replica if they are already migrated. Any thoughts?

BartVB commented 8 years ago

I've got a similar situation. Migrating from NFS to Ceph/RadosGW (S3 compatible) and I would like to use Ceph as the primary source for reading with a fallback to NFS and updates should happen on both sources for the time being. I'm hoping that this is possible by combining the Replicate adapter with the Fallback adapter: https://github.com/Litipk/flysystem-fallback-adapter

I.e.

Replicate adapter:
Read: Source
Write: Source + Replica

Fallback adapter:
Read: Replica, fallback to Source
Write: Replica

Replicate + Fallback adapter:
Read: Replica, fallback to Source
Write: Source + Replica