Just some general notes I’ve stored for personal use.
Binary vs Plain Text
Binary data is more efficient than text, but more difficult to debug and generate (how many hex editors do you know to use?). Lower-level protocols, the backbone of the internet, use binary data to maintain performance. Application-level protocols (HTTP and above) use text data for ease of interoperability. You don’t have religious wars about endian issues with HTTP.
Stateful vs. Stateless
Some protocols are stateful, which means the server remembers the chat with the client. With SMTP, for example, the client opens a connection and issues commands one at a time (such as adding recipients to an email), and closes the connection. Stateful communication is useful in transactions that have many steps or conditions.
Stateless communication is simpler: you send the entire transaction as one request. Each “instant message” stands on its own and doesn’t need the others. HTTP is stateless: you can request a webpage without introducing yourself to the server.
Many protocols rely on HTTP because it’s so widely used (rather than starting from scratch, like Memcached, which needs efficiency). HTTP has well-understood methods to define resources (URLs) and commands (GET and POST), so why not use them?
Web services do just that. The SOAP protocol crams XML inside of HTTP commands. The REST protocol embraces HTTP and uses the existing verbs as much as possible.
In any creative activity we need three basic ingredients: tools, materials and techniques. For example when I paint the tools are my brushes, pencils and palettes. The techniques are things like ‘washes’, wet on wet, blending, spraying etc. Finally the materials are the paints, paper and water. Similarly when I program, my tools are the programming languages, operating systems and hardware. The techniques are the programming constructs that we discussed in the previous section and the material is the data that I manipulate. In this chapter we look at the materials of programming.
Just a personal compilation from various sources
State (computer science)
set of instantaneous values of all variables to which a system or computer program has access
In information technology and computer science, a system is called stateful if the way in which it may interact internally or with its environment depends on the condition it is in at a given instant in time; such a condition is called a state of the system.
The set of states a system can be in is known as its state space. In a discrete system, the state space is countable and often finite, and the system’s internal behaviour and/or interaction with its environment consist of separately occurring individual actions or events, such as accepting input or producing output, that may or may not cause the system to change its state. Examples of such systems are digital logic circuits and components, automata in automata theory and formal language theory, computer programs, and computers. The output of a digital circuit or computer program at any time is completely determined by its current inputs and its state.[1]
 State (computer science)
set of instantaneous values of all variables to which a system or computer program has access
In information technology and computer science, a system is called stateful if the way in which it may interact internally or with its environment depends on the condition it is in at a given instant in time; such a condition is called a state of the system.
The set of states a system can be in is known as its state space. In a discrete system, the state space is countable and often finite, and the system’s internal behaviour and/or interaction with its environment consist of separately occurring individual actions or events, such as accepting input or producing output, that may or may not cause the system to change its state. Examples of such systems are digital logic circuits and components, automata in automata theory and formal language theory, computer programs, and computers. The output of a digital circuit or computer program at any time is completely determined by its current inputs and its state.[1]