What is the hierarchical namespace in ADLS Gen2? What does it change compared with flat Blob Storage, and why does Spark care?
Why they ask this
It is the single setting that turns a storage account into a data lake, and the rename behaviour is why analytics engines need it.
Say this
The hierarchical namespace is a storage account option that organises blobs into real directories with their own metadata, instead of a flat list of names that merely contain slashes. It gives atomic directory operations, so renaming or deleting a folder is one operation rather than a copy per object, and POSIX-style access control lists on files and directories. Spark cares because its commit protocols rename task outputs into place; on a flat namespace that is a copy of every file, slow and non-atomic.
The reasoning
Enabling the namespace on a storage account is what makes it ADLS Gen2. The account then exposes the DFS endpoint, used through the `abfss://container@account.dfs.core.windows.net/path` URI, alongside the Blob endpoint. Both endpoints address the same data.
On flat Blob Storage, `folder/a.parquet` and `folder/b.parquet` are two independent blobs; "renaming the folder" means copying both and deleting the originals, with a window where readers see half a folder. With the namespace, the directory is an object, and the rename is a metadata change.
Access control gains a second model. Azure RBAC still works at the container level. ACLs add read, write and execute bits per directory and file for users, groups and service principals, including default ACLs inherited by new children. Lake layouts with per-domain folders rely on them.
Costs: the namespace is free, but the account's transaction pricing differs slightly, and some Blob features such as soft delete for blobs arrived later for namespace-enabled accounts. Once enabled it cannot be turned off, though a flat account can be upgraded in place.
The answer most people give
"ADLS Gen2 is a separate service from Blob Storage." It is Blob Storage with the hierarchical namespace enabled, served through an additional endpoint. The data and the account are the same.
They’ll ask next
A Spark job writing to a flat Blob container takes ten minutes to commit after the tasks finish. Which operation is slow, and what account setting fixes it?
Reported in 2 interview write-ups
