Skip to content
Snippets Groups Projects
Commit ae9215b8 authored by Oshani Weerakoon's avatar Oshani Weerakoon
Browse files

Example + Instructions

parent 1816aa7d
No related branches found
No related tags found
No related merge requests found
## Background
The choice of protocols and message formats can have a significant impact on energy consumption during data transfer. Some protocols are more efficient than others because they use less data for overhead (such as headers) and can achieve the desired level of communication with fewer bytes transferred.
For example, HTTP/1.1 opens a new connection for each request/response pair, which can be inefficient. HTTP/2, on the other hand, allows for multiple requests and responses to be multiplexed over a single connection, reducing the overhead and latency associated with establishing connections.
Similarly, message formats like XML can be verbose compared to more compact formats like JSON or binary protocols like Protocol Buffers (protobuf), which can further reduce the amount of data transmitted.
### Choosing HTTP/2 and JSON for a Node.js Server
For this example, let's create a simple Node.js server that uses HTTP/2 and JSON for efficient data transfer.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment