Parse, Don't Guess

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A developer shares how a sneaky Regex-based bigint auto-detection during JSON deserialization caused JavaScript event loop freezes in production. The fix involved dropping the global Regex reviver and replacing it with an explicit upcasting pattern — a function that converts stored types (strings) to application types (Date, bigint) only for declared fields. This same upcasting mechanism naturally extends to schema versioning: handling structural changes between document/event versions (V1 flat fields vs V2 nested objects) using upcast (read) and downcast (write) functions. The pattern is applied to both Pongo (document store) and Emmett (event store), enabling backward and forward compatibility without batch migrations.

16m read timeFrom architecture-weekly.com
Post cover image
Table of contents
The ShiftCompatibility FTWRight decisions stack
1 Comment

Sort: