Andrew's Digital Garden

Nx Cloud

Nx Cloud is a paid service that aims to speed up commands in your NX [[monorepo]]. The cost is based on the 'time saved'.

It features two main parts, Distributed Task Execution and Distributed Cache. You can use one without the other.

Only operations listed in cacheableOperations can be cached or distributed. Then these commands will be cached without requiring any changes of the commands themselves. Non Nx commands can be cached with nx-cloud record.

Distributed Task Execution

Runs tasks across multiple machines, preserving order and dependencies if required. It's essentially parallelisation to save time. It requires a bit of setup, e.g. starting and stopping cloud agents, specifying commands, etc. However you don't have to use DTE on everything.

Distributed Cache

This caches the output of previously run commands, to replay the cached output rather than re-running the command. It's fairly simple, but important it works both across CI and Dev environments. This means that one developer running a test suite could theoretically cache it for all other developers.

It's possible to choose what writes and what reads from the cache. For example, only CI can write, but all devs can read.

https://nx.dev/nx-cloud/intro/what-is-nx-cloud

[[nx]]

Referred in

Nx Cloud