2

I am new to Docker. I want some opinion from some expert about container design. I have set up a database in the MongoDB cloud (Atlas). I have Windows app in Docker container which include Windows OS and application based components. I want to use RavenDB and this database is very new to me. A component of my Windows container will communicate to both MongoDB and RavenDB. My question is should I create different docker container for RavenDB or will I install RavenDB in my existing windows container. it is design decision problem. I am new to RavenDB and Docker so the pros and cons are not clear to me yet. Kindly help me.

Kalyan
  • 1,626
  • 6
  • 30
  • 51

1 Answers1

6

I had a similar application, where I had a postgresql db and Nodejs webapp. The web application and the database were running on separate docker containers.

  • This way the two containers were independent of each other.
  • This replicates the actual production scenario, where you'll have your service and database running separately.
  • It is recommended to run single process on each container.
  • Better modularity of the services. Separation of Concerns.
  • Scaling containers horizontally is much easier if the container is isolated to a single function.

This way the two containers were independent of each other. The postgresql db container had a volume mounted to persist the data.

A more detailed explanation can be found here

mohan08p
  • 3,723
  • 1
  • 22
  • 35
  • thanks for your reply @Gokul Chandrasekaran. i have another question to ask. if a container size overflown, will my db' s data wiped out? how could i manage this special case . – Kalyan Mar 12 '18 at 07:17
  • This post should help understand better how volumes are mounted to enable persistent storage for containers. https://stackoverflow.com/questions/18496940/how-to-deal-with-persistent-storage-e-g-databases-in-docker – Gokul Chandrasekaran Mar 12 '18 at 07:24