Better marketplace technical Architecture.
Here is a pagination module.
It appears in several platforms like marketplaces, content websites or the best example which is here
In this post, I go through the technical implementation of this kind of pagination module and highlight the fact that today's developers must also care about money accounting because cloud environments allow us to know exactly how much our code will cost in production. I started a book about this new OPEX driven development framework but never finished it. Hope a day I will.
This pagination is commonly implemented like this
When you click on a page number or scroll down — the webserver is called with a request which holds the parameters of the start and end of data needed. This Webserver based on these parameters will call the database server (MySQL or MongoDB …) which will in turn provide to it this portion of recorded data. And finally, the webserver takes the data it gets from the database server and provides them to the client into which we can have a javascript code that will render them.
In this configuration when your solution is hosted in a cloud infrastructure you will pay for
The client request to the webserver
The webserver request to the database server
The database server response to the webserver
The web server responds to the client
In addition to each of these atomic processes, we pay also the volume of data exchanged. Here is the topo
If each of these atomic processes costs an amount X of money, it is easy to see that if we delete one or more of these processes we will end up paying less. This shows that coding for cloud is cost-sensitive and the developer has all the tools to adapt his code or system architecture for cost minimization.
Here is the simplest optimization question for you.
What will happen if you remove the database server?