GilhariTM is a microservice framework to provide persistence for JSON objects in relational databases. This microservice framework, available in a Docker image, is configurable as per an app-specific object and relational models. Gilhari exposes a REST (REpresentational State Transfer) interface to provide APIs (POST, GET, PUT, DELETE…) for CRUD (Create, Retrieve, Update, and Delete) operations on the app-specific JSON objects.
Gilhari, meaning squirrel in Hindi, transfers JSON data between an app and a database.
Gilhari can be used to leverage existing data in legacy relational databases.
Architecturally, an app-specific Gilhari microservice, whose functional focus is to exchange JSON data with a relational database, typically fits behind other app components (perhaps another microservice and/or an API gateway) that take care of business logic, authentication, and authorizations. A Gilhari microservice may be deployed in a container orchestration system like Kubernetes for scalability.
The Gilhari framework presents template based REST APIs that are automatically adaptable to an app-specific object model. Here are some examples of the RESTful APIs exposed by Gilhari for an object model consisting of Employee objects.
REST Operation | URI | Body | Comments |
---|---|---|---|
GET | http://localhost:80/gilhari/v1/Employee | Retrieves all Employee objects | |
GET | http://localhost:80/gilhari/v1/Employee?filter=exempt=true | Retrieves all Employee objects who are exempt | |
GET | http://localhost:80/gilhari/v1/Employee/getAggregate?attribute=id&aggregateType=COUNT | Gets the count (aggregateType=COUNT) of the "id" attribute for all the Employee objects. | |
POST | http://localhost:80/gilhari/v1/Employee/ | Employee objects in JSON format | Saves one or more Employee objects specified in the Body of the request |
PUT | http://localhost:80/gilhari/v1/Employee/updateEntity | Employee objects in JSON format | Updates one or more Employee objects specified in the Body of the request |
PATCH | http://localhost:80/gilhari/v1/Employee?filter=id=39 | {"newValues":["exempt","false"]} | Updates the exempt value to “false” for the Employee with id=39 |
DELETE | http://localhost:80/gilhari/v1/Employee/deleteEntity | Employee objects in JSON format | Deletes one or more Employee objects specified in the Body of the request |
DELETE | http://localhost:80/gilhari/v1/Employee?filter=exempt=true | Deletes all the exempt Employee objects |
More details on the syntax and semantics of the REST APIs are provided here and in the Gilhari SDK. You may also find the Gilhari API details in the POSTMAN documentation by importing the "Gilhari REST API" collection in POSTMAN from the following link (File -> Import -> Import from Link): https://www.postman.com/dperiwalst/workspace/gilhari-workspace/collection/36957822-96723d13-25ea-4e3c-8150-407034561a45?action=share&creator=36957822