Parse, Don't Guess: Why Your JSON Deserializer Shouldn't Be Making Decisions For You
Published on 02.03.2026
Parse, Don't Guess
TLDR: Automatically converting all numeric strings to BigInts during JSON deserialization caused CPU freezes in production because regex checks ran against every string in every document on every request. The fix was not a better regex but removing the guessing entirely and replacing it with explicit upcast/downcast functions that only transform the fields you declare, which also unlocked proper schema versioning for free.
External Links (1)
Sign in to bookmark these links