orbit_database


Nameorbit_database JSON
Version 1.0.20 PyPI version JSON
download
home_pagehttps://gitlab.com/madpenguin/orbit-database
SummaryDatabase library for Python based on LMDB storage engine
upload_time2023-10-18 17:10:21
maintainer
docs_urlNone
authorGareth Bult
requires_python>=3.8,<4.0
license
keywords database nosql lmdb
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Orbit Database - Introduction

#### Welcome to the Orbit Database repository and documentation. All project documentation is included within this repository and consists of markdown files and comments within the code. These are presented in real time by the "ZeroDocs" Orbit application which renders this content to HTML in real-time.

This project is the NoSQL database that underpins the Orbit Framework. The interface is written in Python3 and uses LMDB as it's back-end key/value store. Please don't be put off by the <i>written in Python</i> statement, the database performs well and in many cases surpasses what you might expect from a dedicated database engine such as MariaDB or Postgres. The software architecture looks like this ...

<table><tr><td><img style="height:350px" src="images/orbit_database.png" /></td><td>
<h3 style="padding-left:1.4em">Primary design goals</h3>

* Must perform well in a Python multi-processing environment
* Must integrate well with Python based microservices
* Must be easy to deploy in a cloud environment
* Must be easily testable in a Python environment
* Must offer the same basic functionality as mainstream database engines
* Must facilitate efficient real-time triggers when data is changed
* Must be easy to replicate in real time
</td></tr></table>

Although these goals are entirely subjective, when compared to Python applications using traditional SQL databases, in general these goals have arguably been surpassed. If you are looking for a fast primary database to use in a native non-Python environment, then look elsewhere. If you need a database system with more capacity for use outside of Python, then consider Orbit-Database as a cache / real-time buffer between your 'real' database and each user's screen. If all you need is a read-speed of a few hundred thousand records a second, and an ACID write speed of 20,000 per second, look no further!

### Database Features

* Schemaless / NoSQL model, but with dynamic ORM system
* Database interface effectively reads and writes Python objects
* Secondary indexes can be created using any Python expression / function
* Secondary indexes support primary and duplicate variants
* The storage engine supports ACID Transactions
* Locking system enables massively parallel writing over many processes
* Super lightweight, pip installable Python3 library with no persistent server

This database has been around since 2017 and had gone through a number of incarnations to arrive at this point. It started life as a quick and dirty solution to a long running problem and has morphed into a relatively polished solution which is now the cornerstone of Orbit Communicator and the Orbit Framework.

### What does it look like?

As a basic example, if we wanted to have a database with a table called people, and within that table store records of individuals, we might have something like the following. We would start by setting up an ORM model for the table which consists of two classes. The first is uses to represent an individual, or a single records within the table, the second to represent a collection of individuals, or a collection of records.

```python
from orbit_orm import BaseTable, BaseCollection

class PeopleTable (BaseTable):
    norm_table_name = 'people'

class PeopleCollection (BaseCollection):
    table_class = PeopleTable
```

Once we have this, we can open up a database and start work on some data. When we open the database we need to tell it which ORM models we'll be using (PeopleCollection in this case) and the name of the database. At a basic level a PeopleCollection() object resolves to an iterator for the contents of the table. Iterators always yield a <i>result</i> object, which in turn contains a <i>doc</i> object, which is your record. (or Person in this instance)

```python
from orbit_database import OrbitDatabase
from schema.People import PeopleCollection

OrbitDatabase([PeopleCollection]).open('my_database')
for result in PeopleCollection():
    person = result.doc
    print(f'Name={person._name} Age={person._age}')
```

## Todo List (features)

