The first round face questions Summary

1. The description of the various features of the database transaction --ACID

Atomicity (Atomicity): operations in the transaction either all succeed or all fail. Consistency (Consistency): the integrity of the data before and after the transaction must be consistent. Isolation (Isolation): between a plurality of concurrent transactions are isolated from each other, non-interfering. Persistent (Durability): After the transaction is committed, the data is permanently changed.   

2. What is springboot? The company is which version you use?

SpringBoot is introduced to solve the traditional Spring Framework configuration file redundancy, the assembly of components of complex Maven-based solution designed to quickly build a single micro-services.

Spring boot advantage of

Easily create stand-alone applications Spring

Inline Tomcat, jetty and other web container, do not need to deploy the WAR file. It offers a range of "starter" to simplify the configuration of Maven

Out of the box, automatically configured as Spring

Version: 2.1.6

3. What is redis?

Redis is completely free open source, BSD comply with the agreement, it is a high-performance key-value database.

Redis advantage

  • High performance -Redis can read as fast as 110,000 times / s, write speed is 81000 times / s.
  • Rich data types -Redis support binary text columns String, Lists, Hashes, Sets and Ordered Sets the data type of the operation.
  • All operations are atomic atomic -Redis (can not be divided), meaning that either the success or failure of execution is not executed. It is a single atomic operation. A plurality of operation also supports transaction, i.e. atomicity, and EXEC instructions by MULTI wrap.
  • Feature-rich -Redis also support publish / subscribe, notification, key expiration and so on characteristics **

4. How to understand springcloud Micro Services in relations between them, eureka, provider, consumer?

eureka: provide service registry to discover provider: service provision methods to register itself to eureka, let the consumer to find the consumer: the service consumer to obtain a list of registered services from eureka, capable of Consumer Services  

What 5.mysql default storage engine?

Before V5.1 Mysql default storage engine is MyISAM; after this is the default storage engine InnoDB. MyISAM does not support transactions, InnoDB support transactions. MyISAM does not support foreign keys, InnoDB support foreign keys, MyISAM supports full-text indexing, InnoDB does not support full-text indexing.  

6. What is the cross-domain?

To understand cross-domain, first talk about same-origin policy. The so-called homologous refers to the domain, protocol, the same port, there is not the same as a cross-domain.

Origin policy generally divided into the following two:

DOM-origin policy: prohibiting operate on different source page DOM. Here the main scenario is the case of cross-domain iframe, iframe different domain names is to limit access to each other.

XmlHttpRequest origin policy: Do not use the XHR object sends an HTTP request to the server address different sources.

Cross-domain, referring to request resources from one domain to another domain. That is, cross-domain request! When cross-domain, the browser can not execute scripts other site's domain name, is caused by the browser's same-origin policy, it is browser security restrictions imposed.

Cross-domain strictly speaking it is as long as the protocol, domain name, a port there any different, it is treated as a cross-domain.

7. What is a token?

Token is a series of strings, the server generates, as a token to the requesting client. After the first login, the server generates a Token Token will return this to the client after the client simply come to bring this Token request data without the need to bring the user name and password again.  

8. What is RESTful?

First, rest is an API model, often written in JSON format. Applications rest in line with the principles of restraint and style or design is RESTful.

9.SpringCloud which problems?

The complexity associated with distributed systems - including network problems, latency overhead, bandwidth issues, security issues. Ability to handle service discovery - the service discovery process and allow the cluster service to find each other and communicate. Resolve the redundancy problem - redundancy problems often occur in distributed systems. Load balancing - Improvement across multiple computing resources (e.g., a computer cluster, a network linking the central processing unit) operating load distribution. Reduce performance problems - performance issues due to various operations to reduce overhead caused.    

10. What is the micro-service fuse? What is service degradation?

Blown role service is unavailable or when the response of a service timeout occurs, in order to prevent the entire system in the avalanche, temporarily stop calling the service. Service degradation is to prevent certain functions (business scenarios) appeared overloading or slow response, the request to temporarily abandon some non-core interfaces and data in its interior, and a direct return prepared in advance fallback (fallback) error processing information. 

11. What are the advantages and disadvantages of micro service is?

advantage:

Ease of development and maintenance: Because a service only focus on one particular business, the business becomes more clear. While maintaining it is more convenient. Single service starts faster: a single service code is not a lot of volume, it will start soon. Easy stretch: If there are three service ABC system, the service B access than larger, we can service B cluster deployment.  

Loosely coupled, single-focused business functions, irrespective of language development, reducing team size. In development, the business does not need to know more, just focus on the current function, convenient centralized, small but functional. A micro-service function is impaired, the impact is not too much to other features, you can quickly locate the problem. Micro-services only focus on the current business logic code, will not html, css or other boundaries were mixed. Technology with the flexibility, independence more comfortable.  

Disadvantages: operation and maintenance requirements are relatively high: a war on the package before, and now there will be a lot of system services, each service corresponds to a war package, it will become very troublesome to maintain. Technical complexity increase: Micro service will bring a series of problems, affairs issues, Session consistency, lock issues.  

