{"id":20696841,"url":"https://github.com/araobp/tega","last_synced_at":"2026-05-14T20:32:41.672Z","repository":{"id":145719408,"uuid":"43178001","full_name":"araobp/tega","owner":"araobp","description":"Config management, pubsub and rpc for IoT networking","archived":false,"fork":false,"pushed_at":"2017-07-22T08:25:23.000Z","size":1065,"stargazers_count":1,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-10T19:01:51.263Z","etag":null,"topics":["jupyter","nosql","tornado"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/araobp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-25T22:16:25.000Z","updated_at":"2019-04-15T12:09:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ee55d51-328f-4848-ad2e-6e48f73d3a54","html_url":"https://github.com/araobp/tega","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/araobp/tega","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araobp%2Ftega","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araobp%2Ftega/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araobp%2Ftega/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araobp%2Ftega/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/araobp","download_url":"https://codeload.github.com/araobp/tega/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araobp%2Ftega/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33042164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter","nosql","tornado"],"created_at":"2024-11-17T00:15:37.181Z","updated_at":"2026-05-14T20:32:41.648Z","avatar_url":"https://github.com/araobp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tega db\n\n![travis](https://travis-ci.org/araobp/tega.svg?branch=master)\n\nProject start: 2014/8/8\n\n![tega_idb](./doc/output_3_0.png)\n\nDistributed document-oriented database for small PCs (incl. Raspberry Pi), written in Python:\n- [Tornado](http://www.tornadoweb.org/en/stable/)-based\n- CRUD/RPC supported\n- Transaction supported\n- JSON-oriented (not YANG)\n- Schema-less\n- Extensible with plugins\n- NAT traversal (HTTP/WebSocket)\n- Python and Go driver\n- Easy to use\n```\n$ tega-cli\ntega CLI (q: quit, h:help)\n[tega: 0] put a.b.c\n1\n\n[tega: 1] put a.x\n2\n\n[tega: 2] get a\nb: {c: 1}\nx: 2\n```\n\n## Design policy\n- Simplicity rather than high-performance and rigid schema\n- NOSQL for non big data (small data)\n- Embeddable data base\n- Focus on config and operational data management\n- Support various integration patterns: data change notification, messaging and rpc\n- Easy-to-use APIs\n- Concurrenty support with coroutine\n- NAT/HTTP-Proxy traversal: REST and WebSocket\n\n## Why graph(tree) structure is suitable for network config in some cases\n- In general, you had better use SQL (or SQL-like db) for storing config of a whole network.\n- You define Nodes table, Links table, Subnets table... a lot of tables.\n- A subset (a set of rows from those tables) of the network config should be stored in a local db at each router. In general, such data has a tree structure (e.g., SNMP MIB).\n- There are two choices: SQL or graph(tree) database. It depends... In my case, I have chosen grap(tree) database, since I want version controll for the config (like \"git\").\n\n## Project goal\n![goal](https://docs.google.com/drawings/d/1CVeMUwvrKnbgvjriW0ftwnIMtjiMDlDMCEN0tPTSujs/pub?w=640\u0026h=480)\n\n## Use cases\n- [NLAN](https://github.com/araobp/nlan)\n- BBR remote config\n- OpenWrt remote config\n- Instant VPN (L2 or L3)\n- IOT\n\n![Deployment](https://docs.google.com/drawings/d/16z8YFQztsGXWacq8fWyVzs85UTjZqllIs-hGGwav9GY/pub?w=640\u0026h=480)\n\n## Installation\n\nYou need to have python3.5 installed on your Debian/Ubuntu Linux.\n\n```\n$ pip install tornado\n$ pip install httplib2\n$ pip install pyyaml\n$ pip install readline\n$ git clone http://github.com/araobp/tega\n$ cd tega\n$ python setup.py install\n```\n\nStart tega server with sample options, like this:\n```\n$ cd tega/scripts\n$ ./global\n```\n\nAnd start tega CLI to use CLI commands:\n```\n$ tega-cli\n```\n\n\n## Current architecture\n```\n                           [cli.py]\n                               |\n                          [driver.py]\n                               |  |\n         +---------------------+  +-----------------------+\n         |                                                |\n     Tornado                                          Tornado \n     [server.py] ------------ REST/WebSocket ---------[server.py]\n         :                                                : \n     [idb.py]...[tree.py]                             [idb.py]...[tree.py]\n         :                                                :\n     --------                                         --------\n    /tega.db/                                        /tega.db/\n   ---------                                        ---------\n   commit-log                                       commit-log\n```\n\n## Documentation\n\n### Specification\n- [tree structure](./doc/tree.png)\n- [tree structure implemention: Cont class and its attributes](./doc/attributes.md)\n- [YANG-tega comparisons](./doc/yang-tega-comparisons.md)\n- [tega message format](./doc/message-format.md)\n- [tega message sequence diagram](./doc/message-sequence.md)\n- [tega db commit-log format](./doc/tega-db-format.md)\n- [sync path and notifications](./doc/sync_path_and_notifications.md)\n- [subscription scope](./doc/subscription_scope.md)\n- [Guideline](./doc/guideline.md)\n\n### Usage\n- [CLI command usage](./doc/usage.md)\n- [data visualization by using Jupyter notebook](./doc/jupyter.md)\n\n### CRUD operations\n![operations to the tree](https://docs.google.com/drawings/d/1KOUuiQcosYpfEi4HyF7BYsiiSEW_2rJsZKy9xIPuIZQ/pub?w=600\u0026h=480)\n\n### Rollback\n![rollback](https://docs.google.com/drawings/d/1nO-BKRYPdFKBjtkdOYpFiRd1WBQPMLHp3ojlqEroJVg/pub?w=600\u0026h=480)\n\n### Consistency\n![CP](https://docs.google.com/drawings/d/11fC2DojI9gzw-FV3NG8Ubh97sKm0RmWk-tNJBu1Tt-M/pub?w=600\u0026h=480)\n\n### Collision detection\n![Collision](https://docs.google.com/drawings/d/1D45tSElc7S4bnPCV_VLwJXua2O08Jv2gMqL4xeLaf2s/pub?w=600\u0026h=480)\n\n### Garbage collection\n![garbage collection](https://docs.google.com/drawings/d/1DhOdnzqqG1wjs2-duG7f9jCQAyki-7qsrEG9pfBVKcI/pub?w=600\u0026h=480)\n\n### RPC routing\n![rpc routing](https://docs.google.com/drawings/d/1GHHYrF3s0MRypT_SxHkDAT-aFTfCtMh9NkqQrVEtvqo/pub?w=600\u0026h=480)\n\n### Integration patterns\n![integration patterns](https://docs.google.com/drawings/d/1CkqZxVHghA-9UuZ33ZHENcABnyHld5PtPw1CWY9LCJ8/pub?w=600\u0026h=480)\n\nFor example,\n- [My neutron-lan project](https://github.com/araobp/neutron-lan) has taken the pattern [D]. The implementation of the agent is not simple.\n- [My nlan project](https://github.com/araobp/nlan) has been taking the pattern [A], since Docker is for an immutable infrastructure. The implementation of the agent is quite simple.\n- In general, commercial-grade network controllers take the pattern [E]. It requires a development team with a lot of software engineers.\n- Signalling protocol developers think differently... [My another drawing](https://docs.google.com/drawings/d/1x8mm-h4Gxn8rfL7fV-2sgnjpxejSaR8cLfzr9vNJFu4/pub?w=960\u0026h=720)\n\nYou had better study how databases (incl. NOSQL ones) realize data synchronization in a cluster.\n\n## Note\n\n#### Implementation\n- Tega db is still in alpha release and part of the documentation here has not been implemented yet.\n\n#### Performance\nit is a schema-less database and the performance (especially write-performance) of this database is not good:\n- dynamic typing\n- nested hash map (hash collisions, rehashing...)\n- it makes use of for-loop a lot (Python's for-loop performance is not good)\n- it saves every commit log onto a storage\n\n## References\n* [ZooKeeper](https://www.usenix.org/legacy/event/atc10/tech/full_papers/Hunt.pdf)\n* [Cassandra](http://wiki.apache.org/cassandra/ArticlesAndPresentations)\n* [Hazelcast](https://hazelcast.org/)\n* [YANG(RFC6020)](https://tools.ietf.org/html/rfc6020)\n* [OpenDaylight MD-SAL datastore](https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Architecture:DOM_DataStore)\n* [OpenWRT UCI](https://wiki.openwrt.org/doc/uci)\n* [Session Initiation Protocol(RFC3261)](https://www.ietf.org/rfc/rfc3261.txt)\n* [OVSDB(RFC7047)](https://tools.ietf.org/html/rfc7047)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faraobp%2Ftega","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faraobp%2Ftega","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faraobp%2Ftega/lists"}