# Containing non-deterministic code at scale

**URL:** <https://community.temporal.io/t/containing-non-deterministic-code-at-scale/2133>\
**Category:** Community Support\
**Tags:** go-sdk\
**Created:** [May 13, 2021, 9:25pm UTC](https://community.temporal.io/t/containing-non-deterministic-code-at-scale/2133 "2021-05-13T21:25:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavidL](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@DavidL](https://community.temporal.io/u/DavidL)\
**Post date:** [May 13, 2021, 9:25pm UTC](https://community.temporal.io/t/containing-non-deterministic-code-at-scale/2133/1 "2021-05-13T21:25:37Z")

</div>

In my evaluation of Temporal I’m on the lookout for challenges we might face when scaling it to a large-ish development team. One concern is that less-experienced or rushed developers might introduce non-deterministic code into a workflow. Proper testing would discover such code but at scale there are often overlooked test cases. I’m interested in tips for catching such code beyond discipline.

I imagine static analysis combined with a workflow naming convention would only catch the obvious. We’ll be using Go. In Java there’s a facility (i.e. SecurityContext and class loaders) for running code in a context that restricts access to specified classes or namespaces (e.g. rand, io) - even indirect access. Does Go have a similar facility? Or if something completely different might help, all ideas welcomed.

Thank you.

---

<div class="post-metadata">

**Author:** ![DavidL](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@DavidL](https://community.temporal.io/u/DavidL)\
**Post date:** [May 17, 2021, 7:59pm UTC](https://community.temporal.io/t/containing-non-deterministic-code-at-scale/2133/2 "2021-05-17T19:59:28Z")

</div>

This comment about the use of Node’s isolates is relevant:

> [@Node/Typescript SDK](https://community.temporal.io/t/node-typescript-sdk/1046/13):
>
> We expect it to be fully feature complete. But it is a process that is going to take some time. It is actually going to be much better than the Go SDK. The reason is the power of V8 isolates. Each workflow will be fully isolated in a deterministic container. So developer will not need think about determinism as it would be able to use global variables and any available APIs for time and random without any problem.

We may switch to TypeScript to improve the determinism story.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [May 17, 2021, 8:03pm UTC](https://community.temporal.io/t/containing-non-deterministic-code-at-scale/2133/3 "2021-05-17T20:03:25Z")

</div>

At this point, there is no bulletproof solution besides using an airtight container like V8. After NodeJs we plan to invest in WebAssembly which allows deterministic execution. So the set of languages that are supported in such a model will be much larger.

Our experience is that non deterministic errors do happen, but they usually are discovered during development and testing.
