<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Nico</title>
    <description>The latest articles on Forem by Nico (@ndreno).</description>
    <link>https://forem.com/ndreno</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3904839%2Fa5266afe-04b3-485a-8976-4c493aca11b0.png</url>
      <title>Forem: Nico</title>
      <link>https://forem.com/ndreno</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ndreno"/>
    <language>en</language>
    <item>
      <title>One gateway, many specs: how Barbacane unifies your API ecosystem</title>
      <dc:creator>Nico</dc:creator>
      <pubDate>Tue, 05 May 2026 08:04:12 +0000</pubDate>
      <link>https://forem.com/ndreno/one-gateway-many-specs-how-barbacane-unifies-your-api-ecosystem-1gg8</link>
      <guid>https://forem.com/ndreno/one-gateway-many-specs-how-barbacane-unifies-your-api-ecosystem-1gg8</guid>
      <description>&lt;p&gt;&lt;em&gt;Most API tooling assumes one repository, one specification. But your architecture doesn't work that way.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In our &lt;a href="https://barbacane.dev/blog/beyond-configuration-drift/" rel="noopener noreferrer"&gt;previous article&lt;/a&gt;, we explored how Barbacane eliminates configuration drift by compiling your OpenAPI spec directly into the gateway's runtime artifact. One spec, one &lt;code&gt;.bca&lt;/code&gt; file, zero drift.&lt;/p&gt;

&lt;p&gt;But what happens when your architecture has more than one spec?&lt;/p&gt;




&lt;h3&gt;
  
  
  The Multi-Spec Reality
&lt;/h3&gt;

&lt;p&gt;In a typical microservices setup, your API surface isn't described by a single file. Whether you're working contract-first or generating specs from code, you end up with multiple specifications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;User Service&lt;/strong&gt; with its own &lt;code&gt;openapi.yaml&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;Order Service&lt;/strong&gt; with its own &lt;code&gt;openapi.yaml&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;Inventory Service&lt;/strong&gt; exposing both REST endpoints and event consumers, described across OpenAPI and AsyncAPI files&lt;/li&gt;
&lt;li&gt;Event schemas scattered across repos&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each file is validated in isolation, deployed independently, and versioned on its own timeline. Single-spec tools can't see across these boundaries, so cross-service mismatches only surface at runtime. The feedback loop is as slow as it gets: write specs, deploy, discover the conflict in production, fix, redeploy.&lt;/p&gt;




&lt;h3&gt;
  
  
  One Command, Multiple Specs
&lt;/h3&gt;

&lt;p&gt;Barbacane's &lt;code&gt;compile&lt;/code&gt; command accepts multiple specification files in a single invocation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;barbacane compile &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; services/user-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; services/order-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; services/inventory-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; services/inventory-service/asyncapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-m&lt;/span&gt; barbacane.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; gateway.bca
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The compiler parses every file (OpenAPI 3.x and AsyncAPI 3.0.x) and merges their routes into a single &lt;code&gt;.bca&lt;/code&gt; artifact. The output message tells you exactly what you got:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;compiled 4 spec(s) to gateway.bca (23 routes, 5 plugin(s) bundled)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One artifact. One routing table. One deployment.&lt;/p&gt;




&lt;h3&gt;
  
  
  What Multi-Spec Compilation Actually Does
&lt;/h3&gt;

