One of the architect's Guide [Advanced] JAVA: How architecture design

Foreword

  This blog is a lengthy series blog to help want to improve themselves, overcome technical bottlenecks, but do not know how to suffer to learn the system so as to enhance their children's shoes author assumes that the reader has a 3 - 5 years experience in the development, java solid foundation, I want to break their technical bottleneck to become an excellent architect, called java solid foundation, such as:
  . 1.java language three characteristics
  2.java language and represents a range of eight basic types.
  3. Why float and the presence of double precision is lost?
  range 4.publish / private / default / protected represented?
  5.static / Final usage and meaning.
  a solid foundation of Java shoes, these problems should be able to answer it, and be able to know these know why, from the bottom principle understand why this is, after have these basic, advanced to break their own, to be a better engineer.

  Of course, this series is the original author, many views are the author's own point of view, if there is incorrect or I want to discuss, extremely welcome, after all, everyone makes mistakes, we progress together not Miaozai!

How to become an architect?

  I believe that to become an architect, first must be your first point of technology good enough, enough depth and breadth of knowledge, experience problems can quickly find the most appropriate way to solve the mind. Secondly, architecture Teachers will lead the project as a whole, dealing with people is essential, therefore communicate with people these soft skills are also essential, of course, this varies, some people are born more will be dealing with people, but in any case, sufficient technical excellent is the basic condition, of course, want to be a good architect, practical development experience is essential, not the architect of many years of experience does not work, but at least, we want to be an architect, you must first master the theoretical knowledge ?? is not it or talk about what practice it so I summed up a JAVA Advanced learning architect map:
file
  of course there are many techniques and skills are also required, such as: architect to document output, you will need to draw related figures common example: a flow chart / use case diagram / timing diagram / lane diagram / state diagram / collaboration diagrams, etc. (recall that these courses in college is not a teacher but we did not mind all talked about nothing, at least the author? In this way, ha ha ~). Another example java reflection mechanism and its associated API, high performance NIO --- Netty framework and so on. If we need big data relevant to know flink / blink / spark / hadoop / hbase, not necessarily all to be, but at least my mind there must be a concept, this technology is doing, so that when people say can understand. As for why did not draw in the above figure, because I only prepared to write follow-up articles the contents of the figure, and the rest left to their own children's shoes to learn it. of course, because the blog to limited space, each technology can not be a hundred percent all the knowledge points are mentioned, but to ensure that all are talking about dry goods, energy let's read the children's shoes to gain something!

What architects should be concerned about?

  The problem, in other words, making what we should be concerned when design architecture, we believe that the two types, functional requirements and non-functional requirements from large terms, the breakdown for the following six areas:

1. Function

  I remember my teacher once said, the function is 0 and the other is 1, then fast hardware architect, if not function, then fast hardware design is useless, and only under the premise to meet the functional and other design to be useful.

2. Performance

  For modern systems, the shorter the response time is more likely to retain customers, after all, who would stand to open a page to wait 10 seconds or even minutes of it? At least when I visit any Web site, more than five seconds to load a page directly off. commonly used performance indicators QPS (queries per second rate) / TPS (transactions per second rate). of course, the need to advance environmental performance (environmental and production-like environment) test after the completion of system development, common performance testing tools apachebench (referred to as ab) / http_load / jmeter etc. .QPS also follow the principle of 28, the day 80% of the traffic is concentrated in 20% of the time, we could then estimate the QPS website, planning the server configuration, If the performance is not up to, the need to optimize, optimization methods commonly plus machine (brute), the front end of the optimization (the CDN / static and dynamic separation / decrease number of requests /), optimization backend code cache (e.g. redis), JVM optimized.

3. Availability

  Usability is a modern distributed system, when there is one or more of its subsystems node goes down when still be able to continue to provide normal services. Commonly used means of a cluster and automatic failover, almost all distributed systems technology use support high availability, such as caching official redis redis-cluster cluster, MongoDB cluster fragmentation, messaging middleware (ActiveMQ / RabbitMQ / kafka / RocketMQ) cluster, MySQL cluster database and so on, if all of the above are aware of children's shoes, to sum up, they will find that the core idea is the same, to provide data redundancy through clustering, and through automatic discovery and failover mechanism to ensure high availability components.

4. stretchability

  Scalability refers to when the system capacity is insufficient or excess, whether it can facilitate the conduct of expansion / contraction processing capacity, many large companies are doing well in this regard, better strategy is containerized, use docker + k8s deployment management , can easily be expansion or contraction processing capacity, better rational use of resources.

5. Scalability

  Scalability refers to the time when there are changes or new requirements occur, whether the function can be achieved without changing code or change very little code. Scalability is a test of skill of an architect, the author seems like design a good scalability of the system, in addition to prior consideration, the use of design patterns is quite a good program where appropriate scenarios, so the architects, the design model is very important! for example, there is an upload service, using the FTP protocol upload, we apach ftpClient package based on a set of interfaces, in addition there is a demand at this time, is required to use the SFTP protocol, we use another set of interfaces jsch package, that if there are follow-up to the new agreement? each additional we need to add a protocol to adapt the code, this time using the adapter model is not can be a good solution to the problem? this is also consistent with the idea of ​​design patterns, programming to an interface, a new agreement in the future, we just need a new by an implementation class, without alteration of the original code it is not in the code changes at a minimum meet the demand?

6. Security

  A site, if it is under a great amount of user access, the network is vulnerable to hackers, common means of attack include:

6.1 XSS attack

  Sterilization is a common means of defense (not trust a user input, and the input checksum strict filtering, such as using "& lt" instead of "<", etc.).

6.2 SQL injection attacks

  Before we use JDBC when using the Statement cause SQL injection attacks, so there is a precompiled PreparedStatement way back to prevent SQL injection attacks, and higher efficiency PreparedStatement case of a large number of queries.

6.3 CSRF attacks

  Cross-site request forgery, the attacker theft victim cookie, sending malicious requests on behalf of the victims, a common defense mechanisms are: submit form validation code (user experience relatively unfriendly), URL with token validation, HTTP referer verification.

6.4 DDOS attack

  Distributed denial of service attacks, DOS attacks advanced version, the defense is very difficult, and the program is relatively complex, the industry is more powerful Ali, 11 double many times have withstood a big promotion, after all, Ali Wealth brother (Wu Han Qing, Ali, the youngest P8, as the existence of God) security group and its leadership.

  Of course, there are other attacks, here I will not list them here, are interested in children's shoes can inform themselves about the next article, we started advanced content --- JVM articles, so stay tuned!

  If you feel that the bloggers write well, welcome attention to the micro-channel public number bloggers, bloggers occasionally sharing technology dry!
file

This article from the blog article multiple platforms OpenWrite release!

Guess you like

Origin www.cnblogs.com/wukongbubai/p/12529176.html
Recommended