Enapso Micro-Services

Enapso Micro-Services

Joining the Simplicity of JavaScript with the Power of Java

The Enapso Micro-Services are high-performance and cross-platform service implementations, re-usable, scalable and secure on server and client – write once, run everywhere. Out-of-the Box services versioning, access control, validation and transformation, business process model integration and ontology/knowledge-base synchronization are supported by optional extensions.

Contact

Platforms

The Enapso Micro-Services are based on JavaScript running on multiple platforms: Java via Oracle’s Nashorn Engine, Node.js via Google’s V8 engine and pure ECMAScript to be executed on Web Clients.

While Nashorn lets you benefit from the full utilization of the Java SE and EE standards including its huge set of frameworks and data structures, its established security and multithreading technologies or simply its integer arithmetic, V8 and Nodes.js opens you the world to common.js and the NPM ecosystem. Micro-Services implemented in pure JavaScript can easily be shared between server and client to achieve a single source development without redundancies.

Enapso in its entirety is platform independent and running seamlessly under Windows, Linux and Mac OS and its combination with jWebSocket as middleware is the basis for the interoperability between various services in heterogeneous environments and a successful integration into existing enterprise application infrastructures.

Performance

Enapso Micro-Services are blazingly fast. All calls are processed asynchronously without any delay by blocking codes. Promises ensure clean and easily readable code even in complex event and callback hierarchies. In single server or virtual machine environments the Micro-Services intercommunicate via an internal memory message bus, in clustered or distributed service environments via a high-speed EventBus based on a scalable message broker (e.g. Apache ActiveMQ).

Under Nashorn the JavaScript code is just-in-time compiled and the byte code is optimized at run-time automatically by the JVM. While services in JavaScript under Nashorn benefit from the multithreading capabilities of the Java Environment, under node.js or even in the browser your services are supported by WebWorkers to achieve multithreading.

Usage

Invoking Enapso Micro-Services is as easy as usual JavaScript function calls. In the browser literally a single line sets up the client API (client wrapper) providing a single object per service container. As a developer you do not need to be aware of message transmissions. You simply call JavaScript methods and benefit from convenient promises to keep your code clean and free from complex callback stacks.

For an optimal performance the client API optionally automatically loads the JavaScript code from the server to the client to be executed locally. In case of services dependencies on Java (Nashorn) or on Node.js (common.js) the calls are transparently executed remotely, without a need to adjust your application.

Vendor Friendly

The Enapso Micro-Services are organized as vendor specific containers with one or multiple services, each of which provides an arbitrary set of methods. Containers include copyright and license information as well as meta data about a desired minification or obfuscation, about access restrictions or disclosure options.

Security

With Enapso Micro-Services, as a developer you significantly reduce your efforts for arguments and result validation. Service requests per default are validated against a JSON schema, such that calls with missing, invalid or out of range arguments are rejected and the issue optionally is logged. So your services get minimized, focused on the business logic and effectively secured against client side invocation errors.

Also the services responses per default are checked against a schema, such that even in case of service updates the application can rely on the upward compatibility of the utilized services. Responses that do not match the predefined result schema properly are not returned to the client but handled by exceptions and logged and optionally the administrator is notified. This ensures stability and security even in case of hot-deployed updates or client side triggered updates.

All asynchronous events like progress notifications for example are validated. In the same way like for responses, the application can rely on the service’s upward compatibility. As a developer you obtain a convenient support by receiving email or log notifications about potential issues from the Enapso Micro Service engine.

In order to achieve a maximum code reliability, the implementation of the services on the one hand and their validation on the other hand are cleanly decoupled and can be authorized separately, especially when a client triggered update is desired. Also per default an exception handler is wrapped around each service that allows to securely track unexpected behavior of services without affecting the functionality of the service. This allows an easy and central error detection and debugging without a single line of code in your business logic.

Beside the authorization system, to permit a code or schema update to certain users as well as to secure restricted environments an optional audit trail logs the configured kinds of changes. With Java and Nashorn the Enapso Micro-Services are fully controlled by the Java permission and security system. Node.js applications are subject to the configured user rights. In the browser the services run in the sandbox of the browser are are subject to all its security restrictions.