&lt;p&gt;When you pass multiple specs, the compiler:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Parses each file independently.&lt;/strong&gt; OpenAPI and AsyncAPI specs are each validated against their respective standards.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Merges routes into a unified routing table.&lt;/strong&gt; All operations from all specs end up in a single &lt;code&gt;routes.json&lt;/code&gt; inside the &lt;code&gt;.bca&lt;/code&gt; artifact. The gateway doesn't care which file a route came from; it serves them all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Detects routing conflicts.&lt;/strong&gt; If two specs define the same path and method combination (e.g., both declare &lt;code&gt;GET /users/{id}&lt;/code&gt;), compilation fails with error &lt;code&gt;E1010&lt;/code&gt;. This is a hard gate: you cannot produce an artifact with ambiguous routing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bundles everything together.&lt;/strong&gt; WASM plugins, dispatcher configurations, and the original source specs are all packaged into the artifact. The source specs remain accessible at &lt;code&gt;/__barbacane/specs&lt;/code&gt; for documentation and debugging.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This isn't magic. It's the same compilation pipeline applied across multiple input files. But the practical impact is a meaningful &lt;strong&gt;shift left&lt;/strong&gt;: routing conflicts that would previously surface as mysterious 404s or wrong-handler bugs in production now fail your build.&lt;/p&gt;




&lt;h3&gt;
  
  
  Specs Stay Accessible at Runtime
&lt;/h3&gt;

&lt;p&gt;Compilation merges routes, but the original source specs aren't thrown away. They're embedded in the &lt;code&gt;.bca&lt;/code&gt; artifact and served by the gateway at &lt;code&gt;/__barbacane/specs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /__barbacane/specs
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns an index of every spec that was compiled into the running artifact, with links to the full OpenAPI and AsyncAPI documents. The served specs are stripped of Barbacane-specific extensions (&lt;code&gt;x-barbacane-*&lt;/code&gt;), so what your API consumers and documentation tools see is clean, standard OpenAPI and AsyncAPI with no vendor-specific noise. And because these are the exact specs that were compiled, they can't drift from what the gateway is actually running.&lt;/p&gt;

&lt;p&gt;No separate spec hosting. No stale docs. The gateway &lt;em&gt;is&lt;/em&gt; the documentation server.&lt;/p&gt;




&lt;h3&gt;
  
  
  A Practical Example
&lt;/h3&gt;

&lt;p&gt;Consider an e-commerce platform with four services:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Service      → openapi.yaml
Order Service     → openapi.yaml
Inventory Service → openapi.yaml + asyncapi.yaml
Notification Svc  → asyncapi.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without multi-spec compilation, you'd deploy each service's gateway configuration independently, trusting that teams coordinated their path prefixes and schema versions. With Barbacane:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;barbacane compile &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; services/user-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; services/order-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; services/inventory-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; services/inventory-service/asyncapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; services/notification-service/asyncapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-m&lt;/span&gt; barbacane.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; gateway.bca
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the Order Service accidentally defines a route that collides with the User Service, compilation fails. You find out in seconds, not after a deploy.&lt;/p&gt;




&lt;h3&gt;
  
  
  CI/CD Integration
&lt;/h3&gt;

&lt;p&gt;Multi-spec compilation fits naturally into a CI gate. Block merges to &lt;code&gt;main&lt;/code&gt; if the combined specs don't compile cleanly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/validate-contracts.yml&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;validate&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Compile gateway artifact&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;barbacane compile \&lt;/span&gt;
            &lt;span class="s"&gt;-s services/user-service/openapi.yaml \&lt;/span&gt;
            &lt;span class="s"&gt;-s services/order-service/openapi.yaml \&lt;/span&gt;
            &lt;span class="s"&gt;-s services/inventory-service/openapi.yaml \&lt;/span&gt;
            &lt;span class="s"&gt;-s services/inventory-service/asyncapi.yaml \&lt;/span&gt;
            &lt;span class="s"&gt;-m barbacane.yaml \&lt;/span&gt;
            &lt;span class="s"&gt;-o gateway.bca&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A non-zero exit code (1 for validation failures, 2 for manifest errors) blocks the pipeline. No ambiguous warnings: either the specs compile together, or they don't.&lt;/p&gt;




&lt;h3&gt;
  
  
  Progressive Adoption
&lt;/h3&gt;

&lt;p&gt;You don't have to compile everything at once. Start with your most critical services and expand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start with two services&lt;/span&gt;
barbacane compile &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; user-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; auth-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-m&lt;/span&gt; barbacane.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; gateway.bca

