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

docs(adrs): init WIP ClickHouse ADR #179

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

djwhitt
Copy link
Collaborator

@djwhitt djwhitt commented Jul 26, 2024

This ADR is not finished, but is open for comment, especially wrt what about this decision needs the most explanation.

This ADR is not finished, but is open for comment, especially wrt what
about this decision needs the most explanation.
Copy link
Contributor

coderabbitai bot commented Jul 26, 2024

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.
Walkthrough

Walkthrough

This change introduces ClickHouse as an additional backend for the GraphQL interface of the ar-io-node project, aiming to improve scalability and performance over the existing SQLite implementation. The documentation evaluates various database options, highlighting ClickHouse's strengths in batch loading and query performance, while also addressing its operational complexity. The structure provides a clear analysis of the decision-making process and future implications for the project's architecture.

Changes

File Path Change Summary
docs/madr/001-clickhouse-gql.md Introduced ClickHouse as a potential backend for GraphQL, detailing its advantages in scalability and performance, while also discussing challenges. The document includes a thorough evaluation of multiple database options.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant GraphQL Server
    participant ClickHouse
    Client->>GraphQL Server: Query Data
    GraphQL Server->>ClickHouse: Fetch Data
    ClickHouse-->>GraphQL Server: Return Data
    GraphQL Server-->>Client: Send Response
Loading

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4c8db72 and 33837c4.

Files selected for processing (1)
  • docs/madr/001-clickhouse-gql.md (1 hunks)
Additional context used
LanguageTool
docs/madr/001-clickhouse-gql.md

[style] ~14-~14: Consider a shorter alternative to avoid wordiness.
Context: ...uet (needed for our indexing protocol). In order to address these issues, we intend to impl...

(IN_ORDER_TO_PREMIUM)


[grammar] ~19-~19: This phrase is duplicated. You should probably use “the specific” only once.
Context: ... for this new backend. TODO: expand on the specific the specific issues with SQLite and the problem cons...

(PHRASE_REPETITION)


[style] ~71-~71: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...## DuckDB - + Embedded version - + Very simple to run (embedded like SQLite) - - No ...

(EN_WEAK_ADJECTIVE)


[uncategorized] ~96-~96: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...: references, etc. ## Notes TODO: add high level thoughts and conclusions here

(EN_COMPOUND_ADJECTIVE_INTERNAL)

Additional comments not posted (2)
docs/madr/001-clickhouse-gql.md (2)

22-31: LGTM!

The decision drivers section is well-structured and covers important factors.


32-38: LGTM!

The considered options section is clear and lists relevant database options.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

This matches what we're doing in other repos.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Outside diff range, codebase verification and nitpick comments (1)
docs/madrs/001-clickhouse-gql.md (1)

71-71: Consider an alternative to "very simple to run".

The phrase "very simple to run" can be replaced with a more precise alternative.

-  `+` Very simple to run (embedded like SQLite)
+  `+` Extremely easy to run (embedded like SQLite)
Tools
LanguageTool

[style] ~71-~71: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...## DuckDB - + Embedded version - + Very simple to run (embedded like SQLite) - - No ...

(EN_WEAK_ADJECTIVE)

Comment on lines 3 to 6
- Status: draft
- Deciders: ...
- Date: 2024-07-26
- Authors: [David]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete the deciders field.

The deciders field is currently incomplete. Ensure to list all the decision-makers involved in this ADR.


## Decision Outcome

TODO: summarize the decision
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete the decision outcome section.

The Decision Outcome section is currently a TODO placeholder. Ensure to summarize the decision made.


## Pros and Cons of the Options

TODO: replace or augment with a table
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete the pros and cons table.

The Pros and Cons of the Options section contains a TODO placeholder for a table. Ensure to replace or augment the list with a table.


## Links

TODO: references, etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete the links section.

The Links section is currently a TODO placeholder. Ensure to add references and other relevant links.


## Notes

TODO: add high level thoughts and conclusions here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete the notes section.

The Notes section is currently a TODO placeholder. Ensure to add high-level thoughts and conclusions.

Tools
LanguageTool

[uncategorized] ~96-~96: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...: references, etc. ## Notes TODO: add high level thoughts and conclusions here

(EN_COMPOUND_ADJECTIVE_INTERNAL)

Comment on lines 19 to 20
TODO: expand on the specific the specific issues with SQLite and the problem
constraints
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the duplicated phrase.

The phrase "the specific" is duplicated.

-  TODO: expand on the specific the specific issues with SQLite and the problem
+  TODO: expand on the specific issues with SQLite and the problem
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
TODO: expand on the specific the specific issues with SQLite and the problem
constraints
TODO: expand on the specific issues with SQLite and the problem
constraints
Tools
LanguageTool

