惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
量子位
罗磊的独立博客
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
小众软件
小众软件
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
大猫的无限游戏
大猫的无限游戏
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园_首页
博客园 - 叶小钗
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
T
Tailwind CSS Blog
IT之家
IT之家
博客园 - 聂微东
Spread Privacy
Spread Privacy
V2EX - 技术
V2EX - 技术
S
Security Affairs
宝玉的分享
宝玉的分享
V
V2EX
C
Cisco Blogs
博客园 - Franky
美团技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
S
Securelist
J
Java Code Geeks
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
WordPress大学
WordPress大学
W
WeLiveSecurity
T
Threatpost
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
10 Avro Schema Mistakes Even Experienced Developer Do
Divyanshu De · 2026-05-27 · via DEV Community

Avro schemas widely used with messaging systems like Apache Kafka to serialize messages into a compact binary format. This dramatically reduces bandwidth and storage overhead compared to sending verbose formats like JSON or XML.
They look deceptively simple until a tiny mistake breaks your serializer, schema registry validation, or downstream consumers.

Some mistakes are obvious rookie errors. Others are subtle enough that even experienced developers make them when moving fast.

I built Dev Suite Avro Schema Validator ( https://devsuite.tools/avro-schema-validator ) to automate the painful part. Paste your schema, and it validates, analyzes, and flags production-breaking issues in seconds.

Here are 10 real Avro schema mistakes that can quietly break production pipelines:

(1) Referencing a Named Type with an Incorrect Fullname

Rule: Subsequent references to a declared named type MUST be made by its full name.

Test Case

{
  "type": "record",
  "name": "Order",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "shippingAddress",
      "type": {
        "type": "record",
        "name": "Address",
        "fields": [
          { "name": "city", "type": "string" }
        ]
      }
    },
    {
      "name": "billingAddress",
      "type": "com.Address"
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
Named type references containing a dot are treated by Avro as explicit full names, not partially qualified names. Since com.Address does not match the declared full name com.devsuite.Address, schema resolution fails.

Figure 1: Dev Suite flagging an invalid named type reference with incorrect namespace qualification

(2) Referencing a Named Type Before It Is Declared

Rule: All named types used within a schema MUST be declared where they are first used.

Test Case

{
  "type": "record",
  "name": "Customer",
  "namespace": "com.devsuite.core",
  "fields": [
    {
      "name": "primaryAccount",
      "type": "com.devsuite.core.Account"
    },
    {
      "name": "secondaryAccount",
      "type": {
        "type": "record",
        "name": "Account",
        "fields": [
          { "name": "routingNumber", "type": "string" }
        ]
      }
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
The primaryAccount field references com.devsuite.core.Account before it is inline-declared in the secondaryAccount field. Avro parses top-down, left-to-right; a type cannot be referenced by full name until the parser has actually encountered its full structural declaration.

Declare the named type before the first reference that uses it.

(3) Alias Contains the Type’s Own Name

Rule: The aliases attribute MUST NOT contain the name attribute of the named type.

Test Case

{
  "type": "record",
  "name": "Account",
  "namespace": "com.devsuite",
  "aliases": ["Account", "OldAccount"],
  "fields": [
    { "name": "accountId", "type": "string" }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
Aliases in Avro exist to support schema evolution, particularly when a type has been renamed but older producers or consumers may still refer to the previous name. Including the current schema name inside its own aliases list defeats the purpose entirely because the alias mechanism is meant to represent alternate historical identities, not duplicate the current one.

Account should be removed from the aliases array

(4) Duplicate Equivalent Types Inside a Union

Rule: Any primitive type MUST be included at most once, which also applies to logical type annotations. A UUID logical type, which annotates string, and a string primitive type therefore MUST NOT appear in the same type union.

Test Case

{
  "type": "record",
  "name": "Event",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "identifier",
      "type": [
        "string",
        {
          "type": "string",
          "logicalType": "uuid"
        }
      ]
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
Avro unions distinguish branches by schema type category, not semantic meaning. Since a UUID logical type is still fundamentally a string, combining both creates ambiguity during resolution.

Figure 2: Dev Suite catching a type redundancy error within a union array where a primitive string overlaps with a uuid logical type annotation.

(5) Multiple Arrays or Maps Inside the Same Union

Rule: A union MUST NOT contain more than one array type and NOT more than one map type.

Test Case

{
  "type": "record",
  "name": "DataPayload",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "collections",
      "type": [
        { "type": "array", "items": "string" },
        { "type": "array", "items": "int" }
      ]
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
The issue is that Avro distinguishes union members by top-level schema category, not by their internal configuration details. Two arrays are still both arrays, regardless of whether their item definitions differ. The same applies to maps. During deserialization, Avro cannot reliably determine which union branch should be selected purely based on the fact that both branches are structurally the same top-level type. This makes the schema ambiguous and therefore invalid.

Tip - Wrap structurally different meanings inside named records instead of directly placing multiple arrays or maps in the same union.

(6) Union Default Value Does Not Match the First Type

Rule: The default value of a union field MUST match the structure of the first type declared in the union array.

Test Case

{
  "type": "record",
  "name": "UserStatus",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "state",
      "type": ["null", "string"],
      "default": "ACTIVE"
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
The union allows null or a string. However, because “null” is the first element in the array, the default value must be null.
If a developer wants the default value to be “ACTIVE”, they must reorder the union to [“string”, “null”]

Figure 3: Dev Suite flagging a schema violation on line 9 where the default value fails to match the first declared type in the union (“null”)

(7) Enum Default Not Present in Symbols

Rule: The default value for an enum must be a string that exactly matches one of the values defined in the symbols array.

Test Case

{
  "type": "record",
  "name": "UserStatus",
  "namespace": "com.devsuite.test",
  "fields": [
    {
      "name": "status",
      "type": {
        "type": "enum",
        "name": "StatusEnum",
        "symbols": ["ACTIVE", "INACTIVE", "BANNED"]
      },
      "default": "PENDING"
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
Enum defaults are not arbitrary fallback strings chosen by business meaning; they must correspond exactly to one of the enum’s declared symbols. Developers frequently make this mistake when renaming enum values during schema evolution or when choosing a semantically meaningful default that feels right but no longer exists in the actual symbols array.

(8) Default Object Missing Required Fields

Rule: The default attribute value MUST be a structurally valid instance representation of that specific type.

Test Case

{
  "type": "record",
  "name": "MapData",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "coordinates",
      "type": {
        "type": "record",
        "name": "Point",
        "fields": [
          { "name": "x", "type": "int" },
          { "name": "y", "type": "int" }
        ]
      },
      "default": {
        "x": 100
      }
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
Default values in Avro are not placeholders or partially descriptive hints; they must be fully valid structural representations of the declared schema. A common mistake happens when developers define a nested record default and provide only some of the fields, assuming omitted values will somehow be inferred or auto-filled. Avro does not do that unless those omitted fields themselves define valid defaults. If a nested record requires fields x and y , providing only x makes the entire default structurally incomplete. This becomes especially easy to miss in large schemas where nested records span many fields and developers manually craft defaults under time pressure.

(9) Invalid Duration Logical Type Definition

Rule: The duration logical type extends the fixed type and must annotate a fixed size of exactly 12 bytes.

Test Case

{
  "type": "record",
  "name": "Timeline",
  "namespace": "com.devsuite",
  "fields": [
    {
      "name": "windowSize",
      "type": {
        "type": "fixed",
        "name": "Interval",
        "size": 8,
        "logicalType": "duration"
      }
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
In Avro, duration is extremely specific. It represents three unsigned 32-bit integers corresponding to months, days, and milliseconds, which together require exactly 12 bytes of fixed storage. If duration is attached to anything other than a fixed type of size 12, the binary representation no longer matches Avro’s expected encoding contract.

(10) Fixed Type Without Valid Size

Rule: A fixed type must have a size attribute that is an integer strictly greater than zero.

Test Case

{
  "type": "record",
  "name": "HashRecord",
  "namespace": "com.devsuite.test",
  "fields": [
    {
      "name": "md5",
      "type": {
        "type": "fixed",
        "name": "MD5"
      }
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

Why this fails
A fixed type exists specifically to represent a binary blob of exact known size. Without a valid positive size, Avro has no idea how much memory should be allocated or how many bytes should be read and written during serialization. Developers often scaffold fixed types quickly for hashes, binary identifiers, or protocol payloads and forget to define the actual size, treating it as metadata to fill later. But for Avro, size is fundamental to the schema’s structural definition.