What is more efficient for multi container communication?

I have two containers in my application running on a Raspberry pi. One container is a python container that takes sporadic input from I/0 devices. The other container is running Electron JS. My question is what is the best way to push the data received by the python container from the I/O devices to the Electron JS app? I’m in between writing to a shared volume and using a websocket to communicate between the two containers, but don’t know which way is better, and why.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there!

I would take my response with a grain of salt as I am unfamiliar with a lot of the components of your application as well as raspberry pi hardware. This also may depend on your version of raspberry Pi as it looks like they have different networking adapter capabilities.

That being said, I would fathom that a shared volume locally would be faster than a network based interface between the two applications. Pi networking is USB based and it looks like that also may be hampered by the USB ports speeds. FOr these kinds of reasons I would guess that local shared volume would be faster.


John Kwiatkoski Senior Developer Support Engineer - Kubernetes