As the number of services increases management complexity, the complexity of deployment, the server needs to increase communication and service invocation pressure, operation and maintenance engineers pressure, increased human resources, systems rely on enhanced data integrity, performance monitoring.

 

(Micro disadvantages services

1. Service calls across the network, increase network IO, reduce performance.

2. Service calls across more nodes, distributed transaction data inconsistency may be greater.

3. The need for services found that increasing complexity.

4. operation and maintenance, testing services based on the application of micro architecture is also very complicated.

5. Each service is an independent system, code duplication, increase the likelihood of inconsistencies framework.

6. Therefore, the total length of service start-up time.

7. The dependence of service delivery, A dependent B, B-dependent C. It can only be deployed C, and then deploy B, and then deploy A.

 

 The advantages of micro-services

1. Traditional micro service can use a different language, framework development.

2. A jar is computationally intensive, a jar is io-intensive, integrated in one system, there will be a resource conflict. )

 

12. How independent communication between micro and services?

Synchronous communication: dobbo via a remote procedure call RPC, springcloud call via REST interface json like. Asynchronous: message queue, such as: RabbitMq, ActiveMq, Kafka like.

(

Synchronization: RPC, REST and so on.

  Asynchronous: the message queue, the message to be considered reliable transmission, high performance, and changes the programming model.

RestTemplate three ways of communication:

 

The first is called

  Template rest Rest Rest template = new Template ();

  String data = restTemplate.getForObject("http://localhost:8773/hi?name=ceshi",String.class);

  ResposeResult responseFinishEntity = restTemplate.postForObject (urlNameString, inOrderVO, ResposeResult.class);

 

The second is called:

  @Autowired

  private LoadBalancerClient loadBalancerClient;

  // The second way to call

  Template rest Rest Rest template = new Template ();

  ServiceInstance serviceInstance = loadBalancerClient.choose("provider");

  String url = String.format("http://%s:%s",serviceInstance.getHost(),serviceInstance.getPort());

  String data = restTemplate.getForObject(url,String.class);

 

The third is called (using server_id

  Template rest Rest Rest template = new Template ();

  String data =  restTemplate.getForObject("http://service-provider/hi?name=" + name, String.class);

Load Balancing: in your startup class RestTemplate in bean and LoadBalanced comment

 

  @Bean

  @LoadBalanced

  Template Residual rest template () {

      return new RestTemplate();

   }

Then used directly by annotating restTemplate

 

  @Autowired

  Rest Template rest template;

Configuring load balancing rules. The default is polling rules

 

service-provider.ribbon.NFLoadBalancerRuleClassName=com.netflix.loadbalancer.RandomRule

)

What are the differences 13.SpringCloud and Dubbo there?

First of all , they are distributed management framework. dubbo binary transmission, bandwidth may be less. SpringCloud is http transmission bandwidth will be a little more while using the http protocol typically use JSON messages, consumption will be even greater. dubbo development more difficult, the dependent jar package has a lot of problems can not be resolved large-scale projects. SpringCloud can inherit one-click generation of third parties, natural integration. SpringCloud interfaces loose agreement requires strong administrative measures to restrict the interface disorderly upgrade. The biggest difference: the Spring Cloud abandoned RPC communication in Dubbo, using HTTP-based REST approach. Strictly speaking, these two methods have advantages and disadvantages. Although to some extent, the latter at the expense of performance of service calls, but also to avoid the problems mentioned above native RPC brings. RPC and REST compared to more flexible, service providers and rely solely dependent on the caller a paper contract, code-level strong dependence does not exist in this case emphasize the rapid evolution of micro-services environment, appear to be more appropriate.        

(

First, they are distributed management framework.
    dubbo binary transmission, bandwidth may be less. SpringCloud is http transmission bandwidth will be a little more while using the http protocol typically use JSON messages, consumption will be even greater.
    dubbo development more difficult, the dependent jar package has a lot of problems can not be resolved large-scale projects. SpringCloud can inherit one-click generation of third parties, natural integration.
    SpringCloud interfaces loose agreement requires strong administrative measures to restrict the interface disorderly upgrade.
The biggest difference :
    the Spring Cloud abandoned RPC communication in Dubbo, using HTTP-based REST approach.


    Strictly speaking, these two methods have advantages and disadvantages. Although to some extent, the latter at the expense of performance of service calls, but also to avoid the problems mentioned above native RPC brings. RPC and REST compared to more flexible, service providers and rely solely dependent on the caller a paper contract, code-level strong dependence does not exist in this case emphasize the rapid evolution of micro-services environment, appear to be more appropriate.

 

)

The relationship between 14.SpringBoot and SpringCloud?

SpringBoot: focus on quick and easy development of a single individual micro-services (microscopic attention); SpringCloud: focus on micro-services coordination framework for global governance, the development of a monomer SpringBoot micro-manage and service portfolio (macro focus); SpringBoot can leave SpringCloud used independently, but SpringCloud not leave SpringBoot, it belongs to the dependencies.  

(

1, SpringBoot just a rapid development framework, using annotations to simplify the xml configuration, built Servlet container, the Java application execution.

2, SpringCloud is a set of frame may comprise SpringBoot.

)

The difference 15.eureka and zookeeper?

function eureka zookeeper and can provide service registry and discovery, zookeeper is CP principles, strong consistency and partitions fault tolerance. eureka AP principle is the availability and fault tolerance partition. When the zookeeper when the primary node fails, zk will select the remaining nodes master node takes too long, though eventually recover, but during the selected master node causes the service is not available, this can not be tolerated. eureka each node is equal, hang a node, the other nodes will ensure normal service.  

(

Function eureka zookeeper and can provide service registry and discovery, zookeeper is CP principles, strong consistency and partitions fault tolerance. eureka AP principle is the availability and fault tolerance partition.

When the zookeeper when the primary node fails, zk will select the remaining nodes master node takes too long, though eventually recover, but during the selected master node causes the service is not available, this can not be tolerated.

eureka each node is equal, hang a node, the other nodes will ensure normal service.

)

What 16.mycat that? What is your company's sub-library sub-table fragmentation rules?

Mycat is based on MySQL database middleware, the database used to coordinate the cut after separation, so that it can be unified management.

Fragmentation rules: modulo fragment PartitionByMode

(

Mycat is based on MySQL database middleware, the database used to coordinate the cut after separation, so that it can be unified management.

Fragmentation rules: modulo fragment PartitionByMode

)

17. What is a collection?

There are a set of two parent interface, a collection, a Map; while the collection has two sub-interfaces, a List, a the Set; List There are two common implementation class ArrayList, LinkedList; the Set There are two common implementation class HashSet, TreeSet; Map there are two common implementation class HashMap, HashTable.    

(

A collection is a container to put the data, accurate to say that put the data object references the container.

Collections stored in java.util package; set There are three main types: set (set), List (lists) and a map (maps); a set of reference objects are stored, rather than the object itself. So we call a collection of objects that reference objects in the collection.

)

18. What is dubbo?

 

Dubbo in a layered approach to architecture, can maximize loose coupling. Dubbo uses a very simple model, either the provider of service, either consumer consumer services, so this can be based on abstract service providers and service consumers two roles

Remote Method Invocation Interface for: providing a plurality of frame-based NIO package length abstract connection model comprises a plurality of threads, serialization, and - information exchange "request-response" mode. ****

Intelligent load balancing and fault tolerance: providing a transparent interface methods based on remote procedure calls, including multi-protocol support, as well as soft load balancing, fault tolerance failure, address routing, dynamic configuration and other cluster support. ** **

Automatic registration and service discovery: a registry-based directory service, the service can only consume dynamic lookup service provider, the address is transparent, so that the service provider may increase or decrease slide machine ******

(

Dubbo is a distributed service framework, providing high performance and transparency of RPC remote service call programs, services and SOA governance program. Simply put, dubbo is a service framework, if not distributed demand, in fact, we do not need, and only when distributed, have dubbo demand for such a distributed service framework, and is called a service essentially stuff, it means a distributed framework for remote service invocation (farewell Web service mode wSdl, to service providers and consumers Register on dubbo)

The core section includes :

1. Remote Communication: providing a plurality of frame-based NIO package length abstract connection model comprises a plurality of threads, serialization, and - information exchange "request-response" mode.

2. cluster fault tolerance: providing a transparent interface method is based on remote procedure calls, including multi-protocol support, as well as soft load balancing, fault tolerance failure, address routing, dynamic configuration and other cluster support.

3. Auto Discovery: Based registry directory service, the service can only consume dynamic lookup service provider, the address is transparent, so that the service provider may increase or decrease smooth machine.

)

19. What is spring?

Spring is an open source lightweight Java development framework. It is a simplified application development. Prior to spring out, service layer calls dao layer is a new way, after the spring out, service layer and the layer will be placed dao spring container to manage, this is the spring of the first characteristic, we call IOC , inversion of control. There is also a spring characteristic, we call AOP, vernacular, the so-called "aspect-oriented", it means a special people doing special things. In AOP features on many projects to be publicly owned or repeat module is invoked it can be extracted using, for example, the logging module.  

(

Spring Framework is a J2EE application framework open source, is lightweight container for managing the life cycle of bean. Spring solves many common problems encountered by developers in J2EE development, it provides a powerful IOC, AOP and Web MVC and other functions. Spring construct may be applied alone application, and may be a number of Web frame assembly Struts, Webwork, Tapestry, etc. used, and may be combined with Swing desktop applications AP. Spring can be applied not only in JEE applications, can also be applied in desktop applications and applets. Spring framework consists of seven parts, namely the Spring Core, Spring AOP, Spring ORM, Spring DAO, Spring Context, Spring Web Spring Web MVC.

)

Guess you like

Origin www.cnblogs.com/day-day--up/p/12290029.html