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

Add blocksapi (BlocksProvider gprc service) #37

Merged
merged 8 commits into from
May 16, 2024
Merged

Add blocksapi (BlocksProvider gprc service) #37

merged 8 commits into from
May 16, 2024

Conversation

strokovok
Copy link
Member

This PR introduces blocksapi protobuf definitions (as well as golang-generation for those).
Currently it contains only BlocksProvider service that allows to read blocks (but not write them).

Introduced protobuf definitions: types/proto/blockapi
Convenient starting point: types/proto/blockapi/services.proto
go directory is full of autogenerated code, just ignore it

In this API I tried to cover as many use-cases as I was able to think about:

  • Different stream formats
  • Error handling
  • Potential stream filtering
  • Optional compression
  • Tunable catchup/seek/stop behavior

I also tried my best to keep it flexible, concise and self-explanatory.
But I'm sure there will be useful suggestions, objections and other comments.
Please feel free to express them there, thank you!

Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to make the messages CloudEvents-compliant in advance?

Ideally I would like it to be fully compatible with Dapr:
https://docs.dapr.io/developing-applications/building-blocks/pubsub/pubsub-cloudevents/

Things I really want:

  • source (which indexer/version) generated the block
  • full tracing support

Copy link
Member Author

@strokovok strokovok May 8, 2024

Choose a reason for hiding this comment

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

Thanks for suggestion!

Would it make sense to make the messages CloudEvents-compliant in advance?

Making them CloudEvents-compliant might make sense.

Doing that in advance - no benefit that I see. Those structures are just for wire, not for storage (objects are ephemeral, not persistent); which means that we won't have to reconvert any existing objects -> adding it later will literally imply zero migration cost (especially because protobufs are both backward and forward compatible).

source (which indexer/version) generated the block

That should be solved for storage format first (now there's no such info in storage as such).
Is doable, but requires a lot of effort. Anyway, that is separate discussion.

full tracing support

Doable. But IMHO that's a separate task (requires additional research and discussion) that can be solved independently later

Copy link
Member

Choose a reason for hiding this comment

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

The value of CloudEvents is that it is an existing standard that could be used to reduce cognitive overhead / the cost of documenting things + (potentially) some existing tools that we can reuse or even open source ourselves.

I agree that my concerns about introspection and source mapping can be solved at a later stage with zero migration cost. But these two pieces are needed for troubleshooting (which we have been struggling with) and for our investment decisions (who we hire, what services we need to fix/rewrite/optimize/etc).

What would be the timeline for these discussions?

Copy link
Member Author

Choose a reason for hiding this comment

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

can be solved at a later

My point is mostly not about solving it later, but about solving it separately from this PR. Because I want to unblock work on sidecar etc ASAP

What would be the timeline for these discussions?

That should be recognized as a separate task and then assigned to somebody (or put to backlog) depending on priority I guess

types/proto/blocksapi/services.proto Show resolved Hide resolved
types/proto/blocksapi/services.proto Outdated Show resolved Hide resolved
types/proto/blocksapi/services.proto Outdated Show resolved Hide resolved
types/proto/blocksapi/message.proto Outdated Show resolved Hide resolved
Copy link
Member

@aleksuss aleksuss left a comment

Choose a reason for hiding this comment

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

Overall looks good with a couple of nitpicks.

types/proto/blocksapi/message.proto Show resolved Hide resolved
types/proto/blocksapi/message.proto Show resolved Hide resolved
types/proto/blocksapi/message.proto Show resolved Hide resolved
types/proto/blocksapi/message.proto Show resolved Hide resolved
types/proto/blocksapi/services.proto Outdated Show resolved Hide resolved
@strokovok strokovok merged commit 8d62078 into main May 16, 2024
1 check passed
@strokovok strokovok deleted the blocksapi branch May 16, 2024 19:25
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.

4 participants