mysql - Running Spring boot application in a container? or a VM? or a container inside a VM? -


i have 96g ram server, run few spring boot applications on it. need mysql db.

i have hard time decide best way utilize server obtain best isolation, , performance.

i thinking of following:

  1. create vm mysql server
  2. a vm each spring boot application

now should run mysql/spring boot directly within vm, or run them in docker? can see no immediate benefit doing this. if later on if need create cluster apps, have docker images better?

or, if me, do?

thanks

you want best isolation , performance?

trust isolation provided docker container. it's primary design objective.
don't add unnecessary layers (i.e. vm inside host docker container) — adding vm layer incur performance impact, , sounds don't have to.

containerising mysql requires thought, since it's inherently stateful.
if wanted this: i'd @ least store state (data , maybe config) outside of container.

you away not containerising mysql. don't feel databases fit containerisation use-case, because:

  • they're stateful
  • scaling not trivial "spin instance" (because have establish slaving, , synchronise , store lot of state)
  • they don't undergo updates often
  • updates not trivial "swap newer version of container"
  • there's less requirement "use same version in environments" (i.e. devs using mariadb 5.7 locally, despite production's using mysql 5.6… moreorless fine)

you should consider using managed database such amazon rds. recognise you've high-performance computer want make use of, it's worth weighing against operational costs of maintaining , scaling infrastructure yourself.

and yes: i'd make container per spring boot application, , run containers directly. said: trust docker's isolation — or @ least whether it's been breached, , whether that's acceptable risk according threat model (and whether vm would've saved in reported cases of vulnerability).

as where deploy docker containers (i.e. locally on fast computer, versus deploying cloud): depends whether want optimize operational costs (i.e. it's easier manage on cloud , not have interact physical machinery) or try make of fast computer (and deploy directly computer).

presumably there's way remotely manage orchestration of docker containers on fast computer. give lot of benefits of deploying cloud.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -