Closed agoncal closed 2 years ago
We certainly could. It would have an effect on running the system via docker compose though. Right now only 1 DB instance is started and 3 schemas are created. That would have to change.
Or maybe have a simpler setup when using docker compose (only one instance of Postgres, as it is now) and a more complex one when doing K8s ?
But then the apps would have to have each of the extensions. Isn't that a Quarkus anti-pattern?
By anti-pattern I mean it would be ok to have more than one datasource extension present if the app communicated with more than 1 datasource, but to switch datasource types between environments? Some of the datasource config is fixed at build time.
BTW I'm not against the idea, just playing devil's advocate and thinking out loud about the repercussions.
You're right. We could use Quarkus profiles but that could be cumbersome. I'll give it a try and submit a PR is I come up with something that ends up easy to run on docker compose and no too difficult on K8s
Let me know if you have any questions about the setup and how the k8s/docker compose files are generated. I tried to be detailed in the documentation, but if something doesn't make sense or the documentation needs to be updated I'm happy to modify the docs (or take PRs :) ).
Looking at eShopOnContainers project from Microsoft might give some ideas, they have implemented a full set of microservices with different databases as well (I believe their older versions of the repo used an even wider range of different db)
I was thinking about Mongo and/or Cassandra? Although Cassandra doesn't yet have a Dev Service (see datastax/cassandra-quarkus#199) so I'd be hesitant to use it.
So MongoDB it is then. I will see if I can find the time to create a PR this week.
Awesome! Thanks for taking an interest @Jenriksen!
@agoncal / @cescoffier thoughts?
Maybe the fight service makes the most sense/is the least invasive?
I like the idea of having several types of databases, APIs and so on. As @edeandrea mentioned, MongoDB has DevServices (which makes lives easier in dev). So, if Cassandra does not have DevServices (yet?), Mongo is a good choice
I would go for a noSQL DB. Mongo is fine, Redis might be interesting too.
Mongo is closer to what we did in the other microservices (we have a Panache layer). So, I would go mongo.
All three Villain, Hero and Fight microservices use a Postgres database. What about having a different database type for each microservice?
We could use Postgres, MySQL and MariaDB, for example.