Over the course of the semester, we’ve discussed servers, databases, and monolithic and microservice architectures. We’ve discussed and are currently working on rest APIs which allow us to send and receive information to and from the Internet. While working with rest APIs and doing research on my own, there are elements that exist in what we’re doing that we have yet to discuss. These different elements are paraphrased from parts of the articles linked below.
“REST” stands for “Representational State Transfer”. It is a style of architecture that allows proper interaction with web services that are “RESTful”. In a microservice architecture design, there exist different elements in the software, e.g. one service could manage a consumer’s payment, whereas another service can handle a company’s product/service. In this separation of different systems, there exists a need to communicate these different services together.
REST APIs function as the glue between different services. However, this requires further inquisition: why would we use different services? Wouldn’t the separate systems just use more memory by saving redundant information? This question brings us back to the “S” in “REST”, namely “state”. When sending information from or to another service, an object’s data is not saved in the service as the request, more specifically, the information in each request is “separate and unconnected”1 This concept is called “statelessness”.2
Another aspect about microservices is serialization. Serialization is the act of transferring an object with variables and their respective mutators and accessors into a stream of bytes. This stream can be of binary data or a string. Information about an object that is passed through various services requires serialization, which can then be compared with other streams for object comparison, and eventually deserialization.3
We’ve previously discussed docker, characterizing it once as “lightweight”. These aforementioned aspects are the ingredients that can allow containerization and their containerizers such as Docker to be so lightweight.
I decided to talk about this subject because state / statelessness, serialization, and architecture design will be an important part of a future job. A lot of my research so far is applicable to what we’ve been doing, and I think the concepts and their implementations are, to me, novel, interesting, and important. This information is to my current understanding, and it has the risk of being incorrect, due to me still learning about them. However, I still decided to talk about these topics because understanding the anatomy of how everything comes together and operates is interesting, especially with what we’ve done in class.
Links:
- https://www.redhat.com/en/topics/api/what-is-a-rest-api
- https://www.redhat.com/en/topics/cloud-native-apps/stateful-vs-stateless
- https://dev.to/njnareshjoshi/what-is-serialization-everything-you-need-to-know-about-java-serialization-explained-with-example-9mj
From the blog CS@Worcester – Chris's CS Blog by Chris and used with permission of the author. All other rights reserved by the author.