berk.ai
← Work

Bird · 2018 – 2025

Habitat — Bird’s geospatial operating system

I designed and led Habitat, Bird’s geospatial policy platform — the foundational infrastructure that decided how every scooter behaved across hundreds of cities: pricing, geofences, experiments, product rollouts, emergency shutdowns, and more.

Role: Architect & lead

  • 🌍 Operating system for the physical world
  • 🏙️ Hundreds of cities worldwide
  • ⚡ 10k+ RPS at 7ms p99
  • 🧬 Seven architectural generations
  • Geospatial platforms
  • Policy engines
  • Systems that evolve

Origin

The story

When people think about Bird, they usually think about scooters. What they don’t see is the software that decides how every scooter behaves.

Every ride begins with a question: given this exact GPS location, this rider, this vehicle, this point in time, and the current operational state of the market… how should this scooter behave?

The answer to that question wasn’t hardcoded. It came from Habitat.

I designed and led the development of Habitat, Bird’s geospatial configuration platform that ultimately became one of the company’s foundational infrastructure services. It powered market launches, pricing, feature rollouts, geofences, vehicle capabilities, operational policies, experiments, emergency shutdowns, and hundreds of other configurable behaviors across hundreds of cities worldwide.

Looking back today, I don’t think Habitat was a configuration service. It was an operating system for the physical world.

Collaboration

People I built this with

The people behind this chapter—and the part each of them played in shaping the work.

Justin Balthrop

CTO & Co-Founder, Triangle Health · Former CTO, Bird and Geni

Justin was CTO while Habitat evolved from a small geospatial configuration service into one of Bird's foundational global infrastructure platforms.

Chan Nguyen

Founder, Spartan · Early Bird engineer

Chan and I worked together on Habitat as it grew into foundational infrastructure for Bird. Our technical debates were often intense, but they repeatedly exposed better approaches and helped us arrive at stronger architecture and product decisions.

Prat Kapur

Director, Product at Bird · Engineer turned product leader

Prat led the conceptualization and productization of Habitat's transformation from a configuration-management system into a product-launch platform. The new model organized capabilities as products, features, and settings, giving Product and Operations teams a clearer way to configure launches, markets, and product behavior.

Journey

Seven phases of a platform that learned to scale

01

What if every aspect of the business became configurable?

Bird expanded extremely quickly. Every city had different pricing, currencies, regulations, vehicle capabilities, operational rules, geofences, parking policies, speed limits, products, and experiments.

Hardcoding those behaviors wasn’t sustainable. Every market launch required engineering work. Every pricing change required deployments. Every new feature required code changes.

That model simply couldn’t scale. Instead, we asked a different question: what if every aspect of the business became configurable?

What if every aspect of the business became configurable?
02

Phase 1 — Hierarchical geospatial configuration

The original version of Habitat was intentionally simple. Zones contained configuration. Configurations inherited through geographic hierarchy: Country → City → Neighborhood → Area. Lower-level zones overrode higher-level zones.

Given a GPS coordinate, Habitat would resolve every matching geographic region and merge the resulting configuration into a single response. PostGIS performed the geospatial lookup while JSON configuration merged according to geographic precedence.

Simple. Fast. Highly effective — until Bird kept growing.

  • Country
  • City
  • Neighborhood
  • Area
  • PostGIS geospatial lookup
  • JSON merge by geographic precedence
Habitat Phase 1 diagram showing configuration inherited from country, city, and area zones and merged for a GPS coordinate
Phase 1: exact GPS coordinates resolved overlapping country, city, and area policies into one consolidated response.
03

Phase 2 — Reusable configurations

The next challenge wasn’t performance. It was duplication. Cities shared pricing. Countries shared currencies. Vehicle types shared speed limits. Copying configuration everywhere quickly became unmanageable.

Instead of embedding configuration directly inside zones, I introduced reusable configuration objects attached to one or more geographic regions. Configuration became normalized. Schemas described configurable attributes. Keys described metadata and validation. Configurations became reusable building blocks.

Changing a single configuration could instantly update hundreds of markets simultaneously.

04

Phase 3 — Context-aware configuration

Eventually location alone wasn’t enough. The same location could behave differently depending on vehicle model, mobile platform, day of week, time of day, weather, and operational state.

Habitat introduced request context. Every configuration attachment could now include rules determining whether it should apply — only Bird One scooters, weekdays after 7 PM, iOS only, Android only.

Configuration became conditional instead of static.

  • Vehicle model
  • Mobile platform
  • Day of week / time of day
  • Weather
  • Operational state
Habitat Phase 3 diagram showing conditional configuration applied by geographic hierarchy, vehicle type, and time window
Phase 3: attachments became conditional—vehicle type, time windows, platform, and other request context determined which policies applied.
05

Phase 4 — Experiments

Once configuration became contextual, A/B testing became a natural extension. Product managers could define experiments directly inside Habitat.

Each experiment contained enrollment rules, traffic allocation, experiment groups, and configuration overrides.

Rather than deploying separate code paths, products could be launched gradually, measured, and iterated entirely through configuration.

  • Enrollment rules
  • Traffic allocation
  • Experiment groups
  • Configuration overrides
Habitat Phase 4 experiment configuration showing control and treatment groups applied to first-time riders
Phase 4: experiments became another policy layer, with enrollment rules, weighted groups, and configuration overrides.
06

Phase 5 — Performance

As Bird expanded globally, geographic lookup became one of the platform’s biggest challenges. City boundaries became increasingly detailed. Governments required exact polygon definitions. Approximation wasn’t acceptable.

PostGIS performed well — until it didn’t. Solving that problem was a collaborative effort. I worked with systems engineers and architects—including Chan Nguyen and several other engineers—to move beyond the PostGIS-and-Redis approach and design an in-memory RTree index.

Behind the scenes, we also used Uber’s H3 and Google’s S2 to quickly map coordinates to geographic sectors. In our benchmarks, our RTree implementation outperformed both while preserving the exact polygon resolution the platform required.

The improvement was dramatic.

  • 2,650 zones loaded in 33ms
  • 100,000 spatial lookups in ~2.2s vs 317s+ via PostGIS
  • 1,000,000 lookups in under 8 seconds
  • Benchmarked against Uber H3 and Google S2
Habitat RTree spatial index visualization and benchmark results comparing RTree, PostGIS, and JTS lookups
Phase 5: the in-memory RTree preserved exact boundaries while reducing 100,000 spatial lookups from more than 317 seconds to about 2.2 seconds.
07

Phase 6 — Snapshots

Eventually database performance stopped being the bottleneck. Reading configuration was.

To support thousands of requests per second, Habitat transitioned from database-backed lookups to immutable configuration snapshots. Workers periodically generated complete snapshots of all active configuration, published them to S3, and coordinated rollout through ZooKeeper.

Each service loaded the newest snapshot into in-memory caches before atomically switching traffic. Configuration updates became effectively instantaneous while maintaining consistency across the cluster.

Habitat Phase 6 snapshot architecture connecting admin services, workers, API services, RDS, SQS, ZooKeeper, Redis, and S3
Phase 6: workers published immutable snapshots to S3 while ZooKeeper coordinated a consistent, atomic rollout across API services.
08

Phase 7 — Products instead of keys

This is probably my favorite evolution. Originally Habitat exposed configuration keys. That worked well for engineers — not for Product Managers.

Prat Kapur led the conceptualization and productization of Habitat’s transformation from configuration management into a product-launch platform. His product framing helped turn the underlying technical capabilities into a system that Product and Operations teams could understand and use directly.

So we moved one level higher. Instead of configuring keys, Product Managers configured products. Products contained features. Features contained settings. Settings automatically generated the appropriate configuration UI based on metadata.

Engineers defined capabilities. Product Managers launched products. Operations configured markets. Everyone worked inside the same platform using terminology appropriate to their role.

Habitat product management and market settings interfaces for launching products and configuring generated controls
Phase 7: metadata-driven product and market interfaces translated engineering capabilities into tools Product and Operations could use directly.
Engineers defined capabilities. Product Managers launched products. Operations configured markets.
09

More than configuration — policy

Habitat eventually became the central control plane for Bird. It controlled pricing, geofences, slow-speed zones, no-ride zones, vehicle capabilities, firmware behavior, feature flags, experiments, product rollouts, emergency shutdowns, market launches, and the rider experience.

Every scooter continuously asked Habitat the same fundamental question: given everything I know about this request… how should I behave?

