mercredi 1 avril 2015

TCP to Server Database communication

I'm trying the understand the correct way to communicate between a client sending data to a node.js server via TCP connection.


The client is a small electronic device able to create a TCP socket to communicate with the internet.


The remote server is running node.js supported by a mongodb database.


What is the better way to communicate?


I don't have much experience but some ideias come to mind:



  • I could send http POST to the server, filter the message and redirect the content to the database.

  • Run a dedicated TCP server in the http server on a different port and connect directly to this server.


Another question is where to put security? should the client send encrypted messages to be decoded at the server?


Thank you very much


Aucun commentaire:

Enregistrer un commentaire