history of website development

2022.03.16


Website development process

(history of website development)Learn by thinking mapjavaReally a nice way!today,We comb your next website with a map.0arrive1The technology and knowledge system involved in the process of gradually increased。

Tell me that a website is getting more and more users.,Concurrently increasingly high,How is its architecture evolved??Next,We will use the nine phases to analyze the technical points involved in the development of each stage of development.。

javagetting Started

history of website development(history of website development)

first,No matter what,To engage a website,You must haveJavaBasic knowledge。existjavaInside,Array in the data structure、Linked list、queue、Stack characteristics and use scenarios need to be familiar。Thread、Reflection is also a relatively foundation,Interview。

Inside the design pattern,I don't want to learn very well.,Many easy forget,Many times our business mainly learn to encapsulate,Then the code management is not simple.,Common mode:Single case、factory、acting、Observers、template、The strategy can be familiar with first。webKnowledge,http/tcpFour layers need to understand,forservlet、filter、listenerAllwebBase,sessionandcookieRelationship must understand。

Frame foundation

spring、mybatisYesjavaProgrammer must have a framework foundation。springofioc、aopIs the core concept,Have tobeancontainer,useaopCustomized annotations are familiar with。springmvcIs the most widely usedmvcframe。correspondmvcThe relationships and processes between major components must be familiar with,There is also a profile source, etc.。

history of website development

SpringMVCprocess

  • 1、User Send Request to Front End ControllerDispatcherServlet。
  • 2、DispatcherServletReceive request callHandlerMappingProcessor mappier。
  • 3、Processor mappier finds a specific processor(According toxmlConfigure、Notes),Generate processor objects and processor interceptors(If there is a generation)One and return toDispatcherServlet。
  • 4、DispatcherServlettransferHandlerAdapterProcessor adapter。
  • 5、HandlerAdapterAfter adaptation adjustment specific processor(Controller,Also called a backend controller)。
  • 6、ControllerExecute the completion returnModelAndView。
  • 7、HandlerAdapterWillcontrollerResults of theModelAndViewReturnedDispatcherServlet。
  • 8、DispatcherServletWillModelAndViewGiveViewResloverView parser。
  • 9、ViewResloverBack to the specificView。
  • 10、DispatcherServletaccording toViewRender view(The model data is filld into the view)。
  • 11、DispatcherServletRespond to users。

mybatisIs the mainstream data layer framework,Of course nowspring data jpaThere is also a rise in the trend,mybatisSource code is relatively simple,You can read it over again。

(history of website development)springbootIt's now hot framework,springGive us a complete set of industrial solutions,Many of them are based onspringboot,for examplespringcloudWait。Integrated is particularly convenient。forspringboot,We have to understand and familiarize how to assemble third-party modules,How to customize a modulestarter,How to do self-start loading, etc.。

Stage one:Monomer project

history of website development

The first stage,Building a monomer project。This stage should be consideredjavaBase,Many of them are a frame combination of business.,for examplespring+mybatis,Interface documentationswagger2,Entity verificationhibernate validator,search engineluceneetc。Then deploy the environmentcentos7、Code managementgit、Continuous deploymentgit。

emmmUnfamiliar classmates should learn more.,Basic thing

Two two:Physical separation application and database

Physically separate application server with database,socpu、The pressure, etc. is not so big.。

history of website development

Stage three:Cache、Static

(history of website development)history of website development(history of website development)

Here are some universal template static based on,for examplefreemakerorvelocityEquisical template engine,Nowadays, many code generated frameworks is actually the use of template static technology.,Resend the template to render the template,Generate the code you want。

herenginxSuitable as our static file server,The back of the movement is used.nginx。

Stage four:Application load balancing,Cluster

history of website development

nginxCan be used as a reverse proxy server,So you can use our load balancing tools,Here, it also involves the load balancing strategy,Such as polling,Weight, etc.,Need to understand。Generally,nginxBe mainstream,otherapacheIt's more。nginxThere are some online skills,Such as blue-green deployment、Grayscale deployment, etc.。

A deployment method that guarantees the system without intermittent service

Refers to between black and white,One way to smooth transition

Load balancing(Load Balance) It means that it is shared on multiple operating units,E.gWeb server 、 FTPserver 、 enterprise Key application server and other key task servers, etc.,Thus joint work tasks。

The first question that needs to be solved after application server load balancing is the session synchronization(session),Common framework isspring session、shiro-redisWait。And the choice of the middle of the cache,Generally do not needehcache,ChooseredisMore。

(history of website development)Of course,Because usednginxAs a reverse agent tool,allnginxNeed to do high availability configuration,Commonkeepalived+nginxcombination。

Stage five:Separation

(history of website development)history of website development

It is often said that the static separation solution is generally deployed to static documents tonginxWait in the file server,Reduce the request of the application server,There is still one hereCDNthe concept of,Everyone should find out how the process is,After all, it is often said.cdn、cdn、cdnWhy,If you don't understand, you can't insert your mouth.~

Generally, we store static things like to use cloud storage.,All seven cars,cosWaiting for cloud storage, we often use it.。Of course,nginxIt is also the main tool for moving seepage,Because of somecss、jsWaiting for documentsnginxDown。

Stage six:Distributed cache、Cache cluster

history of website development

This stage mainly uses the cache to the ultimate,Repeated utilizationredisThe advantages of the five major data structures to adjust our data display,Also designing cache problems such as cache penetration、Cache、Cache breakdown and other concepts must be familiar,There are also solutions。And buildredisLord from the cluster、Sentinel, etc.redisHigh availability。

Of course,After using the cache,There is a more important problem, also born.,Just how to ensure that the cache is consistent with the database's data!

Stage seven:Read and write、Branch table

history of website development

Stage 7 mainly still concentrates reading and writing、Branch table,Mutual coordination work around different databases。

Read and write

There are many ways to read and write separation.,Of course,The most common or inheritanceAbstractRoutingDataSource,RewritedetermineTargetDataSource()method。Is there any other way??Give everyone a science,Canspring、mybatisUnfold:

spring

1、Different data sources by scanning packages

@MapperScanNote Different packages,All of this packagemapperUse the same data source,mainlysqlSessionTemplateRefAttributes You can see this article:
https://www.cnblogs.com/kangoroo/p/7133543.html

2、Distinguishment

InheritAbstractRoutingDataSource,RewritedetermineTargetDataSource()Method for specifying data sources。Most common means,Must understand!Example:renren-fastOpen source project

mybatis

1、Intercepting method name

Need you to agree to increase the prefix of the deletion,Then select the data source according to the prefix!

2、Interceptivesql

InterceptmysqlExecution methodsql,pass throughsqlTo judge reading and writing Example:
https://github.com/shawntime/shawn-rwdb

Branch table

mycat: based on Proxy,It is written MySQL protocol,Will Mycat Server Disguise into one MySQL database

shareding-jdbc: based on JDBC Interface extension,Be jar Lightweight service in the form of a package

(history of website development)There are many problems in this.,At the same time, a lot of solutions have been born.,For example, distributed transactions,Distributed lock, etc.

  1. consistency(Consistency) :The client knows that a series of operations will occur at the same time.(Take effect)
  2. Usability(Availability) :Each operation must end with the expected response
  3. Partitioning fault tolerance(Partition tolerance) :Even if a single component cannot be available,Operation can still be completed
  1. Basically Available(Basically available)
  2. Soft state(Soft status)
  3. Eventually consistent(Final consistency)

Unable to do strong,But each application can be based on its own business characteristics

Adopting the appropriate way to achieve the system to the final consistency

Stage eight:Micro service architecture

history of website development

NowrpcSolutions have two main systems

(history of website development)existspringcloudThe integrated relationship between components in the medium usage has resolved the corresponding problem that needs to be familiar with and learn to use

There are also a series of problems brought after the service split.,For example, in order to achieve high availability and need to solve、Overtime retry、Limited flow, etc.。Message queue introduced for high concurrent、Cache、Asynchronous consumption, etc.。

Stage nine:NoSqlWith distributed search engines

history of website development


(history of website development)A focus here is our distributed search engine.,Talking in front of uslucene,andes、solrThe bottom layer is actuallylucene。So we are rightluceneThe underlying realization principle must be familiar(Inverted index),Also points to the concept。At the same timeesData synchronization problem between database,We can use three solutions

at the same time,Regardless ofes,stillmongo,Thesenosqldata storage,Will have the concept of fragmentation,Need to understand the principles of its high availability and backup。


history of website development

Original Lu Yumin

返回列表
更多新闻资讯

website development company american fork

2022-03-15

website development company american fork Florida, USA,What is the cost of a dynamic e-commerce website??At the data exitWe are e-commerce website designersThe company provides the best professional web design for small or large companies in

quality management plan for website development

2022-03-15

quality management plan for website development Website as a facade in the Internet promotion,Is the display of corporate image,The importance is self-evident。So how to build a high quality website?What issues need to pay attention to during websit

how to choose website development company

2022-03-15

how to choose website development company In today's fast-developing economy,Small and medium-sized enterprises have realized the importance of enterprise website to enterprise development。However,The website building market is polarized。Some