* Deploy new indexing on OC + test - running - wip
* Write V2 conversion routine - wip
* Implement rename table in shell
* Implement rename index in shell
* Freelist management and compression for full-text indexcies
* Resting encryption for specific fields and raw blobs and words
* Better form of JSON for reading fields without deserialisation
            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/madpenguin/orbit-database",
    "name": "orbit_database",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "database,nosql,lmdb",
    "author": "Gareth Bult",
    "author_email": "gareth@madpenguin.uk",
    "download_url": "https://files.pythonhosted.org/packages/d8/aa/c3310ace1d4b6f769169295a72fdbc48304ce10a4d993556fe38dacbcad0/orbit_database-1.0.20.tar.gz",
    "platform": null,
    "description": "# Orbit Database - Introduction\n\n#### Welcome to the Orbit Database repository and documentation. All project documentation is included within this repository and consists of markdown files and comments within the code. These are presented in real time by the \"ZeroDocs\" Orbit application which renders this content to HTML in real-time.\n\nThis project is the NoSQL database that underpins the Orbit Framework. The interface is written in Python3 and uses LMDB as it's back-end key/value store. Please don't be put off by the <i>written in Python</i> statement, the database performs well and in many cases surpasses what you might expect from a dedicated database engine such as MariaDB or Postgres. The software architecture looks like this ...\n\n<table><tr><td><img style=\"height:350px\" src=\"images/orbit_database.png\" /></td><td>\n<h3 style=\"padding-left:1.4em\">Primary design goals</h3>\n\n* Must perform well in a Python multi-processing environment\n* Must integrate well with Python based microservices\n* Must be easy to deploy in a cloud environment\n* Must be easily testable in a Python environment\n* Must offer the same basic functionality as mainstream database engines\n* Must facilitate efficient real-time triggers when data is changed\n* Must be easy to replicate in real time\n</td></tr></table>\n\nAlthough these goals are entirely subjective, when compared to Python applications using traditional SQL databases, in general these goals have arguably been surpassed. If you are looking for a fast primary database to use in a native non-Python environment, then look elsewhere. If you need a database system with more capacity for use outside of Python, then consider Orbit-Database as a cache / real-time buffer between your 'real' database and each user's screen. If all you need is a read-speed of a few hundred thousand records a second, and an ACID write speed of 20,000 per second, look no further!\n\n### Database Features\n\n* Schemaless / NoSQL model, but with dynamic ORM system\n* Database interface effectively reads and writes Python objects\n* Secondary indexes can be created using any Python expression / function\n* Secondary indexes support primary and duplicate variants\n* The storage engine supports ACID Transactions\n* Locking system enables massively parallel writing over many processes\n* Super lightweight, pip installable Python3 library with no persistent server\n\nThis database has been around since 2017 and had gone through a number of incarnations to arrive at this point. It started life as a quick and dirty solution to a long running problem and has morphed into a relatively polished solution which is now the cornerstone of Orbit Communicator and the Orbit Framework.\n\n### What does it look like?\n\nAs a basic example, if we wanted to have a database with a table called people, and within that table store records of individuals, we might have something like the following. We would start by setting up an ORM model for the table which consists of two classes. The first is uses to represent an individual, or a single records within the table, the second to represent a collection of individuals, or a collection of records.\n\n```python\nfrom orbit_orm import BaseTable, BaseCollection\n\nclass PeopleTable (BaseTable):\n    norm_table_name = 'people'\n\nclass PeopleCollection (BaseCollection):\n    table_class = PeopleTable\n```\n\nOnce we have this, we can open up a database and start work on some data. When we open the database we need to tell it which ORM models we'll be using (PeopleCollection in this case) and the name of the database. At a basic level a PeopleCollection() object resolves to an iterator for the contents of the table. Iterators always yield a <i>result</i> object, which in turn contains a <i>doc</i> object, which is your record. (or Person in this instance)\n\n```python\nfrom orbit_database import OrbitDatabase\nfrom schema.People import PeopleCollection\n\nOrbitDatabase([PeopleCollection]).open('my_database')\nfor result in PeopleCollection():\n    person = result.doc\n    print(f'Name={person._name} Age={person._age}')\n```\n\n## Todo List (features)\n\n* Deploy new indexing on OC + test - running - wip\n* Write V2 conversion routine - wip\n* Implement rename table in shell\n* Implement rename index in shell\n* Freelist management and compression for full-text indexcies\n* Resting encryption for specific fields and raw blobs and words\n* Better form of JSON for reading fields without deserialisation",
    "bugtrack_url": null,
    "license": "",
    "summary": "Database library for Python based on LMDB storage engine",
    "version": "1.0.20",
    "project_urls": {
        "Documentation": "https://gitlab.com/madpenguin/orbit-database",
        "Homepage": "https://gitlab.com/madpenguin/orbit-database",
        "Repository": "https://gitlab.com/madpenguin/orbit-database"
    },
    "split_keywords": [
        "database",
        "nosql",
        "lmdb"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57ac06d40d60825f334977310089ed00f847e59f6388eee044e134ae86f2e67a",
                "md5": "392c94a71ad49b6efd7075f9c84a6f2e",
                "sha256": "e98fdfb9d16c1d4430b81026a80971bb1a5c9569a6ef3de1c2a1bbdb3a986765"
            },
            "downloads": -1,
            "filename": "orbit_database-1.0.20-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "392c94a71ad49b6efd7075f9c84a6f2e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 68006,
            "upload_time": "2023-10-18T17:10:19",
            "upload_time_iso_8601": "2023-10-18T17:10:19.672158Z",
            "url": "https://files.pythonhosted.org/packages/57/ac/06d40d60825f334977310089ed00f847e59f6388eee044e134ae86f2e67a/orbit_database-1.0.20-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d8aac3310ace1d4b6f769169295a72fdbc48304ce10a4d993556fe38dacbcad0",
                "md5": "5e1fa17b02b85ac862ce44ead716f109",
                "sha256": "553cd39a9598e0b5eaec9cc1deda0f1e7356ea0b227ece283681c16a18b2fc31"
            },
            "downloads": -1,
            "filename": "orbit_database-1.0.20.tar.gz",
            "has_sig": false,
            "md5_digest": "5e1fa17b02b85ac862ce44ead716f109",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 55970,
            "upload_time": "2023-10-18T17:10:21",
            "upload_time_iso_8601": "2023-10-18T17:10:21.811275Z",
            "url": "https://files.pythonhosted.org/packages/d8/aa/c3310ace1d4b6f769169295a72fdbc48304ce10a4d993556fe38dacbcad0/orbit_database-1.0.20.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-18 17:10:21",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "madpenguin",
    "gitlab_project": "orbit-database",
    "lcname": "orbit_database"
}
        
Elapsed time: 0.12558s