[grammar] ~19-~19: This phrase is duplicated. You should probably use “the specific” only once.
Context: ... for this new backend. TODO: expand on the specific the specific issues with SQLite and the problem cons...

(PHRASE_REPETITION)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Comment on lines +3 to +6
- Status: draft
- Deciders: ...
- Date: 2024-07-26
- Authors: [David]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete the deciders field.

The deciders field is currently incomplete. Please list the individuals or teams responsible for this decision.

Comment on lines +8 to +20
## Context and Problem Statement

The initial version of the ar-io-node used SQLite as its primary database
backend (KV stores are also used in specific cases). While SQLite generaly
works well, it has some limitations. It is difficult to scale up and out, has
mediocre batch loading performance, and does not have native suport for Parquet
(needed for our indexing protocol). In order to address these issues, we intend
to implement a new GQL backend that can be used in combination with SQLite (and
other future DB backends). This decision record documents the evaluation of
database options for this new backend.

TODO: expand on the specific the specific issues with SQLite and the problem
constraints
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elaborate on the specific issues with SQLite.

The TODO comment indicates that more details are needed on the specific issues with SQLite and the problem constraints.

Do you want me to help expand this section or open a GitHub issue to track this task?

Tools
LanguageTool

[style] ~14-~14: Consider a shorter alternative to avoid wordiness.
Context: ...uet (needed for our indexing protocol). In order to address these issues, we intend to impl...

(IN_ORDER_TO_PREMIUM)


[grammar] ~19-~19: This phrase is duplicated. You should probably use “the specific” only once.
Context: ... for this new backend. TODO: expand on the specific the specific issues with SQLite and the problem cons...

(PHRASE_REPETITION)

Comment on lines +39 to +41
## Decision Outcome

TODO: summarize the decision
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summarize the decision outcome.

The TODO comment indicates that the decision summary is missing. Please provide a summary of the decision outcome.

Do you want me to help summarize the decision outcome or open a GitHub issue to track this task?

Comment on lines +53 to +89
## Pros and Cons of the Options

TODO: replace or augment with a table

### ClickHouse

- `+` Native Parquet ingest support
- `+` Extremely fast batch ingest (millions of rows per second)
- `+` Table sorting
- `+` Easily horizontally scalability for reads
- `+` Excellent vertical scalability
- `+` Relatively simple ops (easy single node setup)
- `-` Horizontal write scaling is doable, but more complex
- `-` No easy to use embedded version

### DuckDB

- `+` Embedded version
- `+` Very simple to run (embedded like SQLite)
- `-` No table sorting
- `-` Limited scalability (single node)

### Druid

- `+` Extremely scalable horizontal reads and writes
- `-` Only supports sorting by time
- `-` Complex to run and operate

### Elastic/OpenSearch

- `+` Bulk loading API
- `+` Horizontally scalabilit
- `+`
- `-` Limited indexing flexibility (difficult to tailor to specific use cases)
- `-` Limited sorting capabilities
- `-` No native Parquet support

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a table for better readability.

The pros and cons section provides a good overview but could be improved with a table for better readability.

Do you want me to help create a table or open a GitHub issue to track this task?

Tools
LanguageTool

[style] ~71-~71: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...## DuckDB - + Embedded version - + Very simple to run (embedded like SQLite) - - No ...

(EN_WEAK_ADJECTIVE)

Comment on lines +90 to +92
## Links

TODO: references, etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add references and links.

The TODO comment indicates that references and links are missing. Please provide references and links to relevant resources.

Do you want me to help add references or open a GitHub issue to track this task?

Comment on lines +94 to +96
## Notes

TODO: add high level thoughts and conclusions here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add high-level thoughts and conclusions.

The TODO comment indicates that high-level thoughts and conclusions are missing. Please provide high-level thoughts and conclusions.

Do you want me to help add high-level thoughts and conclusions or open a GitHub issue to track this task?

Tools
LanguageTool

[uncategorized] ~96-~96: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...: references, etc. ## Notes TODO: add high level thoughts and conclusions here

(EN_COMPOUND_ADJECTIVE_INTERNAL)

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.40%. Comparing base (08468da) to head (33837c4).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #179   +/-   ##
========================================
  Coverage    67.40%   67.40%           
========================================
  Files           29       29           
  Lines         7146     7146           
  Branches       383      383           
========================================
  Hits          4817     4817           
  Misses        2328     2328           
  Partials         1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@djwhitt
Copy link
Collaborator Author

djwhitt commented Jul 26, 2024

@coderabbitai pause

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

Successfully merging this pull request may close these issues.

1 participant