zip Key-Value Store driver¶
The zip driver implements support for reading and writing
ZIP format
files on top of a base key-value store. (Not all ZIP features are supported.)
- json kvstore/zip : object¶
Key-value store adapter for the ZIP archive format.
JSON specification of the ZIP key-value store.
- Extends:¶
KvStoreAdapter— Key-value store adapter that adapts a single base key-value store.
- Required members:¶
-
driver :
"zip"¶
- base : KvStore | KvStoreUrl¶
Base key-value store to adapt.
-
driver :
- Optional members:¶
- path : string¶
Key prefix within the key-value store.
If the prefix is intended to correspond to a Unix-style directory path, it should end with
"/".
-
cache_pool : ContextResource =
"cache_pool"¶ Specifies or references a previously defined
Context.cache_pool. It is typically more convenient to specify a defaultcache_poolin thecontext.
-
data_copy_concurrency : ContextResource =
"data_copy_concurrency"¶ Specifies or references a previously defined
Context.data_copy_concurrency. It is typically more convenient to specify a defaultdata_copy_concurrencyin thecontext.
- json KvStoreUrl/zip : string¶
zip:KvStore URL schemeZip key-value store adapters may be specified using the
zip:pathURL syntax.Examples
URL representation
JSON representation
"file:///tmp/archive.zip|zip:path/within/archive"{"driver": "zip", "path": "path/within/archive", "base": {"driver": "file", "path": "/tmp/archive.zip"} }"file:///tmp/archive.zip|zip:nested.zip|zip:path/within/inner_zip"{"driver": "zip", "path": "path/within/inner_zip", "base": {"driver": "zip", "path": "nested.zip", "base": {"driver": "file", "path": "/tmp/archive.zip"}} }- Extends:¶
KvStoreUrl— URL representation of a key-value store.
Example JSON specifications¶
{ "driver": "zip",
"kvstore": "gs://my-bucket/path/to/file.zip" }
Auto detection¶
This driver supports auto-detection based on the signature at the end of the file.
Warning
To limit the amount of data that is read, auto-detection is only supported if the end of file comment does not exceed 4096 bytes. ZIP archives with comments up to the maximum length of 65535 bytes are still supported without auto-detection, however.
Transactions and Write Amplification¶
This driver supports writing and deleting keys inside the ZIP archive. Since ZIP archives do not support random modification, each write or delete operation may rewrite the entire ZIP archive. Therefore, using transactions is strongly recommended to batch multiple write operations and minimize write amplification.
Limitations¶
Not all ZIP features and compression formats are supported:
- Compression formats
Reading: Support is limited to
deflate,bzip2,zstd,xz, andstore(no compression).Writing: Support is limited to
deflate,zstd,xz, andstore. Other compression methods (such aslzma) are not supported.
Standard ZIP encryption, strong encryption, and AES encryption are not supported.