{"id":19844658,"url":"https://github.com/azonmedia/guzaba2","last_synced_at":"2025-05-01T20:32:29.433Z","repository":{"id":62490745,"uuid":"183163129","full_name":"AzonMedia/guzaba2","owner":"AzonMedia","description":"Guzaba Framework v2","archived":false,"fork":false,"pushed_at":"2022-04-10T08:13:45.000Z","size":1960,"stargazers_count":2,"open_issues_count":14,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-06T18:08:41.201Z","etag":null,"topics":["activerecord-objects","orm-objects","swoole","swoole-coroutines","transaction"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AzonMedia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-24T06:31:31.000Z","updated_at":"2021-12-12T21:27:40.000Z","dependencies_parsed_at":"2022-11-02T11:15:58.739Z","dependency_job_id":null,"html_url":"https://github.com/AzonMedia/guzaba2","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzonMedia%2Fguzaba2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzonMedia%2Fguzaba2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzonMedia%2Fguzaba2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzonMedia%2Fguzaba2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AzonMedia","download_url":"https://codeload.github.com/AzonMedia/guzaba2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251941249,"owners_count":21668696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["activerecord-objects","orm-objects","swoole","swoole-coroutines","transaction"],"created_at":"2024-11-12T13:05:01.785Z","updated_at":"2025-05-01T20:32:29.166Z","avatar_url":"https://github.com/AzonMedia.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Guzaba Framework v2\n\n## Overview\n\nGuzaba2 is a research framework. It explores the use nested transactions and automatic (partial) rollback, different design patterns and implementations.\nIt is not intended to be used in production (and may never be), it is not yet documented.\nThe testbed for Guzaba2 is [Guzaba Platform](https://github.com/AzonMedia/guzaba-platform).\nThe framework has certain traits (very) similar with other frameworks (it borrows code from [Slim](https://www.slimframework.com/)) and it is very different in other spects.\nIf you would like to discuss certain feature or design decition in the framework please open a [Discussion](https://github.com/AzonMedia/guzaba2/discussions).\n\nGuzaba2 (and Guzaba1) were created because there was no other framework providing:\n- nested transactions - supports partial transaction rollback and the transaction can continue and commit\n- automatic transaction rollback on abandoning the scope be it becase of an exception or a return ([SBRM](https://en.wikipedia.org/wiki/Resource_acquisition_is_initialization))\n- callbacks on various transaction events - you can add conditional block if the current (be it the master or nested) transaction commits or rollbacks\n- rollback reasons - in your callback block you can check why the transaction was rolled back - explicitly or implicitly due an exception or a return\n- you can also obtain the exception which rolled back your transaction no matter was the exception caught or not\n- ActiveRecord objects transaction - the objects will have their properties updated automatically if the transaction is rolled back (and you can still save them if needed!)\n- the transaction and transaction manager can be used to implement custom transactions (like filesystem transactions)\n\nGuzaba2 improves on and adds support for: \n- [Swoole](http://swoole.com/) based\n- database connections pool\n- automatic deallocation of obtained resources/connections (SBRM)\n- shared memory for the ORM objects - the ActiveRecord objects are just pointers to shared array with data between all coroutines\n- better ACL support compared to Guzaba1 - both for objects and classes/static methods\n- many speed optimizations (made possible by the persistent memory model of swoole) - everything is kept in local memory as a native object! No need of serialization and unserialization!\n- parallel async queries \u0026 operations (thanks to swoole coroutines)\n- it can return response in less than 1 msec! ([GuzabaPlatform](https://github.com/AzonMedia/guzaba-platform) with the [request-caching component](https://github.com/AzonMedia/component-request-caching)). This is not a time based/expiration cache but cache based on the actual business logic (update times of various objects/records and what can and cannot be cached)!\n- has debugger (over telnet)\n\nAnd some commonly found functionality:\n- PSR-7, PSR-11, PSR-15, PSR-3 (support for PSR-14, PSR-16 and PSR-17 coming)\n- ActiveRecord with temporal records and logging, multiple backend stores\n- ActiveRecord propety hooks (setting, getting, validation) and method hooks (before save, after save etc)\n- ACL permissions\n- events\n- routing\n- registry\n- dependency injection\n- caching (in memory, redis, memcached)\n\nAnd some specifics:\n- uses typed properties (PHP 7.4), union types, named parameters, attributes ([PHP 8.0](https://www.php.net/releases/8.0/en.php))\n- Guzaba2 currently supports only MySQL and Redis because these are the only database drivers for which Swoole supports coroutines\n- PostgreSQL support will be added as Swoole has a separate (less supported) driver for it\n- The MySQL store for ActiveRecord objects internally works with IDs for better performance while for API access it supports UUIDs\n- the back-end store functionality supports replacing the store of the ActiveRecord objects but currently there are SQL specifics that will prevent it to work with NoSQL DBs. This will be corrected in future.\n- currently there is no database migrations support, but will be aded in future\n- everything is an ActiveRecord - the models, the log entries, the controllers, the permissions\n- permissions can be granted on objects (records) and classes (static methods)\n- tries to avoid factories when possible\n- use of magic methods and references\n- uses static code for configuration. Classes with injected configuration constant are geenrated at startup.\n\nAnd what does not support (and probably never will):\n- the framework does not aim to replace SQL thus there is no support for creating SQL queries with a replacement language or creating queries with a query builder.\nIt supports ActiveRecord but not a complete ORM implementation like Doctrine.\nThe reasoning is that type of projects (large, complex depending on DB specifics) can not avoid the manual writing and optimization of (very) large queries and the SQL language is good at what it does.\nDB migration from one vendor to another is not supported (since the software depends on the specifics of the DB).\n- there is no automatic schema generation based on PHP classes/structures. The reverse logic is in place - the framework configures/generates the classes based on the DB schema.\n\nThe overall reasoning is that the framework is not to blurr or hide the backend storage details but instead to make it easier to work with it and to reduce the human errors related to its use.\nGuzaba2 is adding to this excellent speed and very high concurrency support by being based on Swoole and by making good use of its persistent memory model and coroutines.\n\n## Requirements\n- PHP 8.0+\n- Swoole 4.5+\n- MySQL 8.0+\n\n## Installation\n\n## Documentation\n\nDocumentation is available [here](https://github.com/AzonMedia/guzaba2-docs).\n\n## Software using Guzaba 2\n\n- [GuzabaPlatofm](https://github.com/AzonMedia/guzaba-platform)\n- [Glog](https://github.com/AzonMedia/glog)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazonmedia%2Fguzaba2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazonmedia%2Fguzaba2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazonmedia%2Fguzaba2/lists"}