The development of Global Scale

Posted by on May 22, 2017 in Free Software, Nextcloud | 4 Comments

The architecture of Nextcloud is a classic Web Application architecture. I picked this architecture 7.5 years ago because it is very well known and is proven to be scaled relatively easily. This usually works with off the shelf technologies like http load balancers, clusters of Linux webservers and clustered databases.

But for many years users and customers asked for ways to distribute a single instance over several datacenters. A lot of users and customers run organizations that are not in one office or sometimes not even in one country or on one continent. So how can the service run distributed over different hosting centers on different continents?

Until now there was no good answer for this requirement.

Over the years I talked with users who experimented with different approaches. Unfortunately, they all didn’t work.

If you talk to storage people how to solve this challenge they say: No problem. Just use a distributed storage system like Gluster, Ceph, Hadoop or other.

If you talk to database people and how to do this they say: No problem! Just use one of the cluster and replication systems for Oracle, MySQL, MariaDB and others.

The challenge is how this all works together. If a user changes a file in Nextcloud then it is necessary that the file is changed, potential encryption keys are updated, log files are written, database tables are changed, email notification are sent, external workflow scripts are executed and a lot of other things happen. All these operations that are triggered by a single file change have to happen in an atomic way. It happens completely or not at all. Using database replication and storage replication independently will lead to a broken state and data loss. Additional problems are that you need the full bandwidth and storage in all data centers. So there is a lot of overhead.

The Global Scale architecture, that we designed, is currently the only solution, as far as I know, which solves this challenge.

Additional benefits are that the storage and database and overall operational costs decreases because simpler, commodity and more standard components can be used.

Another benefit is that the locality of data can be controlled. So if it is a legal requirement that certain files never leave a certain jurisdiction then this can be guaranteed with the right GS Balancer and File Access Control settings.

So far I only talk about the benefit that GS breaks a service down into several data centers. This is only half of the truth. Nextcloud Global Scale can be used in an even more radical way. You could stop using clustered Nextcloud instances in general. Killing all central storage boxes and databases and move completely to commodity hardware. Using only local storage and local databases and local caching. This changes the world completely and makes big storages, SAN, NFS and object store boxes completely obsolete.

The Global Scale architecture idea and implementation were developed over the last year with feedback and ideas from many different people. Storage experts, Database vendors, Linux distribution people, container and orchestration experts for easy automatic deployment and several big customers and users of Nextcloud.

The main inspiration came out of long discussions with the people at DeiC are running the National Research and Education Network of Denmark. DeiC was doing successful experiments with a similar architecture for a while already.

At Nextcloud we are committed to develop everything we do as open source. This includes this feature. Also, if you want to contribute to this architecture then no Contributer License Agreement is needed and you don’t need to transfer any rights to the Nextcloud company.

More information about Nextcloud Global Scale can be found here: https://nextcloud.com/globalscale

4 Comments

  1. Links 25/5/2017: Mesa 17.1.1, Qt 5.9.0 RC, and Much More | Techrights
    26/05/2017

    […] The development of Global Scale […]

    Reply
  2. Nextcloud 12 | Mein kleiner Blog
    29/05/2017

    […] 22.05.2017 veröffentlichte Nextcloud seinen Fork in Version 12.  Mit Nextcloud GS (Global Scale) wurde eine neue Architektur eingeführt, um auch für Hunderte Millionen Nutzer […]

    Reply
  3. Asmodias
    31/05/2017

    I have a wide spread Family, all with their own Internet Provider, router and sometimes really slow internet connection.

    If I setup a RaspberryPi for every accommodation, could I create with Nextcloud a distributed Backup solution that guarantee that the Families hold backups from each other?
    The Idea is also that I have one little public php Webhost with a Domain. This Nextcloud instance do not store any data but act as node which connect all other RaspberryPi Nextcloud and handle their dynamic DNS.

    Reply

Leave a Reply