Temps de lecture : 6 minutes

Co-authoring files is a phenomenal way to boost organizational productivity, but it can also introduce some roadblocks. The biggest one? Conflicting edits as multiple users work in the same file at once, accidentally overwriting each other's changes and not even being aware another user was in the file. 

One set of edits — whichever is saved last — wins and the other set loses. 

At best, team members lose time and get frustrated, while IT teams get pulled in to try to restore file versions. At worst, important data gets lost and incorrect files get shipped to printers, clients or partners.

So, the question becomes: how can organizations enable collaboration on datasets without sacrificing data quality and consistency? 

Most desktop apps have supported locking for years — it’s a file collision avoidance system that is as well-established as network-attached storage (NAS) itself. File locking prevents data corruption and preserves file integrity by stopping users and team members from editing the same file, or the same part of a file, at the same time so they cannot interfere with each other’s work. Most modern cloud-native applications have more granular range locking built in. For example Google Docs, Sheets, and Slides all support co-authoring with multiple users able to edit these cloud files simultaneously without colliding edits. Microsoft Office applications similarly allow range locking, with significantly better results using desktop applications. 

Le verrouillage global des fichiers expliqué

Global file locking ensures only one copy of a file is edited at a time, even when the file is on a network drive accessible to multiple users. It prevents file corruption by enabling users to collaborate on the same set of data without the risk of while preventing them from damaging or overwriting each other’s work.

Alternatives to global file locking include versioning - which allows users to open a second copy of a file that another user is currently editing. This copy is tracked as a unique file which allows both users to work simultaneously but gets messy and time-consuming when these individual copies must be manually integrated to ensure all changes are incorporated into the final version of the file. Global file locking prevents this.

But here’s the downside: real time global file locking runs into problems when you introduce distance, including a move to cloud storage. Effective collision avoidance relies on real time recognition of file opens as well as user location within files in order to prevent overwrites. Distance, latency and lack of functionality often render the file locking built into software applications unusable.

File Locking Glossary

Not all file locking is created equal and the geeks among us love to understand the different possible approaches in order to know what’s going on behind the scenes. After all, the resolution for file corruption issues often land in IT, which isn’t usually the team generating or working with the data. Here’s what you need to know.

Advisory Locking

Le verrouillage consultatif n'offre pas une protection totale contre les modifications conflictuelles, car il repose sur la coopération entre les utilisateurs. Les utilisateurs peuvent ignorer un verrou consultatif, mais ce choix est fortement déconseillé car il peut entraîner la corruption et l'incohérence des données.

Lorsqu'un utilisateur demande l'accès à un fichier, le verrou consultatif l'informe qu'un verrou est en place. Encore une fois, le verrou consultatif n'empêche pas l'accès ; il informe seulement l'utilisateur qu'il doit éviter de travailler sur le fichier. Lorsqu'un utilisateur demande un verrou consultatif pour un fichier, le système vérifie s'il existe déjà des verrous. Si c'est le cas, il renvoie un message d'erreur.

Les verrous consultatifs sont particulièrement efficaces lorsque plusieurs utilisateurs doivent accéder simultanément à un fichier. Toutefois, ces utilisateurs doivent également communiquer entre eux afin qu'un seul utilisateur écrive à la fois. Même lorsqu'un verrou consultatif est en place, les autres utilisateurs peuvent continuer à lire le fichier sans problème.

Mandatory Locking

Mandatory locks are enforced by an operating system that prevents users from accessing or modifying a file that another user has already locked. Unlike advisory locks, users can’t choose to ignore mandatory locks. If a user requests a mandatory lock but another mandatory lock already exists, the user will be denied access to the file until the other lock is released.

Le verrouillage obligatoire est utile lorsqu'une entreprise doit empêcher plusieurs utilisateurs de modifier simultanément le même fichier. Dans ce cas, ce type de verrouillage garantit la cohérence des données et empêche la corruption des fichiers.

On the downside, mandatory locking can create performance overhead and result in synchronization issues if not used properly. The feature is also not available on all file types or operating systems.

Shared Locking

With shared locks, multiple users can access a file simultaneously for reading purposes only. All editing is prevented with a shared lock, which ensures consistency and integrity. Shared locks are granted to users if they don’t conflict with existing locks on a file. An exclusive lock can’t be granted until all shared locks are released.

