About
Hitchy is a server-side framework purely written in Javascript. It consists of a core which comes with limited abilities as it is basically capable of essentially handling requests via HTTP and discovering plugins to provide some actual request handlers.
The Odem plugin is adding a document-oriented database to a Hitchy-based project. It doesn't feature any request handlers, but provides an API for managing structured data on server-side.
- It focuses on non-relational data.
- It intends to provide a simple way for defining data structures.
- It supports an API to adopt database APIs for persistently storing structured data.
- It offers a dedicated API for accessing structured data using server-side code.
Remote access support
APIs for remotely accessing this database are implemented by dedicated plugins you need to add to your project.
- An HTTP-based REST API is implemented by @hitchy/plugin-odem-rest.
- Accessing data via some web socket is provided by @hitchy/plugin-odem-socket.io.
Structured data?
In a document-oriented database you define types of data often referred to as classes or models. Every such model describes a collection of documents, instances or items which are simply records of actual data each complying with a certain structure which is part of a model's definition. It is a set of properties, each of a certain type of information and with optionally applied constraints. On handling items of a model, every property of that model has an individual value for either item.
Example
The quite common example for implementing a simple web application is a blog. A blog has posts, comments and users that act in different roles. These all are models of that application.
Every model consists of common properties. A blog always has a title and some content, a time of creation and an author. In opposition to that a comment belongs to a post, but has an author, some content and a time of creation as well. Users have a unique login name, a secret password and some mail address.
As explained Some properties are meant to be unique or to be always there. Such keywords indicate constraints that might apply on a property. Constraints are rules to be met by either item prior to saving it in a database or similar. This helps to assure the integrity of all data.
All this describes similarities in records of actual data. It doesn't describe any actual data of your application, though, such as a user named Bob or Alice or any of either user's posts in particular. Information describing Bob and Alice as users are instances a.k.a. items of the model user.