Baratine Documentation

Lock-Free Reactive Web Server

See Web for HTTP/Web documentation.

Baratine’s web server is reactive with continuation-style programming, avoiding locking by using Baratine services.

It maintains a simple programming interface supporting both programming APIs and more traditional annotation-based methods. Views, JSON, and websockets are built in.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import io.baratine.web.Web;

public class MyHello
{
  @Get("/hello")
  public void get(@Query("name") String name, RequestWeb request)
  {
    request.ok("hello " + name);
  }

  public static void main(String []args)
  {
    Web.include(MyHello.class);

    Web.go(args);
  }
}

Encapsulated Services

See Baratine Service for service documentation.

_images/service-proxy-stub.png

Baratine services:

  • Strong encapulation boundaries.
  • Each service has its own thread and efficient lock-free inbox.
  • Inside a service, application code can be single-threaded.
  • Persistent services load and store to a document-style key/value database.
  • Services use their data in-memory; loading and storing is transparent.
  • Services own their data in an object-oriented model. They don’t need additional locks or transactions to protect against other services modifying their data; they own their own data.

Persistent In-Memory Vaults

See Vault Services for in-memory persistence documentation.

_images/baratine-vault.png

In-memory persistent services are built-in to Baratine, using its asynchronous high-performance internal database Kraken.

An Application service operates on its data in-memory, improving performance and simplifying code. The data is automatically loaded and saved to the internal document-oriented database as part of the asset lifecycle.

Maven Dependency

<dependency>
        <groupId>io.baratine</groupId>
        <artifactId>baratine</artifactId>
        <version>1.0.0</version>
</dependency>

Next Steps