Product
February 12, 2025

Scaling with Viam using fragments and nested fragments: A smarter way to build and deploy at scale

Natalia Jacobowitz
Product Manager

Introduction: Why nested fragments matter

Managing fleets of thousands of machines requires a scalable approach. Without a structured way to handle machine configurations, updates become chaotic, version control gets messy, and keeping track of changes across machines becomes overwhelming.

That’s why we built nested fragments.

What are nested fragments?

To understand Nested Fragments, let’s start with a quick refresher on fragments.

Fragments are reusable pieces of configuration that simplify fleet management. They allow teams to implement seamless updates, simplify version control, and track changes efficiently. Rather than maintaining separate configurations for each machine, teams can create a fragment once and reuse it across their fleet.

A simple nested fragments graphic, showing simple relationship between security fragment, sensors fragment, main v2 fragment

Nested fragments take this further by allowing fragments to reference other fragments, making complex machine architectures easier to manage. With this approach, teams can modularize configurations into logical building blocks while maintaining a streamlined parent structure.

Why this is a game-changer

Nested Fragments unlock several benefits that make managing complex machine fleets more efficient:

1. Modular, reusable, and scalable

  • Build once, reuse everywhere—ideal for companies managing different machine models.
  • Create a fragment that references other fragments. This approach allows you to swap out sub-fragments whenever you need, promoting development agile.
  • Gain a clear understanding of your machine by viewing the complete configuration of each machine, including all fragments and sub-fragments.
  • Users can overwrite attributes within a sub-fragment for customization, ensuring flexibility without losing modularity.

2. Seamless updates across fleets

  • Modify a single sub-fragment, and the update propagates across all machines that reference it, just as with standard fragments.
  • The key advantage of Nested Fragments is that updates to deeply embedded components are automatically reflected in all parent fragments, streamlining configuration management.
  • No need for manual reconfigurations—just update once and deploy effortlessly across complex, layered configurations.

3. Better organization for complex machines

A scale-focused fragments graphic demonstrating concept of a large number of machines using fragments.

Imagine an air-purifying robot–let’s call it PuraBot–as an example. PuraBot drives around your office or home, monitoring and cleaning the air. Equipped with cameras, it can navigate safely and avoid collisions with people.

At the PuraBot office headquarters one team manages a security fragment that handles cameras, machine learning, and vision services, while another team develops the motor and base fragments, ensuring clear separation of responsibilities. Each PuraBot model has its own distinct motor and base fragment—one for PuraBot V1 and another for PuraBot V2—tailored to their respective hardware. These unique fragments are then integrated into separate parent fragments, one for each PuraBot model, ensuring that updates to individual components remain modular and independent.

When the security fragment is improved, both PuraBot models automatically inherit the changes, while motor and base updates remain isolated to their respective versions. At scale, PuraBot only needs to deploy one of the parent fragments, enabling effortless management of 1,000+ robots while maintaining a structured and modular approach.

Sign Up

Who benefits from nested fragments?

Nested Fragments are built for scalability, collaboration, and efficiency. They benefit:

  • Companies managing large fleets (from tens to thousands of machines).
  • Teams working on multiple versions of a machine (V1, V2, etc.).
  • Developers who want reusability across different projects.
  • Collaborators & open-source users—Developers can reference and extend fragments built by other teams within their own configurations or use publicly available fragments from the community while layering in custom logic.

Closing thoughts: the future of automation at scale

Nested fragments simplify fleet management, improve collaboration, and streamline scalability by enhancing modularity and reusability. Whether managing a single machine or a global fleet, this feature ensures configurations remain adaptable, efficient, and easy to maintain. Start using nested fragments today.

twitter iconfacebook iconlinkedin iconreddit icon

Find us at our next event

Apr 3, 2025
Apr 3, 2025
,

DotJS

In Person
Paris, France
JavaScript developers are invited to join Viam in Paris to learn how to overcome challenges of working with code in the physical world.
Join Us
Apr 15, 2025
Apr 15, 2025
,
03:00-04:00 PM EST

LIVESTREAM: Build a self-checkout with computer vision

Virtual
Build a real-time people detector using computer vision and a piezo buzzer with Adrienne and Nick from Viam's DevRel team in this hands-on livestream.
Watch live!
Apr 17, 2025
Apr 17, 2025
,
06:30 - 09:30 PM EST

NY Hardware April 2025 MeetUp

In Person
1900 Broadway Floor 6 New York, NY
Join us at the Viam office for the next NY Hardware Meetup! Viam Product Manager, Esha Maharishi, will be doing a live demo, and there will be plenty of time to connect with fellow hardware enthusiasts. Whether you're deep in the industry or just curious, come by for great conversations, hands-on tech, and free food and drinks!
Sign Up