Best of zodOctober 2025

  1. 1
    Article
    Avatar of logrocketLogRocket·26w

    Why is Zod so slow?

    Zod's runtime interpretation architecture makes it significantly slower than AOT-compiled validators like Typia in high-throughput scenarios. While this performance gap is negligible for typical web applications, it becomes critical in systems handling billions of requests. The article explains the interpreter vs compiler trade-off and demonstrates a practical solution: using a build script to convert Zod schemas into optimized JSON Schema validators with ajv, achieving production performance while maintaining Zod's developer experience during development.

  2. 2
    Article
    Avatar of Marmelabmarmelab·24w

    From GraphQL to Zod: Simplifying Arte's API Architecture

    Marmelab helped Arte migrate from a complex GraphQL-based backend-for-frontend to a simpler REST API architecture using Zod for runtime type validation. The original GraphQL layer, implemented in 2017 to aggregate data across multiple platforms, had evolved into a REST API that internally used GraphQL.js, creating maintenance overhead and onboarding friction. By prototyping with the most complex endpoint first, the team discovered Zod could provide the same runtime type safety as GraphQL schemas while reducing architectural complexity. Key challenges included handling runtime validation, JSON serialization gotchas with undefined values, and filtering extra properties. Advanced patterns like using merge() instead of intersection() for discriminated unions proved essential. The migration reduced cognitive load while maintaining type safety, demonstrating that architectural decisions should evolve with project needs.