&lt;span class="c"&gt;# Later, add event-driven services&lt;/span&gt;
barbacane compile &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; user-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; auth-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; order-service/openapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-s&lt;/span&gt; order-service/asyncapi.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-m&lt;/span&gt; barbacane.yaml &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; gateway.bca
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each additional spec increases the surface area of conflict detection. The more specs you compile together, the more mismatches you catch before deployment.&lt;/p&gt;




&lt;h3&gt;
  
  
  Strengths and Limitations
&lt;/h3&gt;

&lt;p&gt;Multi-spec compilation extends the "compile, don't configure" philosophy across service boundaries, but it's worth understanding what it does and doesn't do today.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it catches:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Routing conflicts (duplicate path + method across specs)&lt;/li&gt;
&lt;li&gt;Spec-level validation errors (malformed OpenAPI/AsyncAPI)&lt;/li&gt;
&lt;li&gt;Missing plugin or dispatcher declarations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What it doesn't do (yet):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cross-spec schema validation (e.g., verifying that an &lt;code&gt;Order&lt;/code&gt; object is consistent between two specs)&lt;/li&gt;
&lt;li&gt;Breaking change detection between spec versions&lt;/li&gt;
&lt;li&gt;Dependency graph analysis between services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are real limitations. Multi-spec compilation today is primarily about &lt;em&gt;route-level unification and conflict detection&lt;/em&gt;, not deep semantic analysis across your API ecosystem. For schema consistency, you'll still need complementary tooling or careful code review.&lt;/p&gt;




&lt;h3&gt;
  
  
  Shifting Left Across Service Boundaries
&lt;/h3&gt;

&lt;p&gt;The idea behind "shift left" is simple: catch problems earlier in the development lifecycle, when they're cheapest to fix. Linters shift left on code quality. Type systems shift left on correctness. Multi-spec compilation shifts left on &lt;em&gt;cross-service integration&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;In our &lt;a href="https://barbacane.dev/blog/beyond-configuration-drift/" rel="noopener noreferrer"&gt;previous article&lt;/a&gt;, we showed how Barbacane shifts gateway configuration left by compiling the spec into the runtime artifact. Multi-spec compilation takes this further: instead of discovering that two services disagree on routing after deployment, you discover it at compile time, in CI, on a pull request.&lt;/p&gt;

&lt;p&gt;It's not a silver bullet. Cross-service consistency is a hard problem, and route-level conflict detection is just one piece of the puzzle. But it's a piece that most gateway tooling doesn't offer at all, and one that pays off immediately in any multi-service architecture. The earlier you catch a conflict, the less it costs.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Barbacane is open source and available at &lt;a href="https://github.com/barbacane-dev/barbacane" rel="noopener noreferrer"&gt;github.com/barbacane-dev/barbacane&lt;/a&gt;. Check the &lt;a href="https://docs.barbacane.dev/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; for the full CLI reference and getting started guide.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>barbacane</category>
      <category>apigateway</category>
      <category>openapi</category>
      <category>asyncapi</category>
    </item>
    <item>
      <title>Beyond configuration drift: how Barbacane reimagines the API gateway with Rust and WASM</title>
      <dc:creator>Nico</dc:creator>
      <pubDate>Wed, 29 Apr 2026 18:54:22 +0000</pubDate>
      <link>https://forem.com/ndreno/beyond-configuration-drift-how-barbacane-reimagines-the-api-gateway-with-rust-and-wasm-god</link>
      <guid>https://forem.com/ndreno/beyond-configuration-drift-how-barbacane-reimagines-the-api-gateway-with-rust-and-wasm-god</guid>
      <description>&lt;p&gt;&lt;em&gt;What if your OpenAPI spec wasn't just documentation, but the actual configuration of your production gateway?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For years, API teams have lived with a quiet frustration: the gap between specification and reality. You write a beautiful OpenAPI spec. You configure your gateway (Kong, Tyk, AWS API Gateway) with routes, plugins, and security rules. And then… drift happens. A hotfix bypasses the spec. A plugin gets misconfigured. The documentation lies. The gateway behaves unexpectedly. The contract between frontend and backend fractures.&lt;/p&gt;

