There’s a whole lot of discuss Sort-Security in programming today. But a whole lot of applications, particularly distributed techniques, depend on infrastructure that breaks your type-safety. So what provides? 🤔
Sort-Security is principally about stopping Sort Errors, that are errors that normally occur when an operation is carried out on an information sort it wasn’t designed for.
In your program you are dividing two integers, however as a substitute of an integer, a string of letters is handed to the perform. This can be a traditional instance the place unintended behaviour can come up and all of it would possibly blow up in your consumer’s face. 🤯
Now you is perhaps saying to your self: I take advantage of a contemporary programming language like Go or TypeScript, which has type-safety “built-in”. That ensures my program is type-safe. Proper…?
Making certain your code is type-safe is commonly solely half the battle.
If you happen to’re constructing a distributed system, like an event-driven utility utilizing Pub/Sub, it is not sufficient to make sure that every service is written in a type-safe means.😬
👩🦯 It’s because, usually, Pub/Sub mechanisms are blind to the information constructions of the messages they deal with, making the inter-service communication un-[type]secure.
That is frequent supply of hard-to-catch errors that may be a nightmare to debug.
🤔 What in case your Pub/Sub communication might be type-safe? That may forestall a complete class of bugs, and make it easier to catch issues in growth fairly in manufacturing. Saving you time and avoiding loads of consumer pains.
🤝 This implies Encore’s compiler can guarantee you have got end-to-end type-safety, even when utilizing issues like Pub/Sub. (Different advantages embody that it might additionally routinely provision the infrastructure in your cloud and deploy your app.)
👉 Try this tutorial on constructing an event-driven system utilizing Encore’s Go SDK.
👉 Desire to make use of TypeScript? Join the Developer Hangout on Slack to ask for beta entry.