In order to protect intellectual property of service implementations the Enapso Micro Services can be configured to be invoked via the server side façade only, i.e. to not be passed to the clients at all. Alternatively, to increase the obstacles against unsolicited re-engineering a minification as well as an obfuscation on client transmission is supported. This reduces the code size and thereby the transaction volume by eliminating white spaces and comments and optionally replacing private and local identifiers by shorter acronyms.

The Enapso Micro-Services have been designed to support a maximum security and thus also support SSL/TLS transport encryption between server and client. Optionally asymmetric encryption algorithms can be used for end-2-end or client-2-server message encryption (future option).

Maintenance and Deployment

The Enapso Micro-Services ensure a continuous availability of your online-services. Updates or new services are hot-deployed at run-time. As an administrator you deploy updates with a single click – either from the server or you simply upload it as plain JavaScript or zip archive in real-time from the client. No server restart, container or service restart is required and applications just continue to run.

For convenience, service updates can also be distributed automatically to the involved clients utilizing the jWebSocket based Enapso push system. An optional minification reduces the transmission volume and increases the parse performance while the optional obfuscation helps to protect intellectual property. Inline documentation can be kept in the development code while the production code is securely minified.

Optionally, a file monitor observes changes to the service codes and automatically deploys updates, without the need to be explicitly triggered by the administrator. In all cases, potential syntax errors in the deployed code do not interrupt functionality and the service availability. Deployments are only applied when a pre-compilation was successful. So your app will not app crash even in case of accidental syntax errors.

Dependencies on other services or on the underlying platform (e.g. on Nashorn/Java or Common.js/Node.js) are automatically checked and resolved. Pure JavaScript services are optionally passed and executed on the browser while those with server side dependencies are asynchronously called by XHR, REST, WebSocket or Stomp via WebSocket – totally transparent for the application.

Enapso Micro-Services can easily be clustered and scaled, simply by adding a node to the high-speed backbone. On demand, the Micro-Services are state safe, since data and code are managed independently. Data (e.g. session information) is securely kept in memory while service code is updated re-using already allocated data. In clusters, service data even can be synchronized across nodes, supported e.g. by Redis or others persistence engines.

Infrastructure and Extensions

In the Enapso Micro-Service infrastructure an arbitrary number of service containers is supported, each of which with an arbitrary number of services per container and an arbitrary number of methods per service. Services can be distributed across cluster nodes, added, updated and removed at run-time by hot deployment. In hierarchies, services can easily re-use low-level services or be gathered to higher level or compound services. They are accessible via a central interface and can be assembled to complex processes, accessible by Business Process Modelling (BPM) tools.

The Enapso Micro-Services come with a high performance client-2-client (C2C) and client-2-server (C2S) messaging, broadcasting and asynchronous event mechanism and also with full support for all jWebSocket services, communication and middleware features, including SMTP, JDBC, SMS, RPC, JMS, JMX, Reporting, Monitoring, Load Balancing and much more.

The Enapso Micro-Services disclose their API to authorized users. So client stubs are created automatically, literally with a one-liner. The API can be taken over to ontologies to make them available in central enterprise knowledge bases for an optimal re-usability. Optionally the Enapso Micro-Services are subject to version control (extension), such that in even heterogeneous environments gradual updates and migrations are supported.

All Enapso Micro-Services can be equipped with arbitrary Meta data, based on containers, services and methods. This establishes the platform for standard and custom specific additional services like version control, documentation, third party stub generation, authorization, central validation and transformations, business process modelling and a dependency management for upward compatibility in heterogeneous environments etc.

Integration

Server, Messaging Technologies: jWebSocket, JMS, ActiveMQ

APIs: REST, AJAX/XHR, WebSockets (for pushing), STOMP via WebSocket, AMQP

Data Formats: JSON, XML (future)

Recommended: Logging System: log4j or Graylog

Requirements

jWebSocket Enterprise as Middleware, Java 8, ActiveMQ for Node.js Integration.