Might want to consider looking deeper into the pear runtime and keet. It decouples data from any specific server/relay/cloud storage location.