Your business is how the evolution of micro-services

Previous projects such as news modules and commodity module is put into a project (for example, tp) in development. What to
1, now 1 million visits daily commodities, news access is only 200 per day. Well before then deploy to die.
2, the product should separate out module, to deploy the sub-table to do load balancing machine 3

 

Since the split out. So the news module if you want to display a list of the hottest commodities in the supposed news pages?
1, the traditional do, directly require news.php on the line. Now I can not
2, do not press the module directly select * from product? Coupling is too high, too setback the

 

So commodity module will release a special address such as API is called, / product / fuck
this is the first rest api  

 Then news module as long as httpclient (or curl). API to request this item on the list, right?

Since http api may be a bit slow. Thus a product based jsonrpc module provides the interface to rpc. Soon, right?

 

Since http api may be a bit slow. Thus a product based jsonrpc module provides the interface to rpc. Soon, right?

 Then news module as long as httpclient (or curl). API to request this item on the list, right?

To more than so far. It can not be called micro-services. The service can only be deployed separately, separate independent calls, with the technology it rpc  

 

The real key is. (I cite two easiest points)
1, how do you know the news module API module address in which commodity? Write dead in the program do?
2, if the product module is down. Is not the news pages module also stuck in what?

 

 Naturally you think of a thing "tmd services apart so much. I need to manage these services let a bunch of dog days of stable operation"
 
 This is the service of governance. You need service registration center, message bus service downgraded fuse, current limiting, gateways, etc.
 
 From here you enter the service of governance. This is the beginning of a true micro services
 
 A micro-services project has been well prepared. Not that you use a third party on a multi-tall
 
 But rather how just right (costs) are service governance
 
 Just right is how you control costs, but also high performance completion. And controlled
 
  For example just starting out, only a few thousand users. You direct the k8s be governed. That year you engage in technology, and earn money
 
 Another example is the gateway. If you only have two or three services, there is a reverse proxy between service (route). No other part of the public. So long as openresty (even nginx on the line)
 
 If there is such a current limiting function, and their combined service authority, public section and lot. How you will use the advanced gateway, customized development and even their own business gateway
 
 Public part of the increasingly concentrated, each product line has a unified management needs. This time, you have to consider these things to do in Taiwan out of the
 
 Poor -> bit of money -> money -> get financing -> Money Laundering 
different stages of technical means used are not the same
 
 http api also belong rpc. But often they say rpc is the tcp. And in addition to http tcp to go one http
 
 There is an important reason that not all services have to be released
 

Some service functions to other modules is calling me an analogy

Goods such orders. Process is the order of storage -> Inventory reduction -> Send Mail Order Success -> Get User Points

There is only the external storage orders API (the so-called outside, that is, the people need to eat melon can commit access)

 

 Several other features are dark compliment between service and service. So no need to make http api

Guess you like

Origin www.cnblogs.com/zzg521/p/11774316.html