Remember Uncle Martin, in the enterprise Application architecture model, specifically emphasizes: "Can not distributed application is not distributed", this sentence is not a problem, especially for those who have done distributed applications, will have a profound experience, but the world is not so simple, most people will encounter distribution -style application of the scene, especially for large applications, from the centralized into the distribution is inevitable, but perhaps a small distributed, perhaps a large distributed; Perhaps there is high performance requirements, perhaps not, in this blog we look at Java applications from the centralized into distributed after the end will bring What challenges.
Blogs are described in terms of applications that evolve from a centralized to a large and high-performance application, because these types of applications are also from low to high for design and developer requirements.
Level 1: Small distributed applications
For students who are accustomed to centralized applications when it comes to small distributed scenarios, the most obvious problem is how to communicate with a remote system, how to send a message to a remote system, tell it what to do, and get things done, and for Java developers, a more habitual way of thinking is Xu is how to invoke the interface provided by the remote system, in a centralized application can be used in a a=new aimpl (), such a way to call, but remote can not be called so.
In a small distributed application, the most need to solve is the above mentioned remote system communication and remote system call problems, so you have to learn the relevant knowledge system.
For remote system communications, you should at least be aware of what the concept of TCP/IP, UDP/IP is, what Bio/nio is, and what you need to know about how to implement Tcp/ip+bio (NIO), Udp/ip+bio (NIO) communications based on Java, The corresponding will need to understand the Java serialization, server-side using thread pool processing knowledge, after mastering this knowledge, basically do a small Java remote communication application will not have much problem.
For small, distributed applications that can be implemented through remote system calls, it may be simpler to grasp only how to use a framework such as spring-remoting, axis, or hessian, which can be implemented directly, and of course, if you understand the following RMI, It's better to webservice what the mechanism is, in addition, it is difficult to make a remote call like a full and local call, although all the remote call frameworks want to be completely transparent, but the remote invocation is only an exception more than a local call, such as network exception, timeout exception, and so on when calling the remote system , you need to be clear about the distinction between these exceptions, or, of course, the same remote business exception, but you need to make a clear distinction when tracing errors.
As can be seen from these points of view, the application even from a centralized application into a small distributed application, whether for development, deployment or testing, are much more complex.
Level 2: High Performance distributed applications
For high-performance distributed applications, the requirements are much higher, because to achieve high performance, only understand how to use is not enough, communication and call technology need to understand the underlying specific mechanisms and implementation.
For distributed applications of remote communication methods, it is necessary to understand what the specific Bio/nio are, what the specific mechanism is, and to use or refer to the current mainstream communication framework, such as Mina, Grizzly, and so on, to see what skills they have in doing the NIO implementation, in addition to knowing these things, You also need to master how the thread pool should be configured, how long connect, what concept to short connect, how to implement it, how to manage the connection, how to optimize serialization, and so on.
For the remote call of the distributed application, on the basis of the above, but also need to understand the RMI, WebService and other implementation mechanism is what, in addition to spring-remoting, hessian, axis of the implementation mechanism is what, what can improve the place, It is necessary to choose the appropriate solution after clarifying the areas that can be improved.
From these points of view, it is difficult to write high-performance distributed applications that are really not covered.