Tiempo de lectura: 6 minutos

Sharing data is fantastic for teamwork, but it can also introduce some roadblocks. The biggest one? Conflicting edits. Imagine two people working on the same file at once, accidentally overwriting each other's changes. Even with regular updates, mistakes can still slip through, and important data gets lost. So, the question becomes: how can companies encourage collaboration on datasets without sacrificing data quality and consistency?  This is where file locking comes in.

File locking is a data management feature which makes sure only one person can edit a file at a time. Think of it as giving someone the keys to the car – they have exclusive access until they're done and return them. File locking creates a system where everyone can work together smoothly, without accidentally overwriting each other's edits.

Explicación del bloqueo global de archivos

Global file locking is a feature of cloud storage that ensures only one copy of a file is edited at a time. It eliminates confusion by enabling users to collaborate on the same set of data without the risk of working on top of each other.

Alternatives to global file locking exist, including 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 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: global file locking can be expensive. Since it’s more advanced than standard file sharing options, services that offer global file locking are often sold at a higher price. Knowing this, companies should consider whether global file locking is the right investment for them.

Now, let's dive deeper into the different types of file locking available.

Tipos de bloqueo de archivos

Si han decidido que el bloqueo de archivos es una solución crítica para sus necesidades, las organizaciones tendrán que considerar qué tipo de bloqueo de archivos quieren utilizar. Existen varias opciones con diversas ventajas e inconvenientes en función del caso de uso.

1). Aviso de bloqueo

El bloqueo preventivo no proporciona una protección total contra modificaciones conflictivas porque depende de la cooperación entre usuarios. Los usuarios pueden ignorar un bloqueo asesorado, pero esa opción está totalmente desaconsejada porque puede provocar la corrupción de los datos y la incoherencia.

When a user requests access to a file, the advisory lock will notify that user that a lock is in place. Again, the advisory lock doesn’t prevent access; it only informs the user that they should avoid working on the file. When a user requests an advisory lock for a file, the system will check for any existing locks. If there are existing locks, it will return an error message.

Los bloqueos consultivos son más eficaces si varios usuarios necesitan acceder a un archivo simultáneamente. Sin embargo, esos usuarios también deben comunicarse entre sí para que sólo un usuario esté escribiendo a la vez. Incluso cuando se aplica un bloqueo preventivo, los demás usuarios pueden seguir leyendo el archivo sin causar problemas.

2.) Bloqueo obligatorio

Mandatory locks are enforced by an operating system that prevents users from accessing or modifying a file that another user has already locked. Unlike with 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.

El bloqueo obligatorio es útil cuando una empresa necesita evitar que varios usuarios modifiquen simultáneamente el mismo archivo. En ese caso, este tipo de bloqueo garantiza la coherencia de los datos y evita la corrupción de archivos.

En el lado negativo, el bloqueo obligatorio puede sobrecargar el rendimiento y provocar problemas de sincronización si no se utiliza correctamente. Además, esta función no está disponible en todos los archivos o sistemas operativos, por lo que las empresas siempre deben comprobar que es compatible con sus sistemas antes de adquirirla.

3.) Bloqueo compartido

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.

Los bloqueos compartidos son excelentes para las empresas que buscan mejorar el rendimiento y la eficiencia del sistema. Sin embargo, si un archivo debe modificarse con frecuencia, el bloqueo compartido puede no ser ideal, ya que la edición está prohibida hasta que se liberan todos los bloqueos compartidos.

4.) Bloqueo exclusivo

Exclusive locks only allow one user to access a file at a given time. This lock keeps all other users from accessing the file for both read and write purposes. If a particular user needs frequent access to a file, exclusive locking is an ideal solution, as it ensures that nobody else will create conflicting modifications.

Uno de los inconvenientes del bloqueo exclusivo es que puede sobrecargar el rendimiento. Si un único usuario tiene el bloqueo exclusivo de un archivo, todos los demás usuarios deben esperar a que se libere el bloqueo antes de abrir el archivo.

5.) Bloqueo de alcance

