Over a million developers have joined DZone.

Make Distributed Systems Auto-Scalable : Examples

· Cloud Zone

Download the Essential Cloud Buyer’s Guide to learn important factors to consider before selecting a provider as well as buying criteria to help you make the best decision for your infrastructure needs, brought to you in partnership with Internap.

In the last post(http://java.dzone.com/articles/how-make-distributed-system), we talked about the conception how to make distributed system auto-scalable.

It will be a design pattern for distributed system in auto-scalability. The following is 2 examples to explain it.

1st, Game Platform of Internet

Game Platform provider many types of game for users by a game portal.

Users can login and play many games in the game platform by Game Client.

Users select one type of game from the portal and enter the game hall, and after selecting a game room in the game hall Users can choose a desk and sit down and begin game (with other users).

Logic View

In this scenarios, we hope the game portal node and game hall node and game room node can be auto-scalable for failure-tolerant and

adding new node when users access is rising and reducing node when users access is lower .So those node should be added or removed transparently.

Deployment View

At client side, Users download Game Client software (a GUI application) and install it, and then use Game client software to access the Game Platform and play game.

At Server side, there are Login Server and Game Hall Server and Room Server to serve the Game Client.

The Login Server plays an entry point role in this scenarios. It provides login function and sends a suitable Game Portal Node information (according theirs health) to the game Client.

Game Portal plays  a Gateway node role(router) for Game Hall nodes in the system , and Game Hall plays a Gateway node role for Game Room nodes.

According to theabove we can know ,Game portal nodes and Game Hall Node and Game room nodes can be remove or add  transparently in the system ,

and our system is auto-scalable. But the login server is not auto-scalable ,We will talk it in the next post.

2sd, Search as a Service

Logic view

There are many search engine nodes(almost 100 instances ) and many client applications(hundred of apps ,thousands of app instances) which will access the search engines .

Also ,there are many services deployed in the service platform. So the client applications can access the service platform without any thing about search engine.

As we can see from the following picture, there will be 5 logic roles in the system, client apps\service master nodes\service nodes\search engine\Register Server nodes.

Client apps send search requests to the Service master node. Service master node routes the request to a Service node(which it's on a health status) to execute the request and send back the service result.

At last, the service node request a suitable search engine(search engine node information is stored in DB by other application) to execute the search request.

Deployment View

As described in the above picture, if Service Node is added or removed from the system, the master nodes can monitor the change of service nodes .

If a service node is added, the master nodes know there is a new service node, and put the new service node to service node route list, then if there are new service request, the master node can route the request to the fresh service node.

If the service node is removed, the master nodes also can know there is a service node is down , and the master nodes remove the unavailable  service node from the route list  .

So the system is gracefully handled the change of service node, and the service node is added or removed transparently .

Conclusion:

From the examples , we  know Distributed system can use the pattern(register and monitor) to improve the system Quality on system modifiability. We will talk about node elastic in next post.

The Cloud Zone is brought to you in partnership with Internap. Read Bare-Metal Cloud 101 to learn about bare-metal cloud and how it has emerged as a way to complement virtualized services.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}