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

Domain model / data schema in Scala, Protobuf and Avro #91

Open
SemanticBeeng opened this issue May 23, 2019 · 4 comments
Open

Domain model / data schema in Scala, Protobuf and Avro #91

SemanticBeeng opened this issue May 23, 2019 · 4 comments
Projects

Comments

@SemanticBeeng
Copy link

SemanticBeeng commented May 23, 2019

Looking to develop a combination of gRPC services with mu-RPC and REST endpoints which share a common domain model.

Would like to reduce boiler plate of maintaining multiple versions of the model and wondering if skeumorph can help. This provides more context for the motivation https://medium.com/@sugarpirate/exploring-the-strongly-typed-graph-31fc27512326.

Do you see a problem in principle with attempting this?

Is skeumorph mature enough to make possible
1, maintaining the truth model in protobuf
2. generating Scala domain classes and @message classes (through a few custom morphisms)
3. generating Avro version of same model from 1.

Or some combination of the above.

@pepegar
Copy link
Member

pepegar commented May 23, 2019

Hey @SemanticBeeng , glad to see you're interested in Skeuomorph!

Everything you've mentioned right there is possible to do right now using Skeuomorph, however, maybe you're more interested in https://github.com/higherkindness/compendium.

Compendium is, more or less, what the post you've mentioned above calls a schema registry. Right now is in a very early stage, but we're planning to make it a nice utility providing the following:

Right now, I repeat, is in an early stage, but we welcome new contributors, and beta testers too once it's usable.

@SemanticBeeng
Copy link
Author

SemanticBeeng commented May 24, 2019

"convert between IDL representations"

For that it relies fully on skewmorph, correct ?

Or will there be some reusable morphisms in here?
Trying to understand if the user starts from scratch with the schema transformations or will there be any library of reusable ones. It would be great to see a few non-trivial morphism examples.

@SemanticBeeng
Copy link
Author

SemanticBeeng commented May 24, 2019

Side question : json schema is sorely missing from skewmorph https://github.com/fge/json-schema-avro

What is the reason?

I stand corrected, just found https://github.com/higherkindness/skeuomorph/blob/master/src/test/scala/higherkindness/skeuomorph/openapi/OpenApiSchemaSpec.scala.
Main doc did not mention.

@SemanticBeeng
Copy link
Author

SemanticBeeng commented May 24, 2019

Related topics:

01 How will skewmorph morphisms compare with matryoshka ?
Asking because I see "hylo ".

02 This work seems reusable https://github.com/vil1/recursion-schemes-cookbook/blob/master/schemas/README.md.

03 https://github.com/scalaz/scalaz-schema is similar but meant to Big Data applications.

Would be great to have an unifying way to manage data schema for all.
Thoughts about rationale: https://gist.github.com/SemanticBeeng/2edad7a5e2cd7cd6af5cde824b4e0da0

04 https://github.com/spartanz/schemaz

"generic representation of algebraic data structures and combinators that turn such schema into a generic computation over arbitrary data"
"Skeumorph is also a possible competitor, however it is focused on providing translation between different formats (Avro, Protobuf and Mu)."

Then it would be good to have support for reshaping between bounded contexts.
For example, service apis types may need to be mapped to (more rich/structured) domain model used to implement the functionality.

Currently there are:
01 https://beyondthelines.net/programming/fluent-the-seamless-translation-layer/

02 https://scalalandio.github.io/chimney/

Wondering if these morphisms can also be specified at the schema level?

@SemanticBeeng SemanticBeeng changed the title Domain model in Scala, Protobuf and Avro Domain model / data schema in Scala, Protobuf and Avro May 25, 2019
@pepegar pepegar added this to To do in skeuomorph Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
skeuomorph
  
To do
Development

No branches or pull requests

3 participants