Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using tree structure for entities #16

Open
p-himik opened this issue Nov 6, 2017 · 1 comment
Open

Consider using tree structure for entities #16

p-himik opened this issue Nov 6, 2017 · 1 comment

Comments

@p-himik
Copy link

p-himik commented Nov 6, 2017

Right now SubGraph stores entities directly in app-db under keys that look like [:some-keyword some-key-value]. It makes it incredibly hard to look at app-db with the naked eye or with tools like https://github.com/flexsurfer/re-frisk. I think it would make sense to use a tree structure and store the entities like {:some-keyword {some-key-value some-value}}.
So instead of e.g. this

{[:a/id 1] {:id 1 :name "x"}
 [:a/id 2] {:id 2 :name "y"}}

it would be this

{:a/id {1 {:id 1 :name "x"}
        2 {:id 2 :name "y"}}}
@p-himik
Copy link
Author

p-himik commented Nov 6, 2017

Another advantage of this approach is that it allows for fast querying of all entities of the same type (well, having the same ID attrs). That being said, I think it would also make sense to make it possible to rename the top-level key. It would also make it more simple to incorporate SubGraph into the existing app-dbs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant