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

DB Client examples #1329

Merged
merged 10 commits into from
Jan 31, 2020
Merged

DB Client examples #1329

merged 10 commits into from
Jan 31, 2020

Conversation

Tomas-Kraus
Copy link
Member

@Tomas-Kraus Tomas-Kraus commented Jan 29, 2020

DB Model:

  • Types (id, name) -- Pokemon type table
  • Pokemons (id, name, id_type) -- Pokemon entity table with Types(id) reference

Use-cases:

  • List all Pokemons (without types)
  • Get pokemon by ID
  • Get pokemon by name
  • Create pokemon
  • Update pokemon
  • Delete pokemon by ID

Readme

@Tomas-Kraus Tomas-Kraus self-assigned this Jan 29, 2020
@m0mus
Copy link
Contributor

m0mus commented Jan 29, 2020

I don't like many-to-many. For a simple demo we should stick with one-to-many relationship.

Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

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

The current DB example should be left to demonstrate similiarity when using JDBC and mongo.
Also create a separate example for JDBC and for Mongo that will show more than one table that can be used by customers to "bootstrap" their microservice.

@Tomas-Kraus
Copy link
Member Author

Tomas-Kraus commented Jan 29, 2020

@m0mus Bad news is, that I've already done 90% of the demo and it works for both Mongo and JDBC. But I can create another more simple sample with following 1:N schema:

  • Trainer (id, name) -- pokemon trainer
  • Pokemon (id, name, id_trainer) -- pokemon caucht by trainer

And we can make following services:

  • add trainer [CREATE]
  • rename trainer [UPDATE]
  • delete trainer (and all his pokemons) [DELETE]
  • catch pokemon (by trainer) [CREATE]
  • rename poemon [UPDATE]
  • release pokemon (by trainer) [DELETE]
  • list all trainers without pokemons [READ]
  • list all pokemons with trainer who owns them [READ with join]
  • get pokemon [READ]
  • get trainer with pokemons list [complex READ]

@m0mus
Copy link
Contributor

m0mus commented Jan 29, 2020

@Tomas-Kraus I can only repeat that many-to-many sample is too complex for a simple demo. A new sample you are talking about technically contains 3 tables:

  • trainers
  • pokemons
  • trainer_pokemon

where trainer_pokemon is many-to-many between 'trainersandpokemons`. So, it's the same use case.

Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
 - JDBC module is finished
 - MongoDB needs DB model update

Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
@Tomas-Kraus
Copy link
Member Author

JDBC Sample was rewritten to match @m0mus requirements. MongoDB is still in TODO list.

Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
@Tomas-Kraus
Copy link
Member Author

@Tomas-Kraus Tomas-Kraus changed the title WIP: DB Client examples DB Client examples Jan 31, 2020
Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
@m0mus
Copy link
Contributor

m0mus commented Jan 31, 2020

@Tomas-Kraus If review comments are addressed please resolve those conversations. It's difficult to review.

Signed-off-by: Tomas Kraus <Tomas.Kraus@oracle.com>
@tomas-langer tomas-langer merged commit 015daea into helidon-io:master Jan 31, 2020
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.

None yet

3 participants