Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

The Java Middle Tier Overview

Charles Greer edited this page Jan 29, 2015 · 4 revisions

The role of a middle tier can be fairly minimal in a three-tier architecture, but, inevitably, there is still a lot going on. The middle tier in Samplestack's Java variant assumes that there are commodity solutions for building enterprise middle tier applications, and so we chose Spring Boot as a starting point for implementation.

Spring Boot met some of the requirements for Samplestack, in that we could stand up a REST server, use the MarkLogic Java Client API to interface with MarkLogic, and embed an LDAP server in order to demonstrate some non-trivial security scenarios, and we didn't have to use any XML to configure the system. Spring Boot provides an opinionated way to implement enterprise applications, and as such dictated many of the component choices in Samplestack.

Spring Boot applications run as Java executables. In the event that they are also applications for the web, the Java executable includes either an embedded Tomcat or Jetty Servlet container to respond to HTTP requests. Thus when you start up Samplestack, you're also starting up an embedded Tomcat.

In fact, if you have all of the components of the Java Samplestack and the browser dev environment, all of the following applications are working together on your machine:

  1. Browser
  2. Express Web server
  3. Tomcat Web Server with Spring Boot App
  4. Apache DS LDAP Server
  5. MarkLogic (REST instance and core services, with extensions)

If you've forgone the browser dev environment, and use simply the middle tier, then #2 is missing from this list, and the web server at #3 takes on the responsibility of serving up the application code for the browser to run.

(In a future release, a middle tier implemented in JavaScript will replace #3 and #4 with an expanded application tier at #2, implemented in JavaScript.)

So a goal for Samplestack is to see how applications backed by MarkLogic look. This three tier architecture, or some variety of it, is familiar to developers of enterprise applications. As such, some of the ideas from this project can be incorporated quickly into new solutions.