btnguyen2k / henge

NoSQL-style universal data access layer lib for Go (Golang).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

henge

Go Report Card PkgGoDev Actions Status codecov Release

An out-of-the-box NoSQL-style universal data access layer implementation for Go.

Documentation

henge aims to free application and developer from the headache of implementing low-level underlying data access layer (DAL) by offering a universal DAL implementation.

At a glance, henge can fit into application's data access layers as illustrated in the following diagram:

henge-design-full

Data storage layer

henge provides a ready-to-use data storage layer that supports (since v0.3.0):

  • Azure Cosmos DB
  • AWS DynamoDB
  • MongoDB
  • MySQL
  • MSSQL
  • PostgreSQL
  • Oracle
  • SQLite (for non-production only, i.e. testing, poc, demo)

henge uses the following schema for data storage layer (*):

  • Field/column zid: business object's unique id, implemented as primary key (for SQL storage) or partition key (for no-SQL storage). Its data type is VARCHAR or string (whichever is best fit with the underlying data store).
  • Field/column zdata: store business object's member values. Its data type is TEXT, CLOB, JSONB or string (whichever is best fit with the underlying data store).
  • Field/column zchecksum: checksum of business object data. Its data type is VARCHAR or string (whichever is best fit with the underlying data store).
  • Field/column ztcreated and ztupdated: timestamp when business object is created/last updated. Its data type is DATETIME, TIMESTAMP or string (whichever is best fit with the underlying data store).
  • Field/column ztversion: for application's internal use (can be used for compatibility check or data migration). Its data type is BIGINT, INT or number (whichever is best fit with the underlying data store).

(*) column names and data types may differ depends on the underlying data store.

henge also allows application to define its own fields/columns.

"Universal" Business Object (BO) and Data Access Object (DAO) implementations

henge also provides ready-to-use BO & DAO implementation to interact with the data storage layer.

(Optional) Custom Business Object (BO) and Data Access Object (DAO) implementations

Application can have its own BO and DAO implemenations. See source code of test scripts for examples.

License

MIT - see LICENSE.md.

About

NoSQL-style universal data access layer lib for Go (Golang).

License:MIT License


Languages

Language:Go 99.9%Language:Shell 0.1%