It wasn’t configuration. It was policy.

  • Pricing
  • Geofences / slow zones / no-ride zones
  • Vehicle capabilities & firmware behavior
  • Feature flags & experiments
  • Product rollouts & market launches
  • Emergency shutdowns
10

Looking back

Habitat taught me one of the most valuable lessons of my career. At first glance, it appeared to be a configuration service. In reality, it became something much larger — a policy engine.

Every decision about how a scooter should behave — from pricing and speed limits to experiments, product rollouts, and emergency operational changes — flowed through the same underlying platform.

Looking back, I realize Habitat wasn’t managing configuration. It was managing intent. It allowed engineers to build capabilities once, while enabling Product Managers and Operations teams to continuously evolve business behavior without writing new code.

That’s the kind of platform that quietly disappears into the background — until you realize the business can’t operate without it.

Habitat wasn’t managing configuration. It was managing intent.

Context

The problem and my role

Problem

Bird expanded extremely quickly, and every city had different pricing, currencies, regulations, vehicle capabilities, geofences, parking policies, speed limits, products, and experiments. Hardcoding those behaviors meant every market launch, pricing change, and feature rollout required engineering work — a model that simply couldn’t scale.

Role

Architected and led Habitat from initial concept through seven major architectural generations — geospatial inheritance, reusable configuration, context-aware rules, experiments, RTree spatial indexing, immutable snapshots, and a product-management platform — while continuously evolving the system as Bird scaled from a handful of cities to a global mobility platform.

Constraints

  • Hundreds of cities with different pricing, regulations, geofences, products, and operational rules
  • Market launches, pricing changes, and feature rollouts could not wait on engineering deployments
  • Governments required exact polygon definitions — approximation wasn’t acceptable
  • Configuration lookups had to support thousands of requests per second with low latency
  • Engineers, Product Managers, and Operations needed the same platform in role-appropriate language
  • Each architectural phase had to evolve without throwing away what already worked

System

Architecture

System map

Geographic inheritance

Given a GPS coordinate, Habitat resolved every matching region and merged configuration by geographic precedence — Country → City → Neighborhood → Area.

  1. 01

    GPS coordinate

    Rider, vehicle, and market context enter the request

  2. 02

    Country

  3. 03

    City

  4. 04

    Neighborhood

  5. 05

    Area

    Lower-level zones override higher-level zones

  6. 06

    Merged policy response

    One consolidated configuration for how the scooter should behave

System map

Snapshot delivery at scale

When database reads stopped being enough, immutable snapshots made configuration updates effectively instantaneous while keeping the cluster consistent.

  1. 01

    Configuration workers

    Generate complete snapshots of all active configuration

  2. 02

    S3

    Publish immutable snapshot artifacts

  3. 03

    ZooKeeper

    Coordinate cluster rollout

  4. 04

    API services

    Load the newest snapshot into memory

  5. 05

    Atomic switch

    Flip traffic to the new cache without inconsistency

  6. 06

    Scooters & services

    Resolve policy at thousands of requests per second

System map

From keys to products

The final abstraction let each role work in its own language inside the same platform.

  1. 01

    Engineers

    Define capabilities, schemas, and validation

  2. 02

    Products

    Product Managers compose features into launchable products

  3. 03

    Features & settings

    Metadata generates the configuration UI

  4. 04

    Operations

    Configure markets, zones, and policy without code

  5. 05

    Live fleet behavior

    Scooters continuously ask Habitat how to behave

Execution

What I built

  • Conceived and led Habitat from a hierarchical geospatial configuration engine into Bird’s foundational policy platform across hundreds of cities.
  • Evolved the system through seven major architectural phases without rewriting from scratch — preserving compatibility while solving each new scaling challenge.
  • Built reusable configuration objects, schemas, and validation so one change could update hundreds of markets.
  • Added request context and a rule engine so behavior could depend on vehicle, platform, time, weather, and operational state.
  • Embedded experimentation — enrollment, traffic allocation, groups, and overrides — directly into the configuration platform.
  • Worked with Chan Nguyen, systems engineers, and architects to replace the PostGIS-and-Redis hot path with an in-memory RTree spatial index, benchmarking it against Uber H3 and Google S2.
  • Moved reads to immutable S3 snapshots coordinated through ZooKeeper for thousands of RPS with cluster-wide consistency.
  • Raised the abstraction from configuration keys to products, features, and settings so PMs and Ops could launch markets in their own language.
  • Built backend APIs and React administration applications for market operations and product management.

