If you ever want to feel humble as a desktop developer, ship a native Node addon inside an Electron app. This is the story of versions 0.5.2 through 0.5.8 — six patch releases in one day — and the architecture that came out the other side.

The Setup

Aerospike's Node.js client is a native addon: C code compiled against a specific Node ABI. In development everything worked beautifully. Then we packaged the app, and the fun began.

The Whack-a-Mole Phase

Each fix revealed the next problem, and each earned its own patch release:

  • Electron packs your app into an asar archive — but a native addon can't be loaded from inside one. Unpack the addon.
  • The addon's worker needs spawning as a child process — which can't run from asar either. Unpack the worker.
  • The worker resolves its dependencies via NODE_PATH — which points into the asar. Fix the path.
  • Transitive dependencies (hello, minimatch) also live in the asar. Unpack those too.
  • Should the worker run on the system's Node or Electron's runtime? We tried both — twice.

The Actual Lesson

The chaos forced a decision we should have made on day one: the native driver doesn't belong in the app process at all. Since 0.5.8, every Aerospike operation runs in an isolated worker process. The native addon never loads inside Electron.

That one boundary bought us three things:

  1. Crash isolation — if the native driver segfaults, the worker dies and restarts; the app never notices beyond a failed query.
  2. Packaging sanity — one process, one clearly unpacked directory, no ABI games with Electron's Node.
  3. A cleaner engine interface — the worker speaks a small message protocol, which later made query abort and timeouts much easier to wire up.

Bonus Round: 45,000 Tree Rows

The same release week also fixed a very different problem: sidebars with thousands of collections froze the UI. The tree is now virtualized — only visible rows exist in the DOM — which is why a connection with tens of thousands of objects scrolls like an empty one.

If you're building an Electron app with native addons: put them in a worker process first. Your patch-release count will thank you.

Try Sutido

Five engines — including Aerospike, safely at arm's length.

Download Now