Hacker News new | past | comments | ask | show | jobs | submit login

I'm wondering how they handle version skew and migration.

Fields have a lifecycle. When they're introduced, no clients or servers know about them. Clients and servers aren't restarted all at once. They won't have the same version of the types. Data will be written using one version of a type and read using a different version.

If you can guarantee all binaries, running programs, and data gets upgraded (no persistent data exists) then it might not be a problem. As soon as you have multiple organizations involved, guaranteeing all apps and servers sync to the latest version of a library, rebuild, and redeploy will be difficult.

Static type checking assumes no version skew. All the code in the binary got built with the same version of the library defining the types. It's a closed world.




Pretty much "you do it". Zod can accept unrecognized fields, and then you move to optional fields, and finally once the dust settles you can make the field required.

Of course, the demographic that most desires what tRPC does is the least likely to think about that sort of stuff.


That's why it's a tool for web apps


Web apps can still have the problem of the server and client getting out of sync.

1. Plenty of people deploy their frontend and their backend separately. 2. Even if frontend and backend are deployed at the same time, there's still the case where the user has the old version of the client loaded in their browser as a new backend gets deployed. I've seen some web apps tackle this by periodically checking if a new version is available and either refreshing the page or prompting the user to refresh the page.


Even with webapps, duration a binary rollout you can have clients reaching different versions of the app on each request (that's basic version skew).


SPA web-apps still have long-lived sessions




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: