Baratine Documentation

Lock-Free 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
import static io.baratine.web.Web.*;

public class MyHello
{
  public static void main(String []args)
  {
    get("/hello")->to(req->req.ok("hello, world"));
    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>0.11.3</version>
</dependency>

Next Steps