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

Create the command driven connectors RFC #255

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ramonacat
Copy link
Collaborator

@ramonacat ramonacat commented Oct 7, 2022

Signed-off-by: Ramona Łuczkiewicz [email protected]

Signed-off-by: Ramona Łuczkiewicz <[email protected]>
@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for tremor-www ready!

Name Link
🔨 Latest commit e6186d1
🔍 Latest deploy log https://app.netlify.com/sites/tremor-www/deploys/6346875b25eb220009f3644b
😎 Deploy Preview https://deploy-preview-255--tremor-www.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Signed-off-by: Ramona Łuczkiewicz <[email protected]>
Signed-off-by: Ramona Łuczkiewicz <[email protected]>
Ramona Łuczkiewicz added 2 commits October 11, 2022 12:24
Signed-off-by: Ramona Łuczkiewicz <[email protected]>
Signed-off-by: Ramona Łuczkiewicz <[email protected]>
rfc/accepted/0021-command-driven-connectors.md Outdated Show resolved Hide resolved
rfc/accepted/0021-command-driven-connectors.md Outdated Show resolved Hide resolved
rfc/accepted/0021-command-driven-connectors.md Outdated Show resolved Hide resolved
rfc/accepted/0021-command-driven-connectors.md Outdated Show resolved Hide resolved
rfc/accepted/0021-command-driven-connectors.md Outdated Show resolved Hide resolved
`control` is an input port, through which the commands are sent.
Currently only reads are supported, so `data` is an output port.
Each message in the `data` port is a single event, with metadata containing the original command.
The commands are standardised as far as it is practical, so the connectors can be swapped without adjusting the rest of the system.
Copy link
Member

Choose a reason for hiding this comment

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

Do we support this by namespacing commands or is there another plan? What happens if a connector gets an unsupported command? Should we provide convinience functiuons for them such as file::open("some.file") that create the right events for a command?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think some sort of namespacing will be required, e.g. "query" will take a different kind of query (and possibly different arguments) based on the database, as even "file_read" can be different (depending on the underlying technologies, the paths might not be compatible, there might be more arguments needed to locate the file, etc.). I like the idea with convenience functions, I think that would give us good UX (while allowing people to still generate the commands manually if they need/wish to).

Signed-off-by: Ramona Łuczkiewicz <[email protected]>
## Unresolved Questions
[unresolved-questions]: #unresolved-questions

- How do we enforce uniformity of commands across connectors?
Copy link
Member

Choose a reason for hiding this comment

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

I really like the concept of traits, behaviors, personas , or whatever it would be called for that. (I'll go with traid in the rest of the text as it's the shortest, which is pointless since I probably wrote more in this note then I save by using trait ...)

The basic idea is that a connector defines a number of traits that specify the kind of commands it interacts with. Which traits exist we got to define possibly not in the RFC as it'll change over time, but we could start with some examples.

lets look at s3 / file / gcs as an example. I suspect it would work something like this:

  • s3 offers the fileio, objectstore and s3 traits
  • gcs offers the fileio, objectstore and gcs traits
  • file offers the fileio, fs traits

commands such as list files, open file, close file etc would be in fileio

commands like cache id could be in objectstore

and endpoint specific commands could be in gcs and s3 respectively

The reason for this is that with generic traitrs testing / prototyping and migrating become very easy. As long as no implementation specific features are used prototyping could happen with a local only connector and then switched over to a production connector on deployment.

Copy link
Member

Choose a reason for hiding this comment

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

Yes - reusable traits could be a huge boon for testing. For example, if we added seek or sync to fileio or other commands to fileio then these would be useable in tests for setup and may imply a set of associated assertions.


- How do we enforce uniformity of commands across connectors?
- How would writes work?
- Are multiple events per command allowed in the output?
Copy link
Member

Choose a reason for hiding this comment

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

My gut feeling is that batching for commands is possible, we can unbatch them and go about our work, I don't see anything that would prevent this. On the other side I don't see much of a use for this either.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yea, I think we can get away with not answering that right now, and decide when/if we actually need it

Copy link
Member

Choose a reason for hiding this comment

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

We probably want commands from a given command source to be applied in arrival order - that would seem to be a strong enough guarantee initially and consistent with what we already have for user or runtime events. Later, if we need stronger or variant guarantees - perhaps these could be controlled via command traits. A future worth iterating in this RFC IMO ...

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.

3 participants