Leanpub Header

Skip to main content

You Don't Know JSON

Beyond Six Data Types: The Complete Ecosystem

JSON succeeded not because it was better--XML had schemas, namespaces, and 10 years of tooling, but because it understood modularity in ways XML never could. This book deconstructs how a deliberately incomplete format defeated a comprehensive standard, then shows you the production patterns (JSON Schema, JSONB, MessagePack, versioning strategies) that make JSON systems scale from prototype to billions of requests.

Minimum price

$29.00

$39.00

You pay

$39.00

Author earns

$31.20
$

...Or Buy With Credits!

You can get credits with a paid monthly or annual Reader Membership, or you can buy them here.
PDF
EPUB
About

About

About the Book

JSON isn't simple when you're building production systems

JSON displaced XML through architectural shift, not simplification.

Where XML bundled validation (XSD), protocols (SOAP), and security into one monolithic specification, JSON provided a minimal core and let independent solutions emerge: JSON Schema, JSON-RPC, JWT.

This architectural shift explains JSON's dominance.

But modular ecosystems create a discovery problem: many developers use JSON for years without learning the patterns that make it production-ready.

In this book you'll learn:

  • Schema validation that catches errors before production
  • Binary formats (MessagePack, CBOR, Protocol Buffers) and when to use them
  • API design patterns that scale to millions of requests
  • Data pipeline architectures that process billions of events reliably
  • Security strategies that prevent JWT attacks and injection vulnerabilities
  • Testing approaches that build confidence in production
  • Decision frameworks for choosing JSON vs. alternatives
  • Architectural thinking that explains why JSON succeeded where XML failed

Whether you're a backend developer designing APIs, a data engineer building pipelines, or an architect choosing technologies, this book provides the systematic understanding to build JSON systems that don't fail under pressure.

Author

About the Author

Dayna Blackwell

Dayna Blackwell is a software architect and founder of Blackwell Systems, specializing in distributed systems, API design, and developer tooling. With five years of backend engineering experience building production systems in enterprise hospitality, she has designed APIs serving millions of requests and data pipelines processing billions of JSON events.

Dayna maintains an active technical blog and multiple open-source projects focused on developer experience, error handling, and infrastructure tooling. She holds three AWS certifications plus Azure and Terraform credentials.

Contents

Table of Contents

Introduction

  1. The JSON Paradox
  2. What You’ll Learn
  3. Who This Book Is For
  4. How to Use This Book
  5. What You’ll Build
  6. A Note on Evolution

Part I: The JSON Ecosystem

Chapter 1: Origins, Evolution, and the Cracks in the Foundation

  1. The Pre-JSON Dark Ages: XML Everywhere
  2. JSON’s Accidental Discovery
  3. Why JSON Won
  4. JSON’s Fundamental Weaknesses
  5. The Format Comparison Landscape
  6. When NOT to Use JSON
  7. The Evolution: JSON’s Ecosystem Response
  8. Running Example: Building a User API
  9. Conclusion: JSON’s Success Through Simplicity
  10. Further Reading

Chapter 2: The Modular Architecture

  1. The Architectural Zeitgeist
  2. Monolithic Architecture: The XML Approach
  3. Modular Architecture: The JSON Approach
  4. The Modularity Pattern in Other Systems
  5. Why XML’s Completeness Became Rigidity
  6. How JSON’s Incompleteness Enables Evolution
  7. The Modularity Paradox
  8. Principles of Composable Solutions
  9. The Architecture Timeline: How Thinking Changed
  10. Applying the Architectural Lens
  11. The Core Thesis: Technologies Reflect Their Era
  12. Summary: The Modular Foundation
  13. Further Reading

Chapter 3: JSON Schema and the Art of Validation

  1. Running Example: Validating Our User API
  2. The Core Problem: Trust Nothing
  3. JSON Schema Fundamentals
  4. Core Validation Types
  5. Schema Composition: Building Complex Schemas
  6. Schema Reuse and References
  7. Validation in Practice: Code Examples
  8. Code Generation from Schemas
  9. OpenAPI Integration
  10. Schema Evolution and Versioning
  11. Best Practices
  12. Common Pitfalls
  13. Alternatives to JSON Schema
  14. Real-World Use Cases
  15. Conclusion: JSON + Schema = Type Safety
  16. Further Reading

Chapter 4: Binary JSON in Databases

  1. Running Example: Storing 10 Million Users
  2. The Text Format Tax in Databases
  3. The Database Binary JSON Landscape
  4. PostgreSQL JSONB: Indexable Documents
  5. MongoDB BSON: Extended Types
  6. Real-World Production Examples
  7. Choosing Database Binary JSON
  8. Database Performance Impact
  9. What’s Next: Beyond Database Storage
  10. References

Chapter 5: Binary JSON for APIs and Data Transfer

  1. MessagePack: Universal Binary Serialization
  2. Running Example: Optimizing User API for Mobile Clients
  3. CBOR: Concise Binary Object Representation
  4. Performance Benchmarks
  5. Binary JSON vs Protocol Buffers
  6. Cloud Bandwidth Cost Savings
  7. Real-World Use Cases
  8. Choosing Your Binary Format
  9. References

