Garry
Garry

Reputation: 534

What is the best way to share runtime data between docker containers with nodejs ? (Not volume)

I need to share runtime data between containers. example:

I am using two containers one application and one notification. I need to pass data from application container to notification container.

Approaches I know so far:

  1. TCP connection
  2. Sockets

Upvotes: 0

Views: 191

Answers (1)

vodolaz095
vodolaz095

Reputation: 6986

Use 3rd container with redis database in it.

  1. There are few good nodejs drivers for redis.
  2. Redis can be shared cache/key-value database/counters/queues - depends on data structure you use and for what.
  3. You can use publish/subscribe commands to send notifications from app to notification handler container

Upvotes: 1

Related Questions