Shredded Ultimate Encyclopedia of architecture: distributed open-source framework + + + micro-service performance optimization, enough?
Zero fragmented before finishing off some of the topics for everyone to refer to the study, this time to a one-off Shredded Ultimate Encyclopedia of architecture, includes open-source framework, distributed, micro-services, performance optimization and other four major topics were 17 small topics , all the side pot, to give everyone learning together -
Note: You need the full version of all architecture can answer Daquan [ "click me" to receive free]
01 open source frameworks (Spring + SpringMVC + Mybatis)
The answer open-source framework to resolve as follows:
1.1 Spring open source framework Shredded
- What is Spring Framework? What are the main module Spring framework?
- What are the benefits of using the Spring framework can bring?
- What is Inversion of Control (IOC)
- Please explain Spring framework IoC
- BeanFactory and ApplicationContext and what is the difference?
- There are several ways to configure Spring?
- How to configure Spring XML configuration-based approach
- How to configure a Java-based Spring configuration
- How to configure the same general approach Spring
- Please explain Spring Bean's life cycle?
- What is the difference between Spring Bean scopes?
- Singleton Beans Spring Framework is thread-safe it?
- Give an example of how to inject a Java Collection in Spring
- How to inject a Spring Bean in Java.util.Properties
- Please explain automatic assembly Spring Bean's?
- Please explain the difference between automatic assembly mode?
- How to open annotation-based automatic assembly?
- Please give examples explain @Required comment?
- Please give examples explain @Autowired comment?
- Please give examples @Qualifier comment?
- Constructor injection and setter injection What is the difference?
- What are the different types of events have the Spring framework?
- Spring Framework which are used in the design mode?
SpringMVC 1.2 Shredded open source framework
- What is SpringMvc?
- Spring MVC's advantages:
- SpringMVC works?
- SpringMVC process?
- SpringMvc controller is not a singleton, and if so, what is the problem, how to solve?
- If you have used struts2. SpringMVC and the difference between the simple introduction of struts2 What?
- Notes controller SpingMvc in general with that, there is no other alternative to comment?
- @RequestMapping notes used in the class above what effect?
- Like how to map a request to a specific method of the above?
- If intercept request, I would like to get intercepting method of submission, how to configure?
- How to get inside the method Request, or Session?
- I would like to get from the front desk parameters passed in a method to intercept it, how to get?
- If you have a number of parameters passed in the foreground, and these are the parameters of an object, then how to quickly get this object?
- SpringMvc the return value of the function what is?
- SpringMVC how to set redirection and forwarding?
- SpringMvc the front desk to transfer data from the background with what objects?
- SpringMvc There is a category to view and data are merged together, what is?
- How to put data into the Session ModelMap inside there?
- SpringMvc how AJAX and call each other?
- Speaking at the execution flow SpringMvc
- SpringMvc inside the interceptor is how to write?
- When a method returns a special object to AJAX, such as Object, List, etc., deal with what needs to be done?
1.3 Mybatis Shredded open source framework
- What is MyBatis?
- Speaking at the cache MyBatis
- How Mybatis is paged? What is the principle pagination plug-in?
- The operating principle outlined Mybatis plug-ins, as well as how to write a plugin?
- Mybatis dynamic sql is doing what? What are dynamic sql? Can briefly principle of dynamic sql execution is not?
- What is the difference between # {} and {} $ is?
- Why Mybatis semi-automatic ORM mapping tools? Where it differs is in automatic?
- Whether Mybatis support lazy loading? If so, what is its principle is to achieve?
- MyBatis with Hibernate What are the differences?
- What good is MyBatis?
- Brief Mybatis mapping relationship between the Xml mapping file and Mybatis internal data structures?
- What is MyBatis interface binding, and what are the benefits?
- There are several interface binding implementation, namely how to achieve?
- Under what circumstances bind with annotations, use xml binding under what circumstances?
- There are several ways to achieve MyBatis one? Specifically how to operate?
- Mybatis able to perform the associated one to one, one to many query anyway? What are the implementation, and the difference between them?
- Dynamic Sql MyBatis which is how the set? What syntax?
- Mybatis is how to execute sql package is the result of the target object and returns? What are mapping form?
- Xml mapping file, in addition to the common select | insert | updae | than delete the label, what label?
- When the field names in the entity class attribute name and the table is not the same, if the result of the query package to the specified pojo?
- Fuzzy query like how to write the statement
- Xml usually a mapping file, will write a corresponding interface to Dao, Dao's works, can overload?
- Mybatis mapping file, if the A label by reference to the content of B include labels, may I ask, Can I define B label at the back of the label A, or that A must be defined in the previous label?
- Mybatis of Xml mapping file, different Xml mapping file, id if you can repeat?
- Mybatis how to perform batch processing?
- What are Mybatis Executor executor? What is the difference between them?
- Mybatis how to specify which one to use Executor executor?
- Mybatis perform bulk insert, you can return the database primary key list it?
- Whether Mybatis can be mapped Enum enum class?
- How to get the automatically generated (master) key?
- How to pass multiple parameters in a mapper in?
- ResultType resultMap the difference?
- What are the requirements when using the MyBatis mapper interface call?
- What Mybatis larger than a few IBatis improvement?
- IBatis and MyBatis what are called core processing in class?
- IBatis and MyBatis differ in the details of what?
Open source framework (Spring + SpringMVC + Mybatis) answer to resolve finishing:
02 distributed (limiting + communication + database)
Distributed answer interpreted as follows:
2.1 Shredded distributed restrictor (Nginx + ZooKeeper)
(1) Shredded distributed limiting of Nginx
- Please explain what is Nginx?
- Please list some of the characteristics of x Nginx.
- Please list the differences between the x Nginx and Apache and
- Please explain how to handle the x Nginx P HTTP request.
- In the x Nginx, how to use an undefined server names to stop processing the request?
- Use "Reverse Proxy"
- Please list the best use of x Nginx server.
- Please explain what r Master and r Worker and processes on the x Nginx server are?
- Please explain how you turn Nginx through port 080 is different from that?
- Please explain whether it is possible to replace x Nginx error for the 2502 error?
- In the x Nginx, it is explained how to retain the double slash L URL??
- Please explain e ngx_http_upstream_module What is the role?
- Please explain what is K C10K problem?
- Please state what s stub_status and r sub_filter instruction and the role?
- X Nginx explain whether to support the request to the upstream compression?
- Explain how to get the current time in the x Nginx in?
- Explain what s -s x Nginx server with the purpose of?
- Explain how to add modules on the x Nginx server?
(2) limiting the distributed Shredded ZooKeeper
- What ZooKeeper that?
- ZooKeeper provides what?
- Zookeeper File System
- Four types of znode
- Zookeeper notification mechanism
- Zookeeper did what?
- zk naming service (file system)
- zk configuration management (file system notification mechanism)
- Zookeeper Cluster Management (file system notification mechanism)
- Zookeeper distributed lock (file system notification mechanism)
- Distributed Lock acquisition process
- Zookeeper queue management (file system notification mechanism)
- Zookeeper data replication
- Zookeeper Works
- zookeeper 是如何保证事务的顺序一致性的?
- Zookeeper 下 Server 工作状态
- zookeeper 是如何选取主 leader 的?
- 分布式通知和协调
- 机器中为什么会有 leader?
- zk 节点宕机如何处理?
- Zookeeper 同步流程
- zookeeper 负载均衡和 nginx 负载均衡区别
- zookeeper watch 机制
2.2 手撕分布式通讯(Kafka+ActiveMQ+RabbitMQ)
(1)手撕分布式通讯之kafka
- Kafka 的设计时什么样的呢?
- 数据传输的事物定义有哪三种?
- Kafka 判断一个节点是否还活着有那两个条件?
- producer 是否直接将数据发送到 broker 的 leader(主节点)?
- Kafa consumer 是否可以消费指定分区消息?
- Kafka 消息是采用 Pull 模式,还是 Push 模式?
- Kafka 存储在硬盘上的消息格式是什么?
- Kafka 高效文件存储设计特点:
- Kafka 与传统消息系统之间有三个关键区别
- Kafka 创建 Topic 时如何将分区放置到不同的 Broker 中
- Kafka 新建的分区会在哪个目录下创建
- partition 的数据如何保存到硬盘
- kafka 的 ack 机制
- Kafka 的消费者如何消费数据
- 消费者负载均衡策略
- 数据有序
- kafaka 生产数据时数据的分组策略
(2)手撕分布式通讯之ActiveMQ
- 什么是 ActiveMQ?
- ActiveMQ 服务器宕机怎么办?
- 丢消息怎么办?
- 持久化消息非常慢
- 消息的不均匀消费。
- 死信队列。
- ActiveMQ 中的消息重发时间间隔和重发次数吗?
(3)手撕分布式通讯之RabbitMQ
- RabbitMQ 中的 broker 是指什么?cluster 又是指什么?
- 什么是元数据?元数据分为哪些类型?包括哪些内容?与 cluster 相关的元数据有哪些?元数据是如何保存的?元数据在 cluster 中是如何分布的?
- RAM node 和 disk node 的区别?
- RabbitMQ 上的一个 queue 中存放的 message 是否有数量限制?
- RabbitMQ 概念里的 channel、exchange 和 queue 这些东东是逻辑概念,还是对应着进程实体?这些东东分别起什么作用?
- vhost 是什么?起什么作用?
- 在单 node 系统和多 node 构成的 cluster 系统中声明 queue、exchange ,以及进行 binding 会有什么不同?
- 客户端连接到 cluster 中的任意 node 上是否都能正常工作?
- cluster 中 node 的失效会对 consumer 产生什么影响?若是在 cluster 中创建了mirrored queue ,这时 node 失效会对 consumer 产生什么影响?
- 能够在地理上分开的不同数据中心使用 RabbitMQ cluster 么?
- 为什么 heavy RPC 的使用场景下不建议采用 disk node ?
- 向不存在的 exchange 发 publish 消息会发生什么?向不存在的 queue 执行consume 动作会发生什么?
- routing_key 和 binding_key 的最大长度是多少?
- RabbitMQ 允许发送的 message 最大可达多大?
- 什么情况下 producer 不主动创建 queue 是安全的?
- “dead letter”queue 的用途?
- 为什么说保证 message 被可靠持久化的条件是 queue 和 exchange 具有durable 属性,同时 message 具有 persistent 属性才行?
- 什么情况下会出现 blackholed 问题?
- 如何防止出现 blackholed 问题?
- Consumer Cancellation Notification 机制用于什么场景?
- Basic.Reject 的用法是什么?
- 为什么不应该对所有的 message 都使用持久化机制?
- RabbitMQ 中的 cluster、mirrored queue,以及 warrens 机制分别用于解决什么问题?存在哪些问题?
2.3 手撕分布式之缓存(Redis+memcached+MongoDB)
(1)手撕分布式缓存之Redis
- redis 简介
- 为什么要用 redis /为什么要用缓存(高性能、高并发)
- 为什么要用 redis 而不用 map/guava 做缓存?
- redis 和 memcached 的区别
- redis 常见数据结构以及使用场景分析(String、Hash、List、Set、Sorted Set)
- redis 设置过期时间
- redis 内存淘汰机制(MySQL里有2000w数据,Redis中只存20w的数据,如何保证Redis中的数据都是热点数据?)
- redis 持久化机制(怎么保证 redis 挂掉之后再重启数据可以进行恢复)
- redis 事务
- Redis 常见异常及解决方案(缓存穿透、缓存雪崩、缓存预热、缓存降级)
- 分布式环境下常见的应用场景(分布式锁、分布式自增 ID)
- Redis 集群模式(主从模式、哨兵模式、Cluster 集群模式)
- 如何解决 Redis 的并发竞争 Key 问题
- 如何保证缓存与数据库双写时的数据一致性?
(2)分布式缓存之memcached
- memcached 是怎么工作的?
- memcached 最大的优势是什么?
- memcached 和服务器的 local cache (比如 PHP 的 的 APC 、mmap 文件等)相比,有什么优缺点?
- memcached 和 和 MySQL 的 的 query cache 相比,有什么优缺点?
- memcached 的 的 cache 机制是怎样的?
- memcached 如何实现冗余机制?
- 我需要把 memcached 中的 item 批量导出导入,怎么办?
- memcached 如何处理容错的?
- 如何将 memcached 中 中 item 批量导入导出?
- memcached 是如何做身份验证的?
- memcached 的多线程是什么?如何使用它们?
- memcached 能接受的 key 的最大长度是多少?
- memcached 对 对 item 的过期时间有什么限制?
- memcached 最大能存储多大的单个 item ?
- 为什么单个 item 的大小被限制在 1M byte 之内?
(3)手撕分布式缓存之MongoDB
- 你说的 NoSQL 数据库是什么意思?NoSQL 与 RDBMS 直接有什么区别?为什么要使用和不使用NoSQL 数据库?说一说 NoSQL 数据库的几个优点?
- NoSQL 数据库有哪些类型?
- MySQL 与 MongoDB 之间最基本的差别是什么?
- 你怎么比较 MongoDB、CouchDB 及 CouchBase?
- MongoDB 成为最好 NoSQL 数据库的原因是什么?
- 32 位系统上有什么细微差别?
- journal 回放在条目(entry)不完整时(比如恰巧有一个中途故障了)会遇到问题吗?
- 分析器在 MongoDB 中的作用是什么?
- 名字空间(namespace)是什么?
- 如果用户移除对象的属性,该属性是否从存储层中删除?
- 能否使用日志特征进行安全备份?
- 允许空值 null 吗?
- 更新操作立刻 fsync 到磁盘?
- 如何执行事务/加锁?
- 为什么我的数据文件如此庞大?
- 启用备份故障恢复需要多久?
- 什么是 master 或 primary?
- 什么是 secondary 或 slave?
- 我必须调用 getLastError 来确保写操作生效了么?
- 我应该启动一个集群分片(sharded)还是一个非集群分片的 MongoDB 环境?
- 分片(sharding)和复制(replication)是怎样工作的?
- 数据在什么时候才会扩展到多个分片(shard)里?
- 当我试图更新一个正在被迁移的块(chunk)上的文档时会发生什么?
- 如果在一个分片(shard)停止或者很慢的时候,我发起一个查询会怎样?
- 我可以把 moveChunk 目录里的旧文件删除吗?
- 我怎么查看 Mongo 正在使用的链接?
- 如果块移动操作(moveChunk)失败了,我需要手动清除部分转移的文档吗?
- 如果我在使用复制技术(replication),可以一部分使用日志(journaling)而其他部分则不使用吗?
- 当更新一个正在被迁移的块(Chunk)上的文档时会发生什么?
- MongoDB 在 A:{B,C}上建立索引,查询 A:{B,C}和 A:{C,B}都会使用索引吗?
- 如果一个分片(Shard)停止或很慢的时候,发起一个查询会怎样?
- MongoDB 支持存储过程吗?如果支持的话,怎么用?
- 如何理解 MongoDB 中的 GridFS 机制,MongoDB 为何使用 GridFS 来存储文件?
分布式(限流+缓存+通讯)答案解析整理:
03 微服务(Dubbo+Spring Boot+Spring Cloud)
微服务答案解析如下:
3.1 手撕微服务之Dubbo
- Dubbo 支持哪些协议,每种协议的应用场景,优缺点?
- Dubbo 超时时间怎样设置?
- Dubbo 有些哪些注册中心?
- Dubbo 集群的负载均衡有哪些策略
- Dubbo 的核心功能?
- Dubbo 服务注册与发现的流程?
- Dubbo 的架构设计?
- Dubbo 框架设计一共划分了 10 个层:
- Dubbo 支持哪些协议,每种协议的应用场景,优缺点?
- dubbo 推荐用什么协议?
- Dubbo 默认采用注册中心?
- Dubbo 与 Spring 的关系?
- Dubbo 的集群容错方案有哪些?
- Dubbo 的默认集群容错方案?
- Dubbo 在安全机制方面是如何解决?
- Dubbo 和 Spring Cloud 的关系?
- Dubbo 超时时间怎样设置?
- Dubbo 和 Spring Cloud 的区别?
3.2 手撕微服务之Spring Boot
- 什么是 Spring Boot?
- Spring Boot 有哪些优点?
- 什么是 JavaConfig?
- 如何重新加载 Spring Boot 上的更改,而无需重新启动服务器?
- Spring Boot 中的监视器是什么?
- 如何在 Spring Boot 中禁用 Actuator 端点安全性?
- 如何在自定义端口上运行 Spring Boot 应用程序?
- 什么是 YAML?
- 什么是 Spring Profiles?
- 什么是 Spring Batch?
- 如何集成 Spring Boot 和 ActiveMQ?
- 如何使用 Spring Boot 实现分页和排序?
- 什么是 Swagger?你用 Spring Boot 实现了它吗?
- 什么是 FreeMarker 模板?
- 如何使用 Spring Boot 实现异常处理?
- 您使用了哪些 starter maven 依赖项?
- 什么是 CSRF 攻击?
- 什么是 WebSockets?
- 什么是 AOP?
- 什么是 Apache Kafka?
- 我们如何监视所有 Spring Boot 微服务?
3.3 手撕微服务之Spring Cloud
- 什么是 Spring Cloud?
- 使用 Spring Cloud 有什么优势?
- 服务注册和发现是什么意思?Spring Cloud 如何实现?
- 负载平衡的意义什么?
- 什么是 Hystrix?它如何实现容错?
- 什么是 Hystrix 断路器?我们需要它吗?
- 什么是 Spring Cloud Bus?我们需要它吗?
- 什么是 Netflix Feign?它的优点是什么?
微服务(Dubbo+Spring Boot+Spring Cloud)答案解析整理:
04 性能优化(JVM+Tomcat+MySQL)
性能优化答案解析如下:
4.1 手撕性能优化之JVM
- Java 类加载过程?
- 描述一下 JVM 加载 Class 文件的原理机制?
- Java 内存分配。
- GC 是什么? 为什么要有 GC?
- 简述 Java 垃圾回收机制。
- 如何判断一个对象是否存活?(或者 GC 对象的判定方法)
- 垃圾回收的优点和原理。并考虑 2 种回收机制
- 垃圾回收器的基本原理是什么?垃圾回收器可以马上回收内存吗?有什么办法主动通知虚拟机进行垃圾回收?
- Java 中会存在内存泄漏吗,请简单描述。
- 深拷贝和浅拷贝。
- System.gc 和 Runtime.gc 会做什么事情?
- finalize 方法什么时候被调用?析构函数 (finalization) 的目的是什么?
- 如果对象的引用被置为 null,垃圾收集器是否会立即释放对象占用的内存?
- 什么是分布式垃圾回收(DGC)?它是如何工作的?
- 串行(serial)收集器和吞吐量(throughput)收集器的区别是什么?
- 在 Java 中,对象什么时候可以被垃圾回收?
- 简述 Java 内存分配与回收策率以及 Minor GC 和 MajorGC
- JVM 的永久代中会发生垃圾回收么?
- Java 中垃圾收集的方法有哪些?
- 什么是类加载器,类加载器有哪些?
- 类加载器双亲委派模型机制?
4.2 手撕性能优化之Tomcat
- 你怎样给 tomcat 去调优?
- 如何加大 tomcat 连接数
- tomcat 中如何禁止列目录下的文件
- 怎样加大 tomcat 的内存
- Tomcat 有几种部署方式
- Tomcat 的优化经验
4.3 手撕性能优化之MySQL
- 为查询缓存优化你的查询
- EXPLAIN你的SELECT查询
- 当只要一行数据时使用LIMIT 1
- 为搜索字段建索引
- 在Join表的时候使用相当类型的例,并将其索引
- 千万不要 ORDER BY RAND
- 避免 SELECT *
- 永远为每张表设置一个 ID
- 使用 ENUM 而不是 VARCHAR
- 从 PROCEDURE ANALYSE 取得建议
- 尽可能的使用 NOT NULL
- Prepared Statements
- 无缓冲的查询
- 把 IP 地址存成 UNSIGNED INT
- 固定长度的表会更快
- 垂直分割
- 拆分大的 DELETE 或 INSERT 语句
- 越小的列会越快
- 选择正确的存储引擎
- 使用一个对象关系映射器(Object Relational Mapper)
- 小心“永久链接”
性能优化(JVM+Tomcat+MySQL)答案解析整理:
最后再说一遍:点击下面的链接,进去即可领取全部的答案!!!!