Skip to content

Widhian Bramantya

coding is an art form

Menu
  • About Me
Menu
nats

Object Store in NATS: Storing Files and Blobs

Posted on September 6, 2025September 6, 2025 by admin

In the last article, we talked about the NATS Key-Value Store (KV), which is great for lightweight configuration and state management. But what if you need to store something larger, like a file, image, or binary data? For that, NATS provides the Object Store, also built on top of JetStream.

What is the Object Store?

The Object Store is a way to store and retrieve large binary objects in NATS.

  • Objects can be anything: documents, images, JSON files, backups.
  • Each object has a name and optional metadata.
  • Objects are split into chunks and stored in JetStream streams.

This makes it possible to use NATS not only for messaging, but also for managing distributed storage.

Why Use Object Store?

  1. Centralized Storage in Distributed Systems
    • Store configuration files, ML models, or static assets directly in NATS.
  2. Versioned Objects
    • Like KV, object store supports history of updates.
  3. Reactive Updates
    • Other services can watch for changes and get notified when a new object version is available.
  4. Integration with Messaging
    • Since it’s part of NATS, you can combine objects with pub/sub, request–reply, or queue groups.

NATS Object Store vs S3/MinIO

It’s natural to compare NATS Object Store with popular object storage systems like Amazon S3 or MinIO. While they share the idea of storing objects (files, blobs), their goals and strengths are different.

AspectNATS Object StoreS3 / MinIO
Built onJetStream (messaging + persistence)Distributed object storage layer
Data sizeSmall to medium objects (KBs → few MBs)Large objects (GBs → TBs)
AccessThrough NATS clients (Go, Node.js, Python, etc.)REST API (HTTP/HTTPS, SDKs)
Real-time watchNative — services can Watch and react immediatelyNot built-in; usually requires polling or event integration (like S3 Event Notifications)
VersioningBuilt-in, with history of object updatesSupported, but more for archival and compliance
IntegrationTight with NATS messaging (pub/sub, KV, streams)General-purpose storage, works independently
PerformanceVery low-latency for distributed systemsHigh throughput for large-scale file storage
Use caseShare configs, ML models, backups inside NATS ecosystemStore massive data sets, media files, long-term archives

Example Perspective

  • NATS Object Store:
    • A machine learning team stores the latest model (ml_model.pkl) in NATS.
    • Prediction workers watch the bucket and automatically reload when the model changes.
    • Perfect for fast updates and small-to-medium files inside a NATS-powered system.
  • S3 / MinIO:
    • A video platform stores user uploads (gigabytes each) in S3.
    • CDN services then deliver those files to end users.
    • Perfect for large-scale storage, archival, and global delivery.
See also  Publish–Subscribe in NATS: Simple and Powerful Messaging

Related posts:

NATS JetStream: Persistence and Streaming Made Simple

Request–Reply in NATS: One-to-One Messaging

Queue Groups in NATS: Load Balancing for Subscribers

Pages: 1 2
Category: NATS

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Linkedin

Widhian Bramantya

Recent Posts

  • Smart Automation in PostgreSQL: Managing Time-Based Data with pg_partman and pg_cron
  • Understanding PostgreSQL WAL, Slot, Publication, LSN, and Replication Lag
  • PostgreSQL Write-Ahead Log (WAL): Durability, Performance Tuning, and Recovery Explained
  • PostgreSQL Replication Deep Dive: From High Availability to Multi-Master Clusters
  • Finding Nearby Merchants in a Ride-Hailing App Using Elasticsearch Polygon Search
  • Advanced Text Search in Elasticsearch: N-Gram, Reverse, Fuzzy, and Search-as-you-type
  • Understanding and Customizing Analyzers in Elasticsearch
  • Log Management at Scale: Integrating Elasticsearch with Beats, Logstash, and Kibana
  • Index Lifecycle Management (ILM) in Elasticsearch: Automatic Data Control Made Simple
  • Blue-Green Deployment in Elasticsearch: Safe Reindexing and Zero-Downtime Upgrades
  • Maintaining Super Large Datasets in Elasticsearch
  • Elasticsearch Best Practices for Beginners
  • Implementing the Outbox Pattern with Debezium
  • Production-Grade Debezium Connector with Kafka (Postgres Outbox Example – E-Commerce Orders)
  • Connecting Debezium with Kafka for Real-Time Streaming
  • Debezium Architecture – How It Works and Core Components
  • What is Debezium? – An Introduction to Change Data Capture
  • Offset Management and Consumer Groups in Kafka
  • Partitions, Replication, and Fault Tolerance in Kafka
  • Delivery Semantics in Kafka: At Most Once, At Least Once, Exactly Once

Recent Comments

No comments to show.

Archives

  • October 2025
  • September 2025
  • August 2025
  • November 2021
  • October 2021
  • August 2021
  • July 2021
  • June 2021
  • March 2021
  • January 2021

Categories

  • Debezium
  • Devops
  • ElasticSearch
  • Golang
  • Kafka
  • Lua
  • NATS
  • PostgreSQL
  • Programming
  • RabbitMQ
  • Redis
  • VPC
© 2026 Widhian Bramantya | Powered by Minimalist Blog WordPress Theme