Skip to content
Stand with Ukraine flag

TBEL Overview

ThingsBoard Expression Language (TBEL) is a lightweight scripting language purpose-built for IoT data transformation. It is a fork of MVEL with additional security constraints and built-in memory management.

TBEL is the default scripting engine for Script calculated fields, rule engine filter and transformation nodes, and other server-side scripting contexts.

Prior to TBEL, ThingsBoard used Nashorn (the JDK-bundled JavaScript engine) for server-side scripting. Nashorn was deprecated in JDK 11 and removed in JDK 15 — leaving two alternatives:

  • GraalVM JavaScript: Excellent but carries a heavy runtime footprint and licensing constraints that make it impractical for most self-hosted deployments.
  • Remote JS Executors: Node.js processes that receive scripts over the message queue. They work, but add inter-process communication latency and consume extra system resources.

TBEL was created to provide a fast, secure, zero-dependency scripting option that runs inside the JVM without external processes.

TBEL delivers roughly 1 000× better performance for typical transformation scripts.

MetricNashornTBEL
1 000 iterations of return msg.temperature > 20~16 000 ms~12 ms
Startup cost per scriptHigh (JIT compilation)Negligible
Memory isolationWeakStrong (per-execution memory limit)
Security sandboxManual, error-proneBuilt-in (restricted class access)
AspectRemote JS ExecutorsTBEL
Additional processYes (Node.js)No
Network/queue overheadYesNo
LanguageFull ES6+ JavaScriptMVEL-based (Java-like)
Use caseComplex scripts that need full JS ecosystemTypical IoT transformations