Les verrous partagés sont excellents pour les entreprises qui cherchent à améliorer les performances et l'efficacité de leur système. Toutefois, si un fichier doit être modifié fréquemment, le verrouillage partagé n'est peut-être pas la solution idéale, car la modification est interdite tant que tous les verrous partagés n'ont pas été libérés.

Exclusive Locking

Exclusive locking grants a single user exclusive access to a file and will hold that lock until released. This prevents other users from reading or writing to the file, ensuring data integrity and preventing conflicts.

Exclusive locking is ideal for sensitive or critical files that require strict control over access. It can also be useful in scenarios where a single user needs to work on a file without interruptions. However, it brings with it the all-too-common scenario in which a user accidentally leaves a file locked by leaving it open on their device. This generally requires IT intervention to break the lock by forcing a user log off.

Range Locking

Range locking allows users to lock specific portions of a file. This prevents conflicting modifications and enables multiple users to collaborate on the same file simultaneously without risking data corruption.

As users move through the file, the application recognizes their location and specifies the start and end points of a byte range, locking it for that user alone. This means users can effectively work on designated sections of a file while preventing others from editing those areas. This is particularly useful for teams collaborating on large documents, codebases, or other complex files where different team members need to work independently on specific parts.

Compared to global write locking, which locks the entire file, range locking provides a more granular level of control, allowing for efficient collaboration on various sections of a file. This more modern approach improves productivity and reduces the likelihood of conflicts, especially in scenarios where multiple users need to work on different parts of a file simultaneously. However, it’s challenging to achieve over distance, as latency means a lag in recognizing where the user has moved to in the file. 

Distributed File System Replication (DFSR) and File Locking

DFSR is a Windows feature that enables efficient file sharing and collaboration by replicating files between multiple servers. DFSR tracks changes at the block level, allowing for efficient replication of specific file modifications. It can operate in synchronous or asynchronous modes, ensuring consistency or allowing for delayed replication.

While DFSR is a powerful tool, it may not be fully compatible with certain file locking mechanisms. DFSR's conflict resolution strategies are not always be sufficient for preventing data corruption or ensuring consistency in scenarios where multiple users are actively editing the same file.

When considering DFSR, organizations should carefully evaluate its limitations and potential drawbacks. Factors to consider include performance overhead, network requirements, and the integration with existing file locking systems. In some cases, alternative replication technologies or custom solutions might be more suitable for achieving desired levels of file sharing and data integrity.

Delivering Performant File Locking in the Cloud

The developers of software applications engineer file and range locking so that it performs maximally for users of the application. And, every aspect of bat365’s hybrid cloud file platform CloudFS is engineered for maximum productivity and efficiency. That’s why CloudFS explicitly enables application-specific locking to work in the cloud and across vast distances.

That means that file locking and granular range locking work at the speed of business for applications that support it, regardless of the number of locations and users or the distance between them.

The core of bat365’s hybrid cloud file platform CloudFS is a global file system that enables an organization to use centralized cloud storage as if the data is still stored near to the user. CloudFS separates metadata from file data and moves the least amount of this lightweight informational data across the shortest possible distance, so every location that accesses cloud-stored files knows exactly what’s happening, in real time.

Locks are passed between locations as they’re requested and either granted or denied. The result from a technology perspective is the seemingly impossible — real time exchange of data around the globe, even when working on very large files and complex file models.

For the organization, the result is global file co-authoring that allows an entire organization to work as collaboratively as if everyone is under the same roof. The competitive advantage that comes with a high-performance file environment like this is exceptionally difficult for others to make up. 

Moreover, it’s largely invisible to the outside world, which leaves this advantage to savvy IT leaders who understand the business impact of enabling high performers with a file environment that supports their best work.

Only a very few solutions come close to enabling performant file and range locking over any distance at all. bat365 CloudFS stands alone in its ability to achieve real time locking globally, irrespective of the number of locations, users at each location, or the distance between them.

From LA to New York, Sydney, Australia to London, England and everywhere in between, bat365 empowers organizations with immediate data delivery that transcends the barriers of distance, network connections and time zones to allow co-authoring and collaboration that fuels business innovation and success.