&lt;p&gt;This isn't a people problem. It's an architecture problem.&lt;/p&gt;

&lt;p&gt;Enter &lt;strong&gt;Barbacane&lt;/strong&gt;, a spec-driven API gateway built in Rust that treats your OpenAPI (and AsyncAPI) specification as the &lt;em&gt;single source of truth&lt;/em&gt;. No separate configuration files. No UI clicks that diverge from Git. Just your spec, compiled into a self-contained artifact that runs at the edge with memory safety guarantees and sub-millisecond latency.&lt;/p&gt;

&lt;p&gt;Let's dive into why this approach matters, and whether it's ready for your production workloads.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Configuration Drift Crisis
&lt;/h3&gt;

&lt;p&gt;Most API gateways follow the same pattern:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You write an OpenAPI spec (hopefully)&lt;/li&gt;
&lt;li&gt;You &lt;em&gt;separately&lt;/em&gt; configure the gateway via YAML, UI, or CLI&lt;/li&gt;
&lt;li&gt;You hope these two artifacts stay in sync&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This dual-source model creates inevitable drift:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# openapi.yaml&lt;/span&gt;
&lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;/users/{id}&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;security&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[{&lt;/span&gt; &lt;span class="nv"&gt;jwt&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[]&lt;/span&gt; &lt;span class="pi"&gt;}]&lt;/span&gt;

&lt;span class="c1"&gt;# kong.yaml (oops, forgot to add auth plugin!)&lt;/span&gt;
&lt;span class="na"&gt;routes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;users-get&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;/users/&lt;/span&gt;&lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;}]&lt;/span&gt;
    &lt;span class="c1"&gt;# missing jwt-auth plugin configuration&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result? A route that &lt;em&gt;should&lt;/em&gt; require authentication ships to production wide open. Security teams panic. Post-mortems happen. Trust erodes.&lt;/p&gt;

&lt;p&gt;Barbacane eliminates this entire class of failure by making drift &lt;em&gt;architecturally impossible&lt;/em&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Core Insight: Compile, Don't Configure
&lt;/h3&gt;

&lt;p&gt;Barbacane's philosophy is radical in its simplicity:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Your spec is your gateway.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of parsing specs at runtime or maintaining parallel configuration, Barbacane introduces a &lt;em&gt;compilation step&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Step 1: Write your spec (as usual)&lt;/span&gt;
openapi: 3.1.0
info:
  title: User API
  version: 1.0.0
x-barbacane-plugins:
  - name: oidc-auth
    config:
      issuer_url: &lt;span class="s2"&gt;"https://auth.example.com"&lt;/span&gt;
      audience: &lt;span class="s2"&gt;"my-api"&lt;/span&gt;

&lt;span class="c"&gt;# Step 2: Compile it&lt;/span&gt;
barbacane compile &lt;span class="nt"&gt;--spec&lt;/span&gt; openapi.yaml &lt;span class="nt"&gt;--manifest&lt;/span&gt; barbacane.yaml &lt;span class="nt"&gt;--output&lt;/span&gt; api.bca

