Routing, Serialisation & Deserialisation
Hello, I’m Nripesh
I am an aspiring programmer, continuously learning and building projects one step at a time.
This blog will serve as a record of my journey, where I document the coding challenges I encounter each week and the solutions I work towards. My intention is not only to track my own growth but also to provide clarity for others who may face similar difficulties.
What you can expect here:
Weekly summaries of the issues I struggled with
Solutions, explanations, and key insights I gained from them
References and links to helpful resources, documentation, or my GitHub repositories
Occasional notes on personal projects I am developing
I am still in the early stages of my learning path and have much to improve, but I approach each challenge with confidence and persistence. This space is both a personal archive and an attempt to contribute—however modestly—to the wider learning community.
If you are also navigating the world of programming, I welcome you to connect and share perspectives.
Routing:
If HTTP methods tells the "What" to do with a request to the server, Routing helps tell there "Where".
As can be seen in the above image, the API request tells which method to perform (GET) and then the Route to where GET request it to be performed.
The route need not change, as two(or more) different HTTP methods can be called on the same api route
Static Routes:
In the above example /api/books, is a static route, ie, each time that the api request is made the location of the request would remain the same (hence static)
Dynamic Routes:
In the following example, /api/users/123, the "123" portion is trying to immitate the path parameters, that can be queried by : /api/users/:id
We can use such type of dynamic routing to fetch a specific user id or any other details from the routing and use it to generate a user specific page or some other Logic,
We can use this in a nested format by including multiple dynamic parts in a route
eg: /api/users/:id/articles/:articleId
Query Parameters:
When we want to query something from the server ( like pagination, or searching ) we use query parameters to do so,
Lets say we need to search for something in a website and the server has to return the queried string given by the user, it attaches to the route like : /api/search/?query=some+value
Route Versioning
As the following images show, one can have route versioning which helps in cases when an application requirements changes and needs to serve a different data in response we can use route versioning without it affecting the route structure :
/api/v1/products ---> /api/v2/products
helps in naming and readability of apis, and is self documenting in nature.
Catch All route:
Helps in catching requests made to non-existent api routes, and rather than sending an error message we can nicely handle it by returning a message without breaking the application.
Serialisation & Deserialisation
Why Do We Need Them?
Clients and servers operate on different internal data representations.
Applications use in-memory objects (structs, classes, maps, etc.)
Networks transmit bytes
Serialization and deserialization act as the translation layer between these two worlds.
Serialisation
Serialisation is the process of converting an in-memory data structure into a transferable format.
Example:
{
"id": 123,
"name": "Alice"
}
Server workflow:
Database Object → Serialised Format → HTTP Response Body
Deserialisation
Deserialisation is the reverse process: converting received data into usable application objects.
Client request workflow:
HTTP Request Body → Parsed Format → Application Object
For example, when a user submits a form, the server deserialises JSON into a struct or class before processing it.
Serialisation Formats
Serialisation formats fall into two broad categories:
1. Text-Based Formats
Human-readable and widely interoperable.
Common examples:
JSON (JavaScript Object Notation) → most widely used in modern APIs
XML (eXtensible Markup Language) → legacy and enterprise systems
YAML → configuration-heavy systems (DevOps, infrastructure)
JSON dominates web APIs because it is:
Lightweight
Language-agnostic
Easy to parse
Natively supported by browsers
2. Binary Formats
Optimised for performance and compact size.
Examples:
Protocol Buffers (Protobuf)
MessagePack
Avro
Binary formats are common in:
Microservices communication
High-performance distributed systems
Internal service-to-service APIs
They trade human readability for efficiency.
How This Connects Back to Routing
Routing determines where a request goes.
Serialisation determines how the data travels.
Together, they form the core mechanics of modern API communication:
Client → Route → Server Logic → Serialisation → Response
Conclusion:
Understanding routing tells us where requests go, while serialisation and deserialisation explain how data moves between systems — together forming the fundamental mechanics behind every modern API interaction.