Wiki

Clone wiki

limeds-framework / Home

Table of Contents

What is LimeDS?

LimeDS (Lightweight modular environment for Data-oriented Services) is a toolkit for building JVM-based (Web) applications with a strong focus on developer productivity and interoperability with other services and devices.

Why use LimeDS?

LimeDS allows developers to immediately focus on the use-case specific implementation by drastically reducing typical boiler-plate code for setting up HTTP endpoints, managing dependencies, configuring services, etc... This is made possible thanks to a visual editor used to connect (micro)service-components (= Segments) together to form modular logical units (= Slices), that then can be deployed to any LimeDS runtime. For more advanced users, a Java API is provided that allows more complex modules to be created.

Developers can rely on LimeDS to rapidly produce software that is:

  • Easy to integrate with: LimeDS components can be exposed as HTTP endpoints out-of-the-box and Web resources can be injected into Slices effortlessly.
  • Extendable: LimeDS runs on top of OSGi and embraces modularity throughout its design. Reusable adapters for non-Web technologies can easily be incorporated and hooks are available to allow developers to plug-in e.g. authentication schemes & profiling systems seamlessly.
  • Scalable: Caching & load balancing can be configured for each individual LimeDS Segment.
  • Robust: LimeDS Segments are backed by the OSGi service layer and can cope with at runtime changes (e.g. service failure). Fallback strategies can be configured without writing code.
  • Polyglot: LimeDS Segments can be written in Java or Javascript (or other JVM supported languages) while maintaining 100% compatibility.

How does LimeDS work?

Everything as a Function

The core principle of LimeDS is that any operation, processing step or interaction can be modeled as a function call that takes input and produces output. We chose JSON as a messaging format because it is widely used and supported in almost all programming languages. This restriction on the I/O format enabled us to provide generic framework implementations for aspects such as caching and validation.

flow-function.png

To clarify, we list some examples of how typical software components can be modeled as a function:

  • Data storage: a save operation can be modeled as a function that takes an object and optionally returns the generated id. A query operation can take a JSON object as input for a query-by-example style implementation and return a JSON array of matching results.
  • RESTful Web services: a HTTP endpoint can be modeled as a function that takes as input parameters a JSON request body and a http context object (containing headers, query & path parameters) and produces JSON output.
  • Scheduled tasks: e.g. recurring processes can be modeled as a no-argument function with a timer attached.

The function call is wrapped in the LimeDS Segment abstraction, that allows utility features to be transparently configured for the function.

The Slices & Segments Paradigm

The resulting Segments form the building blocks of a LimeDS application. Specific services and functionality can then be created by combining these building blocks in what we call Slices. A Slice is made up of Segments, and Segments can be reused throughout many other Slices. To clarify this paradigm, we show a hypothetical example (with some randomly chosen technologies) of how a personal travel assistant could conceptually be modeled as a Slice.

dataflow-example.png

The entry-point for this slice is a function “startJourney” that will initialize a new travel route. We use a MongoDB database to persist the journey data. The MongoDB instance is integrated with LimeDS, by providing three functions: store, delete & query. We connect the startJourney block to the store function to store the incoming requested travel route. To be able to generate updates for the chosen journey, we introduce a trigger function that will be scheduled to execute periodically. Each time this function is executed, we use the database query function to retrieve the relevant route information. This data is then sent to an updateJourney function that will check for route updates. This can be done by using 3 data-sources:

  • A RSS news feed that lists traffic updates
  • A Web services that provides real-time information concerning train departures
  • A CSV file that contains parking information for which a new dump is generated every 15 minutes.

To integrate these 3 data-sources in the Slice, a function is made for each source that can connect to the original data-source and transform the data into a compatible format. Once all the data is processed, the updateJourney function can send an update to the user (if necessary) using the sendNotification function, which uses the Google Cloud Messaging service to send the update to the phone of the user. The Slice can be completed by adding a stopJourney function that enables the user’s travel assistant app to stop or cancel the journey. To do this, we rely on the database delete function. LimeDS allows any function to be exposed over HTTP as a Web service. We do this for the startJourney and stopJourney functions, so these operations can be called from the personal travel assistant mobile application. In addition we also expose the getParkingInfo function, because no Web service was previously available for this type of information.

Other features provided by LimeDS are:

  • Enabling validation for any function, for example we want to validate the journey information that is sent by the mobile client before initializing the update process.
  • Adding caching for any function, for example a remote call is made each time the traffic RSS feed and real-time train info Web services are called. This can take a while to complete, and the number of allowed requests for these external sources could also be limited. However, by adding a cache, we can circumvent these problems without writing any additional lines of code. Now the results will be cached locally and the amount of remote calls will be greatly reduced.

Getting Started

If you just want to experiment with LimeDS or you are planning to create Slices based on existing building blocks, we suggest following the step-by-step guide on how to set up a standalone LimeDS instance.

If you want to implement your own building blocks to use in your Slices, we suggest following the step-by-step guide on how to set up a development environment for LimeDS.

Be sure to check out the Javadoc for detailed information on the LimeDS Annotations and classes.

Basic Framework Usage

There are two integral aspects of LimeDS that you should be aware of when creating applications. The first is the Visual Editor that allows you to create Slices (as explained in the previous section) by drawing and connecting Segments. The code and configuration properties for these visual Slices can be changed in the editor at runtime. The second is our easy-to-use Java API for creating Segments that cannot directly be implemented from the Visual Editor (e.g. when integrating a new protocol or when depending on an existing Java library).

For more information on the Java API, we refer to the LimeDS Java API Wiki.

The Visual Editor is currently being reworked from the ground up, so extensive documentation is still pending. For now, the best introduction is a simple demo movie of new Editor that shows how a parking service is built from scratch using LimeDS:

limeds_youtube_link_image.png

Advanced Framework Usage

Once users get the hang of creating new Segments and implementing application features as Slices, they can start extending or modifying the behaviour of the LimeDS framework itself.

Examples of more advanced usage are:

Modules

Our default repository features a number of useful modules that can easily be installed and used as building blocks for your Slices (Data flows):

  • The LimeDS HTTP Client module allows you to perform HTTP requests from your visually designed flows.
  • The LimeDS H2 module allows you to store and retrieve data in an embedded no-SQL database, straight from your visually designed flows and Java code.
  • The LimeDS Simple Auth module provides a basic Authentication and Authorization mechanism to secure the HTTP endpoints you setup with LimeDS.

FAQ

You can read the FAQ here.

Updated