Tradeoffs

Technical decisions

Evolve the architecture instead of rewriting it

Decision
Grow Habitat through seven major phases — hierarchy, reuse, context, experiments, RTree indexing, snapshots, and products — while preserving compatibility.
Why
Each phase solved a real scaling challenge Bird encountered. Throwing away Phase 1 would have destroyed institutional knowledge and operational continuity.
Tradeoff
Evolutionary architecture requires careful compatibility and migration work, but compounds into a platform the business can keep extending.

Policy for the physical world, not app settings

Decision
Model pricing, geofences, vehicle capabilities, experiments, launches, and emergency controls as geospatial policy resolved per request.
Why
Scooter behavior is inherently location-, vehicle-, and context-dependent. A generic key/value config store couldn’t express that safely at global scale.
Tradeoff
A policy engine becomes critical infrastructure — schema, validation, and operational discipline matter as much as lookup performance.

Exact geography with an in-memory spatial index

Decision
Working across architecture and systems engineering, replace the PostGIS-and-Redis lookup path with an in-memory RTree while also evaluating Uber H3 and Google S2 for fast coordinate-to-sector mapping.
Why
Regulatory and operational correctness required precise polygons. H3 and S2 offered fast sector lookup, but our RTree implementation delivered better benchmark performance while retaining exact boundary resolution.
Tradeoff
The custom in-memory index added memory, synchronization, and invalidation complexity, but delivered orders-of-magnitude faster spatial resolution.

Immutable snapshots for read-heavy scale

Decision
Publish complete configuration snapshots to S3 and coordinate atomic cluster rollout through ZooKeeper.
Why
Thousands of RPS needed consistent, low-latency reads that database-backed lookups couldn’t sustain.
Tradeoff
Snapshot generation and rollout coordination add operational machinery, but made updates effectively instantaneous across the fleet of services.

Raise the abstraction to products

Decision
Move from engineer-facing configuration keys to products, features, and settings with metadata-driven UI.
Why
Product Managers and Operations needed to launch and operate markets in their own language without waiting on engineers for every change.
Tradeoff
Higher abstractions require stronger schemas and governance, but unlock true cross-functional autonomy inside one platform.

Value

Product impact

User impact

Let Product Managers and Operations launch markets, change pricing, define zones, run experiments, and respond to emergencies without engineering deployments — while scooters continuously resolved live policy from GPS and context.

Business impact

Turned Bird’s global expansion into a configurable policy platform: engineers built capabilities once; the business continuously evolved behavior across hundreds of cities through Habitat.

Results

Outcomes

  • Habitat became Bird’s operating system for the physical world — policy for pricing, zones, capabilities, experiments, launches, and emergency controls.
  • Core APIs handled over 10,000 requests per second with 7ms p99 latency while scaling across Kubernetes pods.
  • In-memory RTree indexing loaded 2,650 zones in 33ms and completed 100k spatial lookups in ~2.2s versus 317s+ via direct PostGIS.
  • Product, Operations, and Engineering could evolve market behavior through one platform without waiting on code deployments for every change.
  • Seven architectural generations demonstrated a career-defining pattern: design systems that evolve instead of systems that get rewritten.

Notes

Notes from the system

Not configuration — policy

Pricing, geofences, vehicle capabilities, experiments, product rollouts, and emergency shutdowns all flowed through Habitat. Every scooter kept asking the same question: given everything I know… how should I behave?

Systems that evolve

Phase 1 wasn’t thrown away when Bird grew. It became Phase 2, then 3, then 4. By Phase 7, readers aren’t just looking at software — they’re watching architectural thinking mature over years.

Reflection

Lessons learned

  • The highest-leverage platforms manage intent — they let engineers build capabilities once while other teams continuously evolve business behavior.
  • Great architecture isn’t a single design. It’s a sequence of evolutions that absorb new scale without discarding what already works.

Tools

Stack

KotlinDropwizardKubernetes (EKS)ECSDockerPostgreSQLPostGISRedisKafkaApache FlinkSQSZooKeeperS3TerraformHelmJenkinsDatadogMetabaseReactRTree spatial indexingUber H3Google S2Geospatial policy engine