{"id":25089812,"url":"https://github.com/aep/apogy","last_synced_at":"2026-02-19T11:02:58.735Z","repository":{"id":276285380,"uuid":"928817129","full_name":"aep/apogy","owner":"aep","description":"a cloud native reactive json schema database built on tikv","archived":false,"fork":false,"pushed_at":"2025-03-19T12:01:31.000Z","size":528,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T12:31:30.194Z","etag":null,"topics":["cuelang","database","graphql","jsondb","tikv"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aep.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-07T09:43:10.000Z","updated_at":"2025-03-19T11:34:11.000Z","dependencies_parsed_at":"2025-03-01T10:21:59.024Z","dependency_job_id":"a31a3074-3845-455a-be90-66877b678564","html_url":"https://github.com/aep/apogy","commit_stats":null,"previous_names":["aep/apogy"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aep%2Fapogy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aep%2Fapogy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aep%2Fapogy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aep%2Fapogy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aep","download_url":"https://codeload.github.com/aep/apogy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246679107,"owners_count":20816408,"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":["cuelang","database","graphql","jsondb","tikv"],"created_at":"2025-02-07T11:19:54.365Z","updated_at":"2026-02-19T11:02:58.728Z","avatar_url":"https://github.com/aep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![apogydb logo](./apogy.png)\n=======\n\na cloud native json schema database with composable validation\n\n - built on tikv and nats\n - strongly typed schema with bindings in most programming languages\n - durable external reconcilers inspired by kubernetes\n - first class object manipulation cli\n\n\n## quickstart\n\n    go install .\n    docker compose up -d\n    apogy server\n\nLet's create a model, which defines a schema.\nIt can be hooked into many composable reactors which validate and mutate documents.\nThe schema is defined in [yema](https://github.com/aep/yema) which should be faily obvious.\n\n```yaml\n---\nmodel: Model\nid:    com.example.Book\nval:\n  schema:\n    name: string\n    author: string\n    isbn?: string\n---\nmodel:  com.example.Book\nid:     dune\nval:\n  name:   Dune\n  author: Frank Herbert\n```\n\n    apogy apply -f examples/quickstart.yaml\n\nTry what happens when you violate the schema\n\n    apogy apply -f - \u003c\u003cEOF\n    model:  com.example.Book\n    id:     dune\n    val:\n      name:   11111111111\n    EOF\n\n    com.example.Book d9e01f23-4a56-7b89-c012-d345e6789f01 rejected: reactor schema rejected change: not serializable, field 'name' must be a string\n\n\n\nyou can also define more complex validation using a [cue](https://cuelang.org) reactor. cue reactors can also mutate the document.\n\n```yaml\n---\nmodel:   Model\nid:      com.example.Book\nval:\n  schema:\n    name: string\n    author: string\n    isbn?: string\n  cue:\n    name: strings.MinRunes(2)\n    validatedByCue: true\n```\n\n\n## query\n\nwe can search by any modelled property\n\n    apogy q 'com.example.Book(val.name=\"Dune\", val.author=\"Frank Herbert\")'\n\nwhile you can specify multiple search terms, databases can really only run one term in O(1) and the rest is O(n).\nthere is currently no automatic query planner, and i'm not sure if there should be one at all.\nstatistic query planners are good for first impressions but can later degrade in production.\n\ninstead, order the filters manually by decreasing cardinality,\nthe first filter should be the highest cardinality, meaning most specific, returning the fewest unique results.\n\nin the above example we first specify name=Dune, which is in the world of books is very specific.\nThere are only two books named Dune in the example dataset, so the next filter only needs to look at those 2.\n\n\n## optimistic concurrency\n\napogy does not support locking.\ninstead fetch the object first, then send an update keeping the version key intact\nthe server will reject the put if a different client has updated the object between the get and put.\n\nthis example will succeed because the persisted object version is 1\n\n    apogy apply -f - \u003c\u003cEOF\n    model:   com.example.Book\n    id:      dune\n    version: 1\n    val:\n      name:   Dune 2000\n      author: Frank Herbert\n    EOF\n\ndoing the same apply again is indempotent with no error,\nhowever trying to change the val while using an outdated version will fail\n\n    apogy apply -f - \u003c\u003cEOF\n    model:   com.example.Book\n    id:      dune\n    version: 1\n    val:\n      name:   Dune 3000\n      author: Frank Herbert\n    EOF\n\n    Failed to put object: 409: version is out of date\n\n\n## mutations\n\nwhile concurrent puts will fail, concurrent mutations never fail\n\n    model:   com.example.Oligarch\n    id:      bezos\n    mut:\n      money:\n        add: 1200000000000\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faep%2Fapogy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faep%2Fapogy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faep%2Fapogy/lists"}