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

DDD-6 Debezium Operator #7

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

DDD-6 Debezium Operator #7

wants to merge 2 commits into from

Conversation

jcechace
Copy link
Member

First draft of DDD for Debezium Operator. This should be iteratively improved and serve as a preliminary documentation.

DDD-6.md Outdated

## Open Questions

1) Do we need a service? What for?
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need service right now. Debezium does not expose any data endpoint.

Copy link
Member Author

Choose a reason for hiding this comment

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

+1 I will remove the service then

DDD-6.md Outdated
negate: false
prop: 42
sink:
type: kafka
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose type is just plain string, not enum of allow sinks, is it correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, but changing it to enum would be quite simple. However an "outdated" operator would be unusable in case of a new sink release.

Copy link
Contributor

Choose a reason for hiding this comment

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

I personally prefer the plain string - for sake of flexibility.

DDD-6.md Outdated
producer.key.serializer: org.apache.kafka.common.serialization.StringSerializer
producer.value.serializer: org.apache.kafka.common.serialization.StringSerializer
source:
class: io.debezium.connector.mongodb.MongoDbConnector
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not now byt we might consider to use a logical name instead of a class name.

DDD-6.md Outdated
source:
class: io.debezium.connector.mongodb.MongoDbConnector
mongodb.connection.string: mongodb://debezium:[email protected]:27017/?replicaSet=rs0
database.history: io.debezium.relational.history.FileDatabaseHistory
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not now byt we might consider to use a logical name instead of a class name.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, for the "typed" configuration this would make sense.

DDD-6.md Outdated
2) How to handle "Templating" to allow customization of deplyments outside of the scope allowed by the operator
- This is needed due to reconciliation (JOSDK doesn't allow merge reconciliations)
- It also solves a problem of different requirements between sinks (e.g. only some require environment variables)
3) Dynamic vs Static cnfiguration typing
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's start with the dynamic approach. It is the easiest to implement.
To de-couple sink/operator development we might allow combination of both. Does it make sense to introduce a separate namespace already that will represent the dynamic configuration and will be the only option right now while later on we could introduce statics too?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not really sure what you mean by namespace in this context. The idea here is that the properties under sink are mostly just gathered into a map.

In theory in future we could do something such as

sink:
  kafka:
    bootstraps: kafka:9092

so esentially we would introduce a typed property for each sink

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I understand, my plan was to hve something like

sink:
  kafka:
    bootstraps: kafka:9092
    additional:
       prop1:
       prop2:

So you could use arbitrary props even with typed properties in place - for cases when the is a delay between operator/server, or if something is omitted.
Namespace in this case is the separate field - here named additional that contains this dynamic configuration.
What I was talking about was placing the conf options under such distinct field so it will stay bacward compatible when typed configuration will be available.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this can be there for sure. The question is what should be the initial state before we introduce these typed sink configurations. The way I see it we have three option

  1. Current version
sink:
  type: kafka
  prop1:
  prop2: 

then later we could add the typed versions

sink:
  kafka:
    bootstraps: kafka:9092
    additional: 
      prop1:
      prop2:

in this case the type and additional props would still be directly part of Sink but validation would be put in place to ensure these configs are mutually exclusive

  1. Slightly modified current verison
sink:
  type: kafka
  additional: 
    prop1:
    prop2:

Then again, after introducing the typed kafka (and so on) config we would ensure that type is mutually exclusive (sink.additonal could be then merged into sink.kafka.additional)

  1. We initially introduce an arbitrary sink type
sink:
  config:
    type: kafka
    bootstraps: kafka:9092
    prop1:
    prop2:

In this scenario sink.config is essentially an extra nesting of current sink.

Copy link
Member Author

@jcechace jcechace May 31, 2023

Choose a reason for hiding this comment

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

Or... thinking about it.. which is probably the best from implementation point of view.

The initial version is going to be

sink:
  type: kafka
  config:
     prop1:
     prop2:

Once again, config is essentially an arbitrary dynamic sink type (and also technical equivalent of the additional filed)

And then later once typed configs are introduced

sink:
  type: kafka # must be kafka for kafkaConfig
  kafkaConfig:
    bootstraps: kafka:9092
  config: 
    prop1:
    prop2:

This gives as the best backwards compatibility and also allows us to use the type field as a decision point for which typed config to read (if none of known values matched, then the dynamic config would be expected)

WDYT?

DDD-6.md Outdated
3) Dynamic vs Static cnfiguration typing
- Per sink type configuration with specific properties
- Single sink configurationion with arbitrary properties in form of `Map<String, Object>`
4) Per namespace / all namespaces / both?
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd start with per-namespace as it is least compplicated from k8s - speaking of security and privileges.

DDD-6.md Outdated
## Open Questions

1) Do we need a service? What for?
2) How to handle "Templating" to allow customization of deplyments outside of the scope allowed by the operator
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sorry but I don't follow this question. Could you please share an example?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jcechace jcechace marked this pull request as draft May 30, 2023 21:38
@jcechace jcechace force-pushed the ddd-6 branch 2 times, most recently from bed4534 to 795ee5f Compare May 31, 2023 15:45
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.

2 participants