Agrest Overview


1. What is Agrest

Agrest is a set of tools to build web APIs for your data. You would use it to expose a data store (such as a relational database) as a RESTful web service. To achieve that goal Agrest defines a simple HTTP/JSON-based protocol (described in Agrest Protocol) and a server-side framework (described in Agrest Framework). The protocol ensures that any client, be it JavaScript, a mobile app or maybe a server-side app, can make sense of any Agrest-enabled service. The framework is written in Java and helps you to build services adhering to the protocol.

Agrest is open source and is distributed under the terms of Apache 2.0 license

2. What Agrest is Not

Agrest is not an automated engine to take your DB online with a single command. You still have to write code for JAX-RS endpoints (however simple and trivial that code might end up being). Having this code around allows you to customize processing, implement security around endpoints, hide certain methods, etc. This is a defensive approach that goes a long way to avoid unintended consequences when opening up your data on the web.

Having said that, such an engine can be written on top of Agrest with relative ease.

3. Supported Data Stores

Agrest is written on top of Apache Cayenne ORM and supports any relational data store, such as MySQL or Oracle. Support for alternative data stores can be provided with relative ease. E.g. NoSQL databases, flat files, etc. E.g. we’ve written POJO and LDAP backends.

4. Security

From the very beginning Agrest was designed with security in mind. It can be easily integrated with common web and enterprise security solutions (OAuth, Apache Shiro, Spring Security, etc.), giving Java developers a straightforward API to implement custom object and attribute-level access.