Range locking allows a user to lock a specific byte range within a file. When requesting a range lock, users can specify the start and end point of the byte range within which they will work. The request will be granted as long as there is no overlap with any other range locks.

Con el bloqueo de rangos, varios usuarios pueden acceder al mismo archivo y editarlo sin riesgo de modificaciones conflictivas. Una vez que un usuario tiene un bloqueo de rango en un rango de bytes designado, ningún otro usuario puede editar ese rango de bytes hasta que se libere el bloqueo.

El bloqueo por rango no es compatible con todos los sistemas operativos o de archivos, por lo que las empresas deben evaluar si sus sistemas son compatibles con el bloqueo por rango antes de elegir este tipo de bloqueo de archivos.

DFSR y bloqueo de archivos

Distributed file system replication (DFSR) is a common term for collaborative file sharing. DFSR is a Windows feature that allows users to replicate files between multiple servers in multiple locations, improving the availability and reliability of file access.

Funciona de la siguiente manera: DFSR identifica los cambios realizados en un archivo en un servidor y replica esos cambios a otros servidores. Todos los cambios se rastrean a nivel de bloque, lo que permite a los servidores replicar cambios específicos en archivos en lugar de archivos enteros. DFSR puede ser síncrono o asíncrono. En modo síncrono, los cambios se replican inmediatamente a otros servidores, por lo que todos los usuarios tienen acceso a la misma versión de un archivo al mismo tiempo. En modo asíncrono, los cambios se ponen en cola para su replicación y pueden tardar en distribuirse a otros servidores.

Aunque DFSR permite compartir archivos y colaborar de forma eficaz, no siempre es compatible con el bloqueo de archivos. DFSR no realiza un seguimiento de los bloqueos que existen en otros servidores, lo que significa que los usuarios pueden sobrescribir los cambios de los demás sin saberlo. El último usuario en guardar sus cambios en un archivo se queda con sus cambios. DFSR sólo reconoce los bloqueos dentro de su servidor nativo y no replicará un archivo si la copia local tiene un bloqueo exclusivo. Pero, de nuevo, este bloqueo local no impide que los usuarios de otros servidores accedan o modifiquen su propia copia local del mismo archivo.

Por lo tanto, aunque DFSR cuenta con increíbles capacidades y ofrece una potente herramienta para las empresas que desean compartir archivos entre varios servidores, puede haber mejores opciones para las empresas que desean utilizar el bloqueo de archivos.

Shift the balance of power in the fight against ransomware.

Panzura-datasheet-Detect-and-rescue-header-min (1)

PanzuraEnfoque

Estamos de acuerdo en que el bloqueo de archivos es un componente clave del intercambio y la colaboración. Pero en lugar de utilizar la tecnología existente, decidimos desarrollar la nuestra propia. Creamos y patentamos nuestros propios sistemas de bloqueo para garantizar el rendimiento local y proteger de la corrupción los datos almacenados.

Panzura's CloudFS offers two types of file locks: a global write lock and a byte range lock. Global write locking prevents more than one user from opening a file and making modifications. A second user can’t write on that file until the initial write lock has been released. Byte range locking is an excellent solution for businesses that want to utilize file locking while enabling employees to work simultaneously on the same files. This type of lock only restricts in-use file portions, allowing multiple users to work on the same file in different byte ranges without worrying about data collisions, corruption, or file versioning.

Both of our locks cover a company’s entire cloud network across any number of locations. When a file is opened, the lock is moved to where the data is stored in the global file system. So, the file is locked for editing across the cloud network. Only real-time file locking effectively prevents user collisions. Our globally distributed file-locking feature allows every site in the network to issue a real-time request for a lock from whichever site currently holds it.

File locking makes it easy for companies to collaborate globally, but only some types of file locking will be a good match for specific companies. Here at Panzura, we strive to give every company a file locking solution they can use confidently. With Panzura file locking, users have global access to all their files without fearing collisions. There’s no limit to what companies can do with their data — so antiquated file locking methods shouldn’t hold them back.