Chapter 6: JSON-RPC - When REST Isn’t Enough

  1. Running Example: User API with JSON-RPC
  2. The RPC Problem
  3. What is JSON-RPC?
  4. Parameter Formats
  5. Standard Error Codes
  6. Batch Requests
  7. Implementing a JSON-RPC Server
  8. Implementing a JSON-RPC Client
  9. JSON-RPC over WebSockets
  10. Real-World Use Cases
  11. JSON-RPC vs REST vs gRPC
  12. Best Practices
  13. Security Considerations
  14. Testing JSON-RPC APIs
  15. Conclusion: JSON-RPC’s Sweet Spot
  16. Further Reading

Chapter 7: JSON Lines - Processing Gigabytes Without Running Out of Memory

  1. Running Example: Exporting 10 Million Users
  2. The Streaming Problem
  3. JSON Lines Format
  4. Reading JSON Lines
  5. Writing JSON Lines
  6. Unix Pipeline Integration
  7. Log Processing with JSON Lines
  8. Data Pipelines with JSON Lines
  9. MongoDB and JSON Lines
  10. Real-World Use Cases
  11. Fault Tolerance
  12. Streaming vs Batch Processing
  13. Advanced Streaming Patterns
  14. Best Practices
  15. Tools and Libraries
  16. Common Patterns
  17. When NOT to Use JSON Lines
  18. Conclusion: JSON Lines for Scale
  19. Further Reading

Chapter 8: JSON Security - Authentication, Signatures, and Attacks

  1. Running Example: Securing the User API
  2. The Security Problem
  3. JWT: JSON Web Tokens
  4. JWS: JSON Web Signature
  5. JWE: JSON Web Encryption
  6. Canonicalization: Consistent Signatures
  7. Common Attacks and Vulnerabilities
  8. Best Practices
  9. Real-World Examples
  10. Running Example Complete: The Full User API Stack
  11. Conclusion: Security Through Modularity
  12. Further Reading

Chapter 9: Lessons from the JSON Revolution

  1. The Full Circle: JSON Recreated XML’s Ecosystem
  2. The Modularity Paradox: Discovery vs. Choice
  3. The JSX Vindication: Good Patterns Survive
  4. What JSON Teaches Us About Technology Evolution
  5. The Modularity Tax: What We Gave Up
  6. What Comes After JSON?
  7. Applying These Lessons
  8. The Book in Retrospect
  9. Conclusion: Patterns Survive, Architectures Evolve
  10. Further Reflection

Part II: Building with JSON

Chapter 10: Human-Friendly JSON Variants

  1. The Configuration Problem
  2. JSON5: ECMAScript 5 for Configs
  3. YAML: The DevOps Standard
  4. TOML: Clarity Over Terseness
  5. JSON5 vs HJSON vs YAML vs TOML: Choosing Your Format
  6. Migration Strategies
  7. Conclusion: Configuration Deserves Better Than JSON

Chapter 11: API Design with JSON

  1. 1. REST API Fundamentals
  2. 2. Pagination Patterns
  3. 3. Error Response Formats
  4. 4. API Versioning Strategies
  5. 5. Rate Limiting
  6. 6. Content Negotiation
  7. 7. Security Patterns
  8. Conclusion

Chapter 12: JSON in Data Pipelines

  1. 1. ETL Fundamentals with JSON Lines
  2. 2. Kafka Integration for JSON Streaming
  3. 3. Data Validation in Pipelines
  4. 4. Error Handling and Resilience
  5. 5. Monitoring and Observability
  6. 6. Production Pipeline Architectures
  7. Conclusion

Chapter 13: Testing JSON Systems

  1. 1. Schema-Based Testing
  2. 2. Contract Testing with Pact
  3. 3. API Testing Strategies
  4. 4. Security Testing
  5. 5. Performance and Load Testing
  6. 6. Fuzz Testing and CI/CD Integration

Chapter 14: Beyond JSON - The Future

  1. When JSON Isn’t Enough
  2. Protocol Buffers: Schema-First Performance
  3. Apache Avro: Self-Describing Data Evolution
  4. Emerging Patterns: Beyond Binary vs Text
  5. JSON in New Contexts
  6. Technology Landscape: 2025 and Beyond
  7. Conclusion: Choose Tools for Problems, Not Trends

Conclusion

  1. The Journey We’ve Taken
  2. Core Principles Learned
  3. Practical Takeaways
  4. What’s Next for JSON
  5. Your Next Steps

Appendix A: JSON Specification Summary

  1. JSON Syntax Quick Reference
  2. JSON Schema Essentials
  3. JWT Quick Reference
  4. HTTP Status Codes for JSON APIs
  5. Content-Type Headers
  6. Common JSON API Patterns
  7. JSON Lines Format
  8. Binary Format Comparison

Appendix B: Quick Reference Guide

  1. JSON Schema Validation Examples
  2. Error Response Formats
  3. Pagination Patterns
  4. JWT Implementation Examples
  5. JSON Lines Streaming Examples
  6. API Versioning Examples
  7. Webhook Payload Formats
  8. Batch Request Patterns
  9. Security Headers and Configuration
  10. Testing Strategy Checklists
  11. Configuration Examples
  12. Monitoring and Observability

Appendix C: Resources and Further Reading

  1. Essential Tools and Libraries
  2. Recommended Reading
  3. Community Resources
  4. Language-Specific Resources
  5. Staying Current with JSON Ecosystem
  6. Contributing to the JSON Ecosystem
  7. Companion Repository

About the Author

  1. Connect
  2. Speaking & Consulting
  3. Acknowledgments

Feedback and Errata

  1. Found an Issue?
  2. Companion Repository
  3. Stay Connected

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub