Open-Source Wikis

/

MinIO

/

Reference

/

Data models

minio/minio

Data models

The on-disk and on-wire types every contributor will see, with pointers to the canonical definitions.

On disk

format.json (per drive)

cmd/format-erasure.go defines formatErasureV3. One file per drive at <drive>/.minio.sys/format.json. Identifies which deployment, pool, and set the drive belongs to.

xl.meta (per object on each drive)

cmd/xl-storage-format-v2.go defines xlMetaV2. MessagePack-encoded; one file per object per drive. Carries:

  • All versions of the object (xlMetaV2Version).
  • Per-version metadata: ETag, parts, size, modtime, encryption, replication state, lock retention.
  • Inline data for tiny objects.
  • Free versions awaiting reclamation.

The codec lives in cmd/xl-storage-format-v2_gen.go (generated by msgp).

Bucket metadata

cmd/bucket-metadata.go defines BucketMetadata. One file per bucket at <deployment>/.minio.sys/buckets/<bucket>/.metadata.bin. Carries lifecycle, replication, encryption, tagging, policy, notification, quota, object-lock config, and timestamps.

IAM JSON files

Stored under <deployment>/.minio.sys/iam/:

  • users/<user>/identity.json — local user.
  • groups/<group>/info.json — group membership.
  • policies/<policy>/policy.json — IAM policy doc.
  • service-accounts/<id>/... — service-account creds + inline policy.
  • iam-config-store/... — IDP config.

cmd/iam-object-store.go is the source of truth.

Data usage cache

cmd/data-usage-cache.go defines dataUsageCache. Persisted under <bucket>/usage-cache.bin for every bucket; a tree of folders + counts + sizes used for quotas, ILM, and metrics.

Replication state

Per-object replication status lives inside xl.meta. Bucket-level targets are at <bucket>/bucket-targets.json (parsed in cmd/bucket-targets.go).

Notification target queues

Per-target queue directories under <bucket>/.notifications/<target-id>/ hold pending events serialised by internal/store/.

Tier handles

When an object is transitioned, its xl.meta carries a tier handle (see cmd/xl-storage-format-v2.go) that tells the GET path to fetch from the warm backend defined in cmd/tier.go.

On the wire

S3

XML payloads matching the AWS spec. Generated types are in cmd/api-datatypes.go, cmd/api-response.go, and the per-feature files (cmd/object-api-datatypes.go).

Storage REST

MessagePack request/response bodies. Types in cmd/storage-datatypes.go; codec in cmd/storage-datatypes_gen.go.

Peer REST

Smaller msgp + JSON mix. Types in cmd/peer-rest-common.go and cmd/bootstrap-peer-server.go.

Bucket replication

Replication state over the wire is JSON for control endpoints, S3 wire format for object payloads.

IAM and admin

madmin-go (out of tree) carries every admin wire type: madmin.UserInfo, madmin.HealOpts, madmin.SRClusterInfo, etc. The server side translates between these and its internal types.

Metrics

Prometheus text exposition format on the v2 and v3 endpoints; cmd/metrics-v3-types.go defines the runtime structs.

Audit

internal/logger/audit/audit-record.go defines the Entry type. Schema is JSON.

Generated codecs

Every <type>_gen.go file in cmd/ (and in internal/...) is produced by github.com/tinylib/msgp from a //go:generate msgp directive in the matching production file. Don't hand-edit them.

<type>_string.go files are produced by golang.org/x/tools/cmd/stringer for typed enums.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Data models – MinIO wiki | Factory