Microservices and Enonic XPMorten Eriksen on
Discover how the web application platform Enonic XP can enhance microservices to help build your future digital experiences.
Within software system architecture, the term “microservices” refers to applications that are organised as a collection of separate services—as opposed to a monolithic system where every piece of functionality and code is welded together.
Being isolated, microservices can be developed, upgraded, and scaled independently of each other. This allows for faster and potentially safer development and change to large systems in your organisation.
The advantages posed by microservices are pretty straightforward, but what can Enonic’s web application platform add to the mix? In this blog post, we will take a look at how Enonic XP fits into your existing microservices environment, and how it e.g. provides your project with both a framework, runtime and data storage.
Cloud native microservice platforms
Modern cloud platforms have evolved from basic compute and storage services, and now offer a wide range of platform services. This includes databases, state handling, load balancers, and container orchestration. The latter is at the core of the microservice architecture. Tools like Kubernetes and Docker enable developers to easily wrap their applications in a runtime, deploy, and scale it dynamically. Dependencies to resources—such as storage or other applications—are dynamically created and provisioned, based on configuration. One of the more specialised developments in this area, called ServerLess, even lets you run code/scripts without the use of containers.
Cloud native platforms provide a high degree of flexibility in terms of scaling, programming languages, runtimes, and storage options. The downside is primarily related to locking into the various niche services offered by the providers—even if they may often make your life easier.
Enonic XP provides developers with both runtime and storage, and is in many ways a microservice platform by itself. Rather than talking about microservices, XP uses the concept of apps. Unlike cloud based platforms that require provisioning, XP apps instantly get access to XP’s platform services like storage and search.
The XP runtime is capable of running multiple apps in a single instance. This flexibility enables modularisation of a single “microservice”. It also enables better utilisation of underlying infrastructure, as you will not need to commit new computing resources for every new app you deploy.
Like microservices, apps enable isolation and modularity, which means that apps can be installed, run, and stopped individually. With the XP runtime, this can even be done without shutting down the runtime itself. When the platform is running, you can run a great number of apps, without having to spin up new containers for each and every one.
Speeding up development with Enonic
Enonic provides a Command Line Interface (CLI) for Mac, Linux and Windows which let you install the Software Development Kit (SDK) and build your first app in minutes.
Because of the nature of the Enonic platform, continuous delivery is a given. As a result, your developers can seamlessly integrate XP app development into existing tools and deployment pipelines.
Store and search
Enonic XP provides a powerful NoSQL storage with integrated search. The unique and powerful document-oriented data storage is built upon the fast and robust search engine Elasticsearch.
Enonic’s data store enables you to persist, secure, index, query, and access data of virtually any kind, in a fast and efficient manner. This feature is important when handling multiple apps and services accessing data at the same time.
Read more about the data store capabilities in our storage documentation.
Enonic XP and containers
So, how does XP fit into an existing container orchestration architecture? For a start, Enonic provides standard docker images, as well as distributions for the most popular operating systems—Linux, Mac OS, and Windows. Enonic XP can run in any cloud, or on premises.
Differently from container platforms, Enonic XP does not handle scaling itself, and this is where the two solutions team up perfectly. By placing XP into a platform like Kubernetes, you get the benefit of both worlds. Now, you may automatically configure, scale and grow your XP cluster - while reaping the fruits of XP’s simplicity and powerful features, such as the CMS.
Just like any other microservice, XP containers can be configured to access other microservices, and visa versa. In other words, Enonic XP fits seamlessly into a modern architecture, microservices strategy, and world of Kubernetes. Enonic XP is not designed to replace your existing architecture or investment, but rather complement it.
Content and CMS
The CMS of Enonic XP—dubbed Content Studio—is completely optional and is built on top of the XP core. The CMS provides functionality to produce and deliver editorial content to your websites and services. If editorial content is necessary in conjunction with your microservices, Enonic XP makes the process a breeze.
Enonic XP really starts to shine when you use all the core features combined, including runtime, storage, apps, and admin—as shown in this illustration:
When not to use Enonic XP
Even though Enonic XP is a powerful web application platform, it cannot be everything for everyone. As such, XP might not always be the optimal solution for your project. For instance, if you don’t need to store data, or your application is not related to web, Enonic XP is probably not the platform you need.
If containers and microservices are not your cup of tea to begin with, Enonic can of course be deployed in more traditional infrastructures.
With the right preparations and considerations, Enonic XP will not only fit into your existing microservice and container architecture—it will strengthen and augment it. Providing both a runtime, CMS and a storage component, Enonic XP gives you all the advantages of a fully-fledged digital experience powerhouse together with your microservices.