/plushcap/analysis/vercel/vercel-a-deep-dive-into-hive-vercels-builds-infrastructure

A deep dive into Hive: Vercel’s builds infrastructure

What's this blog post about?

Hive is a low-level untrusted and ephemeral compute platform designed by Vercel to securely manage and run builds efficiently. Since November 2023, it has been powering Vercel's builds, resulting in enhanced build machines and a 30% improvement in build performance. Hive is architected to handle multiple use cases and can be composed in different ways depending on the requirements. It operates on the fundamental assumption that potentially malicious code will be executed on multi-tenant machines, requiring it to be safe, reliable, performant, and cost-effective. Inside Hive, there are several key components working together to handle everything from code execution to scaling. These include hives (clusters running in a specific region), boxes (bare metal machines that run the virtual machines in Hive), cells (virtual machines inside each box), control plane (orchestrates the cluster and manages job placement, autoscaling, instance lifecycles, monitoring, and overall cluster health), and API (manages requests to run cells). The inner workings of Hive involve an orchestrated system that ensures secure, isolated, and efficient execution of customer builds. At the core, each box in Hive runs a Kernel-based Virtual Machine (KVM) which is a full virtualization solution for Linux on x86 hardware. On top of this KVM layer, multiple Firecracker processes are run, creating microVMs called cells. The life of a build involves the build pipeline selecting the appropriate hive cluster based on the customer and build configuration. It uses the Hive API to run the build inside a container within a cell. The overall architecture allows Hive to balance secure isolation, fast startup times, and scalability required for customer builds while minimizing overhead and optimizing performance. Since adopting Hive, there has been a 20% reduction in build times compared to the previous solution, with provisioning times dropping from nearly 90 seconds to 5 seconds and build times decreasing by 40%. The platform continues to improve and explore new use cases to unlock more value for developers.

Company
Vercel

Date published
Oct. 30, 2024

Author(s)
-

Word count
1094

Hacker News points
None found.

Language
English


By Matt Makai. 2021-2024.