Architecture

Contents

Architecture

The XP runtime is the foundation of XP apps

Micro Service platform

XP apps are primarily written in JavaScript, based on the XP JavaScript framework. The XP runtime is built on top of the Java Virtual Machine, and a series of open source Java components. This also means that Java libraries and code can easily be accessed and used by JavaScript developers as well.

Traditional Micro services typically combine a runtime (JavaVM, NodeJS etc) with specific application code Once started, the micro service will occupy a set of resources (CPU, memory and disk) through its lifetime.

The XP runtime is capable of running in both stateful (using the embedded NoSQL storage) and stateless mode. A single instance deployment will do both, but a clustered deployment may for instance be split into back-end and front-end nodes.

The runtime is also capable of running multiple applications within a single instance. Applications are isolated from each other using OSGi, a dynamic module system for the JVM.

This provides a range of possibilities:

  • Better utilization of underlying infrastructure

  • Modularization without performance degradations due to network traffic

  • Simplified testing and developer environment

An example of when these features are useful, is the XP CMS. For a single site, multiple applications may be involved in the processing of a request. The applications may be dynamically added to or removed from a site - without any downtime.

There is no problem running many applications within a single runtime. XP apps are primarily Javascript, and similar to serverless architectures the apps hardly consume any resources when idle.

Scaling

The XP runtime is capable of utilizing multiple underlying multi-core CPUs for vertical scaling. This is useful for applications with heavy load, but also important from a development perspective. As the XP runtime is multi-threaded, developers may also benefit from a simpler development model. Simpler debugging, and the ability to run threaded operations when needed are just some of the benefits. The XP task engine for instance runs all tasks as separate threads.

XP can also be scaled horizontally. XP can be deployed as a single instance, and scaled out through a cluster of similar nodes, or in a more diverse structure of stateless front-end and stateful back-end nodes.

Apps API

There are multiple ways of rolling out apps on Enonic XP.

The most dynamic is through the apps API. This actually persists applications in the XP storage. Events cause runtime instances to pick up and start the new apps automatically.

SDK

Enonic XP ships with a Software Development Kit. The SDK is essentially the entire platform with both back-end and front-end offered in a single runtime. The major difference between the SDK and Server versions of XP is that the SDK builds on the Java Development Kit, where the server version is a leaner and more optimized version of the Java VM.

Contents