Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best approach for small scale distributed C++ apps

I am working on distributing a stand-alone app. Each instance of the app has to be able to send and receive queries.

Requirements:

  1. Language - C++
  2. Scale - small. May be 5 instances at a time
  3. Platform Independent
  4. Volume of data transferred is expected to be high(Raw images in the worst case)

I don't want to use RPC because it needs a registry service running. I think CORBA and SOAP would be too much of an overhead. I kind of decided to use a custom protocol, but just want to hear if there's anything better.

Thanks.

like image 662
Sundar Avatar asked Jul 27 '09 18:07

Sundar


3 Answers

Protocol Buffers sound like a good fit, supported in C++, cross-platform, designed for high-performance.

like image 99
Mike McQuaid Avatar answered Sep 18 '22 18:09

Mike McQuaid


MPI was made for this and is certainly easier to use than Corba etc.
And it scales when you discover that your small scale distributed app becomes a very large scale distributed app!

like image 37
Martin Beckett Avatar answered Sep 22 '22 18:09

Martin Beckett


Why not use http POST?

  • Lightweight as you need (open a socket, send POST string), or if you want robustness use an http library.
  • Easy to manage permissions on the serverside (just use apache or iis)
  • Built in logging (on the webserver side)
  • No scaling problems (webservers have solved these problems)
  • Typically systems don't require permissions for http sockets (xp does for raw sockets).
  • Key/value pairs for identifying fields and data.
  • You can test it using firefox plugins.
  • If speed is a concern you can easily set timeouts and resend.
  • You don't have to worry about firewalls since http is almost always allowed by default.
  • Simple to debug with a port sniffer.
  • All of the server side code and most of client side code has been written for you.
like image 43
Ethan Heilman Avatar answered Sep 21 '22 18:09

Ethan Heilman