Architecture

Platform Architecture in Computer Science: With Multiple Apps Approach

There are many ways to design the platform architecture, however every platform has its own unique requirements. The architecture of every platform can vary totally to meet the needs of respective platform.

There are many case studies to look into platform architecture which I will cover in different article, we can look into linked-in, ebay, Amazon and netflix architectures to get better understanding on Platform architecture.

For now in this article we will understand first approach that Having Multiple Apps with its own independent Database and Backend. For our understanding purpose we will consider designing a platform for an Amazon Kind of Online Shopping Platform

Read Basics of Platform Architecture before further reading

Platform Architecture for Amazon Kind of Online Shopping Platform with Multiple Apps Approach

If you consider Amazon kind of Online Shopping Platform, we first have to identify which are the different huge modules which are candidates for making it as a separate app altogether

  1. Sellers or Vendors who sell the products
    1. Seller is the one who has his shop and sell products in amazon
    2. He should be able to add his products
    3. He should be able to manage discounts, offers for his products
    4. He should be able to dispatch his product
    5. He should be able to manage his revenue/profit and other finance aspects
  2. Buyers
    1. The one who buy products in Amazon
    2. He should be able to manage his Cart
    3. He should be able to manage his delivery addresses
    4. He should be able to do payment using his choice of payment mode
  3. Product Dispatch Management
    1. Tracking the product while dispatching from one place to another
    2. Every city has a collection centers and products has to be managed for timely delivery
  4. Products Delivery Management
    1. Once product is reached the destination city it has to be picked by delivery person
    2. Assign delivery person
    3. Deliver to customer and update the status
    4. receive cash in case is Cash-On-Delivery
  5. Amazon Finance Management
    1. This is kind of Super Admin Functionality
    2. Managing refunds
    3. managing failed transactions
    4. Transferring money to Seller

I listed only few functionalities however there will be many more under each of these main features.

Why Can’t be its one super big Monolithic Application ? Rather than multiple Apps ?

To answer this question we have to think of following important aspects which we covered in our first Article Which are as follows

  1. Scalability : For Amazon Kind of Applications, millions of requests will be coming every second. There are millions of users buying and millions of sellers selling and millions of products listed, millions of transactions happening. It is highly impossible to handle everything in one huge monolithic server, because every server has some upper limits with respect to hardware and capacity, one huge database to scale it to that level we have to divide it into multiple pieces and manage it independently.
  2. Maintainability: It is very hard to maintain one huge monolithic app for such a huge volume.
  3. Resilient: Any major update to particular part of the platform should not affect to other parts of the platform
  4. Development: For amazon kind of huge platforms, they have huge team spread across the world and each teach is enhancing their own module by doing lot of research within their small team. It is not possible to manage development activity effectively if its one huge monolithic app

Now let us see how the Architecture Diagram looks: You can use various apps for designing Architecture Diagram

In the above diagram, each app is one server and it has its own database. There are third party services used commonly across many apps, like

  1. Elastic Search Service : For faster product search, Elastic Database is must for better searching capability.
  2. Cloudinary is another service used for multi media file handling
  3. Authentication service is like firebase, auth0 for user authentication
  4. Many more such services will be used

Advantages of Multi Application Platform Architecture

Scalability: In this architecture the platform is scalable to handle high traffic, because during peak time like Amazon big billion day, more and more people will buy products, the traffic will be too high for Consumer App. So in that case if its independent server by itself, we can increase the capacity of that server alone to handle millions of requests, however other apps may not need so much so at this stage.

Continue Reading : Where API Gateway and GraphQL Fit in Platform Architecture

Web Services – Chapter 1

We know a typical client-server communication model , where a client request for useful data and server responds with the valid data over network. The way of communication might differ based on the type of software running at server side, which means if a server is just an ftp server then one has to get the file by running an ftp command, if the type of resource is just a static html page then a simple http get request is sufficient and the communication can be achieved with a suitable communication protocol. The concept of web service gives real boost to the mode of communication between client and server. The client server model becoming more complex than ever with awesome facilities over the internet. Web services are identified as latest technological changes that is enriching the world of business. Software modules written on any language can talk to each other to transfer a set of resources over the internet. This was not the case before web services, with the help of web services both client and server became loosely coupled. With this overview of web services, let us define the web services and understand the concept in depth.

Definition Of Web Services –

Web service is a mode of communication between two devices provided by a software system running at network address over the web, designed and developed to support interoperable machine-to-machine communication over the internet.

The term interoperable in the above definition means a lot when we discuss about web services. The simplest meaning of interoperability is working together, irrespective of the type of communicating devices , both the devices should be able to share the information by exchanging data in the form of specific data format or communication protocols to produce a meaningful result.

To make the concept more clear , let us take an example which describes where and how web services sits in the entire process of communication.

-Assume that you have a set of huge data stored in your server, the data which is collected from your extensive research on physics. If you would like to share your data to the external world in a very meaningful structured way then you can’t just post every data on your website. Because sharing data in a web site is not a structured way , structured way means according to me , share every bit of data but one should use it as per their need.

If one wants data related to astrophysics could be able to fetch only related data, if one wants data related to modern physics could be able to fetch only related data. To achieve this the only best approach is web services.

Develop a software module that query the related set of data from your server and responds to the client by sending only that piece of information. The client here may be of any kind, It might be a mobile application, tablet application, desktop application or web application. Irrespective of the type of client, your software module responds the right information as per the incoming request. Let us understand this with the help of architectural diagram.

Web Services – Architectural Diagram

Architecture Web Services

 

Above diagram is self explanatory which describe about 5 modules , the important point that is clear from the architecture is, a web service software module deployed in the server is capable to process request from any type of client and serve the requested information, this is what we call as interoperability. Web services hence take the web technology to the next level.

How is that Practical –

So far what we discussed is just a theoretical approach of understanding web services. Being a software developer you will be interested to learn how to develop/consume web services. Web services can be developed using any server side

language , Java, C# .net, PHP , Ruby On Rails etc.There are mainly two types of web services SOAP Services and RESTFul services.

1. SOAP Services – Web services can be developed by adopting SOAP protocol , where client-server communication happens by describing the details with WSDL ( Web Service Definition Language ). An XML language will be used to define the message format , which will be sent across the network.

2. RESTFul Services – Representational State Transfer is an information transfer , the services responds to the request with a help of unique service URL and set of data as input for the service. XML is not mandatory , the data can be passed either in plain text or JSON format.

We will learn development of RESTFul web services using Java in our next chapter.