daostack / daostack/subgraph

Consider simplifying the graphql model

Open
#172 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
44
Forks
30
PR merge metrics
No merged PRs in 30d

Description

opened by @orenyodfat in behalf of @jellegerbrandy

We subgraph has a lot of complexity: many entities and many many filter options that we will never use.

For example:

* We have entities that no-one ever required and for which it is hard to see a use case (i.e. practicaly for each event there is an entity)
* We have an enormous amount of never-needed filter options (that are probably automagically generated by subgraph)

This is not an immediate problem, but this kind of bloat does not come for free and may be problematic later:

* Insertion will be slower. Each entity will need its own insertion logic (obvious) which takes some time ; in addition each filter option represents a postgresql index, which takes its time as well.
This slow insertion has a direct performance effect on alchemy: i.e. if indexing a block takes 3 seconds longer, then it will take 3 seconds longer for alchemy to be updated with the latest data.
* This stuff (bot the extra entities as well as the indexes) take up disk space (ok, who cares, space is a commondity, but still :-)
* This complexity takes up head space. This is important. I find myself constantly filtering through lots of noise just to find which entities to query for my info.

SO: can we clean this up?

(As a footnote: why index all events? If we want to listen to events, listening to them on ethereum is faster;while if we want data aggregation (for nice historical graphs or something) we'd probably need a specifically defind data model and not the primitive events)

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the subgraph's entities and generated filter options, then compare them with the query needs described in the issue. Define which entities and filters should remain, and assess the effect of the reduced model on PostgreSQL indexes, insertion time, and historical data queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, postgresql, typescript
Domain
backend-api-design, blockchain, databases
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.