&lt;span class="c"&gt;# Step 3: Run the gateway&lt;/span&gt;
barbacane serve &lt;span class="nt"&gt;--artifact&lt;/span&gt; api.bca
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.bca&lt;/code&gt; artifact is a self-contained binary bundle:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pre-compiled routing trie (FlatBuffers, zero-copy deserialization)&lt;/li&gt;
&lt;li&gt;JSON Schema validators for request/response validation&lt;/li&gt;
&lt;li&gt;WASM plugins (including your auth middleware)&lt;/li&gt;
&lt;li&gt;OPA policies for fine-grained authorization&lt;/li&gt;
&lt;li&gt;Dispatcher configurations (HTTP upstreams, Lambda, Kafka)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Critically: &lt;strong&gt;no runtime spec parsing&lt;/strong&gt;. The gateway starts in &amp;lt;100ms because everything is pre-optimized. What you compile is exactly what runs. No surprises.&lt;/p&gt;




&lt;h3&gt;
  
  
  Architecture Deep Dive: Control Plane vs. Data Plane
&lt;/h3&gt;

&lt;p&gt;Barbacane cleanly separates concerns:&lt;/p&gt;

&lt;h4&gt;
  
  
  The Control Plane (&lt;code&gt;barbacane-control&lt;/code&gt;)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Stateful service (PostgreSQL-backed)&lt;/li&gt;
&lt;li&gt;Handles spec ingestion, validation, and compilation&lt;/li&gt;
&lt;li&gt;Serves artifacts to data planes&lt;/li&gt;
&lt;li&gt;Provides UI for fleet visibility&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  The Data Plane (&lt;code&gt;barbacane&lt;/code&gt;)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Completely stateless&lt;/strong&gt; single binary&lt;/li&gt;
&lt;li&gt;Loads &lt;code&gt;.bca&lt;/code&gt; artifact at startup (memory-mapped via FlatBuffers)&lt;/li&gt;
&lt;li&gt;Zero runtime dependencies&lt;/li&gt;
&lt;li&gt;Optional WebSocket connection to control plane for health reporting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This separation enables true edge deployment: ship a 15MB static binary with your compiled artifact to a CDN POP, and it runs independently. No coordination required. Scale horizontally by launching more binaries. No consensus protocols. No distributed state.&lt;/p&gt;




&lt;h3&gt;
  
  
  WASM Plugins: Safety Without Sacrifice
&lt;/h3&gt;

&lt;p&gt;Barbacane ships as a "bare binary" with &lt;strong&gt;zero bundled plugins&lt;/strong&gt;. Every capability (JWT auth, rate limiting, CORS) is implemented as a WASM module explicitly declared in your spec:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;x-barbacane-plugins&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rate-limit&lt;/span&gt;
    &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;quota&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;
      &lt;span class="na"&gt;window&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;
      &lt;span class="na"&gt;partition_key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;header:x-api-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During compilation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Plugin is fetched from registry (or local cache)&lt;/li&gt;
&lt;li&gt;Validated against spec requirements&lt;/li&gt;
&lt;li&gt;Bundled into the &lt;code&gt;.bca&lt;/code&gt; artifact&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At runtime:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plugins execute in a &lt;code&gt;wasmtime&lt;/code&gt; sandbox with strict resource limits&lt;/li&gt;
&lt;li&gt;Memory isolation prevents plugin crashes from taking down the gateway&lt;/li&gt;
&lt;li&gt;Host functions are capability-gated (e.g., vault access requires explicit grant)&lt;/li&gt;
&lt;li&gt;Execution timeouts prevent CPU starvation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This model delivers what Lua plugins in Kong &lt;em&gt;wish&lt;/em&gt; they had: true isolation without sacrificing performance. Benchmarks show 261us overhead per WASM middleware invocation, including instantiation, on modern hardware.&lt;/p&gt;




&lt;h3&gt;
  
  
  Security by Construction
&lt;/h3&gt;

&lt;p&gt;Barbacane's security model is defense-in-depth by design:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Mechanism&lt;/th&gt;
&lt;th&gt;Why It Matters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Memory Safety&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Rust + WASM sandbox&lt;/td&gt;
&lt;td&gt;Eliminates entire classes of CVEs (buffer overflows, use-after-free)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Secrets Management&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Vault fetch at startup only&lt;/td&gt;
&lt;td&gt;No secrets in Git, specs, or artifacts. Only in runtime memory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AuthN/AuthZ&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Plugin-based + OPA&lt;/td&gt;
&lt;td&gt;No vendor lock-in; policies compiled to WASM for speed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Compilation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Fail-fast validation&lt;/td&gt;
&lt;td&gt;Blocks dangerous configs early (e.g., &lt;code&gt;http://&lt;/code&gt; backends in prod)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Transport&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Rustls (no OpenSSL)&lt;/td&gt;
&lt;td&gt;Memory-safe TLS with modern crypto defaults&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For secrets, specs reference them by ID only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;x-barbacane-dispatcher&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http-upstream&lt;/span&gt;
  &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://backend.example.com"&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bearer&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;vault://prod/api-gateway/backend-token&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At startup, the data plane fetches secrets from a secret manager, never storing them on disk. Rotate keys in your secret manager, and the gateway picks up new values on next restart (or via periodic refresh).&lt;/p&gt;




&lt;h3&gt;
  
  
  Performance: Why FlatBuffers Matters
&lt;/h3&gt;

&lt;p&gt;Most gateways deserialize JSON configs at startup. For small specs, this is fine. For large specs (500+ routes, complex schemas), it becomes a bottleneck.&lt;/p&gt;

&lt;p&gt;Barbacane uses &lt;strong&gt;FlatBuffers&lt;/strong&gt; for its artifact format, a choice that pays dividends:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero-copy deserialization&lt;/strong&gt;: Memory-map the artifact and access data directly&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Startup in &amp;lt;100ms&lt;/strong&gt;: Even for 1,000-route specs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No GC pressure&lt;/strong&gt;: Critical for latency-sensitive edge workloads&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schema evolution&lt;/strong&gt;: Backward/forward compatibility built-in&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Benchmarks show route lookup in &lt;strong&gt;83 nanoseconds&lt;/strong&gt; for 1,000 routes, faster than a single L3 cache miss. Full request validation (parameters + body schema) averages &lt;strong&gt;1.2 microseconds&lt;/strong&gt;. This isn't theoretical; it's the difference between viable and non-viable edge deployment.&lt;/p&gt;




&lt;h3&gt;
  
  
  Strengths and Tradeoffs
&lt;/h3&gt;

&lt;p&gt;No tool is the right fit for every situation. Here's where Barbacane shines and what to keep in mind.&lt;/p&gt;

&lt;h4&gt;
  
  
  Strengths
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Spec integrity&lt;/strong&gt;: Drift is architecturally impossible&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security posture&lt;/strong&gt;: Rust + WASM sandboxing beats Lua/JS runtimes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edge readiness&lt;/strong&gt;: Stateless, fast startup, minimal footprint&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AsyncAPI support&lt;/strong&gt;: Rare among gateways. Handles WebSockets/MQTT alongside HTTP&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitOps native&lt;/strong&gt;: Specs in Git → CI validation → artifact deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Tradeoffs to consider
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Young project&lt;/strong&gt;: v0.1.x, actively developed with a growing community&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Focused plugin set&lt;/strong&gt;: ~17 official plugins covering core use cases, with more on the way&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compile-first workflow&lt;/strong&gt;: Changes go through CI/CD rather than runtime hot-patching&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Static backends&lt;/strong&gt;: Service discovery requires a custom plugin or DNS-based resolution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Barbacane prioritizes configuration integrity and safety over plugin breadth and dynamic reconfiguration. If that tradeoff works for your team, it's worth evaluating.&lt;/p&gt;




&lt;h3&gt;
  
  
  Competitive Landscape
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gateway&lt;/th&gt;
&lt;th&gt;Spec-Driven&lt;/th&gt;
&lt;th&gt;Memory Safe&lt;/th&gt;
&lt;th&gt;WASM Plugins&lt;/th&gt;
&lt;th&gt;Edge-Ready&lt;/th&gt;
&lt;th&gt;AsyncAPI&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Barbacane&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Native&lt;/td&gt;
&lt;td&gt;Rust&lt;/td&gt;
&lt;td&gt;First-class&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kong&lt;/td&gt;
&lt;td&gt;Separate config&lt;/td&gt;
&lt;td&gt;Lua/Nginx&lt;/td&gt;
&lt;td&gt;Experimental&lt;/td&gt;
&lt;td&gt;Heavy&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tyk&lt;/td&gt;
&lt;td&gt;Separate config&lt;/td&gt;
&lt;td&gt;Go (GC)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Heavy&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS API Gateway&lt;/td&gt;
&lt;td&gt;Import only&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Managed&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KrakenD&lt;/td&gt;
&lt;td&gt;JSON config&lt;/td&gt;
&lt;td&gt;Go (GC)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Barbacane targets a different design point than Kong or Tyk: &lt;em&gt;configuration integrity&lt;/em&gt; and &lt;em&gt;security&lt;/em&gt; over plugin ecosystem breadth.&lt;/p&gt;




&lt;h3&gt;
  
  
  Who Should Consider Barbacane Today?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Strong fits&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Greenfield APIs with OpenAPI-first development workflows&lt;/li&gt;
&lt;li&gt;Edge deployments requiring sub-5ms latency overhead&lt;/li&gt;
&lt;li&gt;Security-sensitive domains (fintech, healthcare, govtech)&lt;/li&gt;
&lt;li&gt;Teams with mature GitOps/CI-CD practices&lt;/li&gt;
&lt;li&gt;Organizations investing in Rust/WASM toolchains&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Poor fits&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Legacy systems requiring dynamic runtime reconfiguration&lt;/li&gt;
&lt;li&gt;Teams needing 50+ pre-built plugins immediately&lt;/li&gt;
&lt;li&gt;Environments without DevOps automation for compilation&lt;/li&gt;
&lt;li&gt;Brownfield migrations where spec completeness is low&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  The Bigger Picture: A Shift in Gateway Philosophy
&lt;/h3&gt;

&lt;p&gt;Barbacane represents more than a new gateway. It's a philosophical shift:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Stop configuring your gateway to match your spec. Make your spec the configuration.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This aligns with broader industry movements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Infrastructure as Code&lt;/strong&gt; → &lt;strong&gt;Behavior as Specification&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runtime validation&lt;/strong&gt; → &lt;strong&gt;Compile-time validation&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration drift&lt;/strong&gt; → &lt;strong&gt;Configuration integrity&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's not the only path forward (declarative gateways like KrakenD point in a similar direction), but Barbacane's Rust/WASM/FlatBuffers stack delivers uniquely strong safety and performance guarantees.&lt;/p&gt;




&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Barbacane's spec-driven model addresses a real pain point for API teams: keeping specs and gateway behavior in sync. By compiling the spec into the runtime artifact, that problem goes away entirely. The Rust and WASM foundation delivers strong performance and safety guarantees on top.&lt;/p&gt;

&lt;p&gt;The project is at v0.1.x, so it's best suited for new projects where you control the spec lifecycle. If your team already works OpenAPI-first with CI/CD automation, Barbacane fits naturally into that workflow.&lt;/p&gt;

&lt;p&gt;The goal: your API contract &lt;em&gt;is&lt;/em&gt; your production configuration. Security policies validated before deployment. Edge gateways starting in milliseconds with zero configuration drift. That's the direction we're heading.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Barbacane is open source and available at &lt;a href="https://github.com/barbacane-dev/barbacane" rel="noopener noreferrer"&gt;github.com/barbacane-dev/barbacane&lt;/a&gt;. As of February 2026, it remains an early-stage project—evaluate thoroughly before production use.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>barbacane</category>
      <category>apigateway</category>
      <category>rust</category>
      <category>webassembly</category>
    </item>
  </channel>
</rss>
