{"id":13434728,"url":"https://github.com/doocs/advanced-java","last_synced_at":"2025-05-12T16:17:37.375Z","repository":{"id":37317361,"uuid":"151834062","full_name":"doocs/advanced-java","owner":"doocs","description":"😮 Core Interview Questions \u0026 Answers For Experienced Java(Backend) Developers | 互联网 Java 工程师进阶知识完全扫盲：涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识","archived":false,"fork":false,"pushed_at":"2025-04-23T12:30:49.000Z","size":26586,"stargazers_count":77551,"open_issues_count":0,"forks_count":19180,"subscribers_count":2584,"default_branch":"main","last_synced_at":"2025-05-05T14:13:20.654Z","etag":null,"topics":["advanced-java","distributed-search-engine","distributed-systems","doocs","dubbo","elasticsearch","eureka","feign","high-availability","high-concurrency","hystrix","java","message-queue","microservices-architecture","redis","ribbon","rpc","spring-cloud","springcloud-config","zookeeper"],"latest_commit_sha":null,"homepage":"https://java.doocs.org","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doocs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":"doocs","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-10-06T11:38:30.000Z","updated_at":"2025-05-05T10:42:17.000Z","dependencies_parsed_at":"2023-12-17T11:30:13.702Z","dependency_job_id":"2d3f7110-2ad8-420e-b302-05848cd40f7f","html_url":"https://github.com/doocs/advanced-java","commit_stats":{"total_commits":675,"total_committers":47,"mean_commits":"14.361702127659575","dds":"0.38962962962962966","last_synced_commit":"5f60952c641894d8887e8bfc5351f51b052d2f63"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doocs%2Fadvanced-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doocs%2Fadvanced-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doocs%2Fadvanced-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doocs%2Fadvanced-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doocs","download_url":"https://codeload.github.com/doocs/advanced-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253133137,"owners_count":21859111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advanced-java","distributed-search-engine","distributed-systems","doocs","dubbo","elasticsearch","eureka","feign","high-availability","high-concurrency","hystrix","java","message-queue","microservices-architecture","redis","ribbon","rpc","spring-cloud","springcloud-config","zookeeper"],"created_at":"2024-07-31T03:00:21.586Z","updated_at":"2025-05-12T16:17:37.349Z","avatar_url":"https://github.com/doocs.png","language":"Java","readme":"# 互联网 Java 工程师进阶知识完全扫盲\n\n[![stars](https://img.shields.io/github/stars/doocs/advanced-java?color=42b883\u0026logo=github\u0026style=flat-square\u0026logoColor=ffffff)](https://github.com/doocs/advanced-java/stargazers)\n[![forks](https://img.shields.io/github/forks/doocs/advanced-java?color=42b883\u0026logo=github\u0026style=flat-square\u0026logoColor=ffffff)](https://github.com/doocs/advanced-java/network/members)\n[![license](https://img.shields.io/github/license/doocs/advanced-java?color=42b883\u0026style=flat-square\u0026logo=homeassistantcommunitystore\u0026logoColor=ffffff)](./LICENSE)\n[![doocs](https://img.shields.io/badge/org-join%20us-42b883?style=flat-square\u0026logo=homeassistantcommunitystore\u0026logoColor=ffffff)](https://doocs.github.io/#/?id=how-to-join)\n\n本项目大部分内容来自中华石杉，版权归作者所有，内容涵盖[高并发](#高并发架构)、[分布式](#分布式系统)、[高可用](#高可用架构)、[微服务](#微服务架构)、[海量数据处理](#海量数据处理)等领域知识。我们对这部分知识做了一个系统的整理，方便读者们学习查阅。\n\n我们也在全力更新算法项目！如果你在准备笔面试算法，或者想进一步提升 coding 能力，欢迎 Star 关注 [doocs/leetcode](https://github.com/doocs/leetcode)\n\n学习本项目之前，先来看看 [Discussions 讨论区](https://github.com/doocs/advanced-java/discussions/9)的技术面试官是怎么说的吧。本项目欢迎各位开发者朋友到 Discussions 讨论区分享自己的一些想法和实践经验。也不妨 Star 关注 [doocs/advanced-java](https://github.com/doocs/advanced-java)，随时追踪项目最新动态。\n\n## 高并发架构\n\n### [消息队列](/docs/high-concurrency/mq-interview.md)\n\n-   [为什么使用消息队列？消息队列有什么优点和缺点？Kafka、ActiveMQ、RabbitMQ、RocketMQ 都有什么优点和缺点？](/docs/high-concurrency/why-mq.md)\n-   [如何保证消息队列的高可用？](/docs/high-concurrency/how-to-ensure-high-availability-of-message-queues.md)\n-   [如何保证消息不被重复消费？（如何保证消息消费的幂等性）](/docs/high-concurrency/how-to-ensure-that-messages-are-not-repeatedly-consumed.md)\n-   [如何保证消息的可靠性传输？（如何处理消息丢失的问题）](/docs/high-concurrency/how-to-ensure-the-reliable-transmission-of-messages.md)\n-   [如何保证消息的顺序性？](/docs/high-concurrency/how-to-ensure-the-order-of-messages.md)\n-   [如何解决消息队列的延时以及过期失效问题？消息队列满了以后该怎么处理？有几百万消息持续积压几小时，说说怎么解决？](/docs/high-concurrency/mq-time-delay-and-expired-failure.md)\n-   [如果让你写一个消息队列，该如何进行架构设计啊？说一下你的思路。](/docs/high-concurrency/mq-design.md)\n\n### [搜索引擎](/docs/high-concurrency/es-introduction.md)\n\n-   [ES 的分布式架构原理能说一下么（ES 是如何实现分布式的啊）？](/docs/high-concurrency/es-architecture.md)\n-   [ES 写入数据的工作原理是什么啊？ES 查询数据的工作原理是什么啊？底层的 Lucene 介绍一下呗？倒排索引了解吗？](/docs/high-concurrency/es-write-query-search.md)\n-   [ES 在数据量很大的情况下（数十亿级别）如何提高查询效率啊？](/docs/high-concurrency/es-optimizing-query-performance.md)\n-   [ES 生产集群的部署架构是什么？每个索引的数据量大概有多少？每个索引大概有多少个分片？](/docs/high-concurrency/es-production-cluster.md)\n\n### 缓存\n\n-   [在项目中缓存是如何使用的？缓存如果使用不当会造成什么后果？](/docs/high-concurrency/why-cache.md)\n-   [Redis 和 Memcached 有什么区别？Redis 的线程模型是什么？为什么单线程的 Redis 比多线程的 Memcached 效率要高得多？](/docs/high-concurrency/redis-single-thread-model.md)\n-   [Redis 都有哪些数据类型？分别在哪些场景下使用比较合适？](/docs/high-concurrency/redis-data-types.md)\n-   [Redis 的过期策略都有哪些？手写一下 LRU 代码实现？](/docs/high-concurrency/redis-expiration-policies-and-lru.md)\n-   [如何保证 Redis 高并发、高可用？Redis 的主从复制原理能介绍一下么？Redis 的哨兵原理能介绍一下么？](/docs/high-concurrency/how-to-ensure-high-concurrency-and-high-availability-of-redis.md)\n-   [Redis 主从架构是怎样的？](/docs/high-concurrency/redis-master-slave.md)\n-   [Redis 哨兵集群如何实现高可用？](/docs/high-concurrency/redis-sentinel.md)\n-   [Redis 的持久化有哪几种方式？不同的持久化机制都有什么优缺点？持久化机制具体底层是如何实现的？](/docs/high-concurrency/redis-persistence.md)\n-   [Redis 集群模式的工作原理能说一下么？在集群模式下，Redis 的 key 是如何寻址的？分布式寻址都有哪些算法？了解一致性 hash 算法吗？如何动态增加和删除一个节点？](/docs/high-concurrency/redis-cluster.md)\n-   [了解什么是 Redis 的雪崩、穿透和击穿？Redis 崩溃之后会怎么样？系统该如何应对这种情况？如何处理 Redis 的穿透？](/docs/high-concurrency/redis-caching-avalanche-and-caching-penetration.md)\n-   [如何保证缓存与数据库的双写一致性？](/docs/high-concurrency/redis-consistence.md)\n-   [Redis 的并发竞争问题是什么？如何解决这个问题？了解 Redis 事务的 CAS 方案吗？](/docs/high-concurrency/redis-cas.md)\n-   [生产环境中的 Redis 是怎么部署的？](/docs/high-concurrency/redis-production-environment.md)\n-   [有了解过 Redis rehash 的过程吗？](/docs/high-concurrency/redis-rehash.md)\n\n### 分库分表\n\n-   [为什么要分库分表（设计高并发系统的时候，数据库层面该如何设计）？用过哪些分库分表中间件？不同的分库分表中间件都有什么优点和缺点？你们具体是如何对数据库如何进行垂直拆分或水平拆分的？](/docs/high-concurrency/database-shard.md)\n-   [现在有一个未分库分表的系统，未来要分库分表，如何设计才可以让系统从未分库分表动态切换到分库分表上？](/docs/high-concurrency/database-shard-method.md)\n-   [如何设计可以动态扩容缩容的分库分表方案？](/docs/high-concurrency/database-shard-dynamic-expand.md)\n-   [分库分表之后，id 主键如何处理？](/docs/high-concurrency/database-shard-global-id-generate.md)\n\n### 读写分离\n\n-   [如何实现 MySQL 的读写分离？MySQL 主从复制原理是啥？如何解决 MySQL 主从同步的延时问题？](/docs/high-concurrency/mysql-read-write-separation.md)\n\n### 高并发系统\n\n-   [如何设计一个高并发系统？](/docs/high-concurrency/high-concurrency-design.md)\n\n## 分布式系统\n\n### [面试连环炮](/docs/distributed-system/distributed-system-interview.md)\n\n### 系统拆分\n\n-   [为什么要进行系统拆分？如何进行系统拆分？拆分后不用 Dubbo 可以吗？](/docs/distributed-system/why-dubbo.md)\n\n### 分布式服务框架\n\n-   [说一下 Dubbo 的工作原理？注册中心挂了可以继续通信吗？](/docs/distributed-system/dubbo-operating-principle.md)\n-   [Dubbo 支持哪些序列化协议？说一下 Hessian 的数据结构？PB 知道吗？为什么 PB 的效率是最高的？](/docs/distributed-system/dubbo-serialization-protocol.md)\n-   [Dubbo 负载均衡策略和集群容错策略都有哪些？动态代理策略呢？](/docs/distributed-system/dubbo-load-balancing.md)\n-   [Dubbo 的 spi 思想是什么？](/docs/distributed-system/dubbo-spi.md)\n-   [如何基于 Dubbo 进行服务治理、服务降级、失败重试以及超时重试？](/docs/distributed-system/dubbo-service-management.md)\n-   [分布式服务接口的幂等性如何设计（比如不能重复扣款）？](/docs/distributed-system/distributed-system-idempotency.md)\n-   [分布式服务接口请求的顺序性如何保证？](/docs/distributed-system/distributed-system-request-sequence.md)\n-   [如何自己设计一个类似 Dubbo 的 RPC 框架？](/docs/distributed-system/dubbo-rpc-design.md)\n-   [CAP 定理的 P 是什么？](/docs/distributed-system/distributed-system-cap.md)\n\n### 分布式锁\n\n-   [Zookeeper 都有哪些应用场景？](/docs/distributed-system/zookeeper-application-scenarios.md)\n-   [使用 Redis 如何设计分布式锁？使用 Zookeeper 来设计分布式锁可以吗？以上两种分布式锁的实现方式哪种效率比较高？](/docs/distributed-system/distributed-lock-redis-vs-zookeeper.md)\n\n### 分布式事务\n\n-   [分布式事务了解吗？你们如何解决分布式事务问题的？TCC 如果出现网络连不通怎么办？XA 的一致性如何保证？](/docs/distributed-system/distributed-transaction.md)\n\n### 分布式会话\n\n-   [集群部署时的分布式 Session 如何实现？](/docs/distributed-system/distributed-session.md)\n\n## 高可用架构\n\n-   [Hystrix 介绍](/docs/high-availability/hystrix-introduction.md)\n-   [电商网站详情页系统架构](/docs/high-availability/e-commerce-website-detail-page-architecture.md)\n-   [Hystrix 线程池技术实现资源隔离](/docs/high-availability/hystrix-thread-pool-isolation.md)\n-   [Hystrix 信号量机制实现资源隔离](/docs/high-availability/hystrix-semphore-isolation.md)\n-   [Hystrix 隔离策略细粒度控制](/docs/high-availability/hystrix-execution-isolation.md)\n-   [深入 Hystrix 执行时内部原理](/docs/high-availability/hystrix-process.md)\n-   [基于 request cache 请求缓存技术优化批量商品数据查询接口](/docs/high-availability/hystrix-request-cache.md)\n-   [基于本地缓存的 fallback 降级机制](/docs/high-availability/hystrix-fallback.md)\n-   [深入 Hystrix 断路器执行原理](/docs/high-availability/hystrix-circuit-breaker.md)\n-   [深入 Hystrix 线程池隔离与接口限流](/docs/high-availability/hystrix-thread-pool-current-limiting.md)\n-   [基于 timeout 机制为服务接口调用超时提供安全保护](/docs/high-availability/hystrix-timeout.md)\n\n### 高可用系统\n\n-   如何设计一个高可用系统？\n\n### 限流\n\n-   [如何限流？在工作中是怎么做的？说一下具体的实现？](/docs/high-concurrency/how-to-limit-current.md)\n\n### 熔断\n\n-   如何进行熔断？\n-   熔断框架都有哪些？具体实现原理知道吗？\n-   [熔断框架如何做技术选型？选用 Sentinel 还是 Hystrix？](/docs/high-availability/sentinel-vs-hystrix.md)\n\n### 降级\n\n-   如何进行降级？\n\n## 微服务架构\n\n-   [微服务架构整个章节内容属额外新增，后续抽空更新，也欢迎读者们参与补充完善](https://github.com/doocs/advanced-java)\n-   [关于微服务架构的描述](/docs/micro-services/microservices-introduction.md)\n-   [从单体式架构迁移到微服务架构](/docs/micro-services/migrating-from-a-monolithic-architecture-to-a-microservices-architecture.md)\n-   [微服务的事件驱动数据管理](/docs/micro-services/event-driven-data-management-for-microservices.md)\n-   [选择微服务部署策略](/docs/micro-services/choose-microservice-deployment-strategy.md)\n-   [微服务架构的优势与不足](/docs/micro-services/advantages-and-disadvantages-of-microservice.md)\n\n### Spring Cloud 微服务架构\n\n-   [什么是微服务？微服务之间是如何独立通讯的？](/docs/micro-services/what's-microservice-how-to-communicate.md)\n-   Spring Cloud 和 Dubbo 有哪些区别？\n-   Spring Boot 和 Spring Cloud，谈谈你对它们的理解？\n-   什么是服务熔断？什么是服务降级？\n-   微服务的优缺点分别是什么？说一下你在项目开发中碰到的坑？\n-   [你所知道的微服务技术栈都有哪些？](/docs/micro-services/micro-services-technology-stack.md)\n-   [微服务治理策略](/docs/micro-services/micro-service-governance.md)\n-   Eureka 和 Zookeeper 都可以提供服务注册与发现的功能，它们有什么区别？\n-   [谈谈服务发现组件 Eureka 的主要调用过程？](/docs/micro-services/how-eureka-enable-service-discovery-and-service-registration.md)\n-   ......\n\n## 海量数据处理\n\n-   [如何从大量的 URL 中找出相同的 URL？](/docs/big-data/find-common-urls.md)\n-   [如何从大量数据中找出高频词？](/docs/big-data/find-top-100-words.md)\n-   [如何找出某一天访问百度网站最多的 IP？](/docs/big-data/find-top-1-ip.md)\n-   [如何在大量的数据中找出不重复的整数？](/docs/big-data/find-no-repeat-number.md)\n-   [如何在大量的数据中判断一个数是否存在？](/docs/big-data/find-a-number-if-exists.md)\n-   [如何查询最热门的查询串？](/docs/big-data/find-hotest-query-string.md)\n-   [如何统计不同电话号码的个数？](/docs/big-data/count-different-phone-numbers.md)\n-   [如何从 5 亿个数中找出中位数？](/docs/big-data/find-mid-value-in-500-millions.md)\n-   [如何按照 query 的频度排序？](/docs/big-data/sort-the-query-strings-by-counts.md)\n-   [如何找出排名前 500 的数？](/docs/big-data/find-rank-top-500-numbers.md)\n-   [讲讲大数据中 TopK 问题的常用套路？](/docs/big-data/topk-problems-and-solutions.md)\n\n## Stars 趋势\n\n\u003ca href=\"https://github.com/doocs/advanced-java/stargazers\" target=\"_blank\"\u003e\u003cimg src=\"./images/starcharts.svg\" alt=\"Stargazers over time\" /\u003e\u003c/a\u003e\n\n注：本趋势图由 [actions-starcharts](https://github.com/MaoLongLong/actions-starcharts) 自动定时刷新，作者 [@MaoLongLong](https://github.com/maolonglong)\n\n---\n\n## Doocs 社区优质项目\n\nDoocs 技术社区，致力于打造一个内容完整、持续成长的互联网开发者学习生态圈！以下是 Doocs 旗下的一些优秀项目，欢迎各位开发者朋友持续保持关注。\n\n| #   | 项目                                                              | 描述                                                                                             | 热度                                                                                                                            |\n| --- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |\n| 1   | [advanced-java](https://github.com/doocs/advanced-java)           | 互联网 Java 工程师进阶知识完全扫盲：涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识。 | ![](https://badgen.net/github/stars/doocs/advanced-java) \u003cbr\u003e![](https://badgen.net/github/forks/doocs/advanced-java)           |\n| 2   | [leetcode](https://github.com/doocs/leetcode)                     | 多种编程语言实现 LeetCode、《剑指 Offer（第 2 版）》、《程序员面试金典（第 6 版）》题解。        | ![](https://badgen.net/github/stars/doocs/leetcode) \u003cbr\u003e![](https://badgen.net/github/forks/doocs/leetcode)                     |\n| 3   | [source-code-hunter](https://github.com/doocs/source-code-hunter) | 互联网常用组件框架源码分析。                                                                     | ![](https://badgen.net/github/stars/doocs/source-code-hunter) \u003cbr\u003e![](https://badgen.net/github/forks/doocs/source-code-hunter) |\n| 4   | [jvm](https://github.com/doocs/jvm)                               | Java 虚拟机底层原理知识总结。                                                                    | ![](https://badgen.net/github/stars/doocs/jvm) \u003cbr\u003e![](https://badgen.net/github/forks/doocs/jvm)                               |\n| 5   | [coding-interview](https://github.com/doocs/coding-interview)     | 代码面试题集，包括《剑指 Offer》、《编程之美》等。                                               | ![](https://badgen.net/github/stars/doocs/coding-interview) \u003cbr\u003e![](https://badgen.net/github/forks/doocs/coding-interview)     |\n| 6   | [md](https://github.com/doocs/md)                                 | 一款高度简洁的微信 Markdown 编辑器。                                                             | ![](https://badgen.net/github/stars/doocs/md) \u003cbr\u003e![](https://badgen.net/github/forks/doocs/md)                                 |\n| 7   | [technical-books](https://github.com/doocs/technical-books)       | 值得一看的技术书籍列表。                                                                         | ![](https://badgen.net/github/stars/doocs/technical-books) \u003cbr\u003e![](https://badgen.net/github/forks/doocs/technical-books)       |\n\n## 贡献者\n\n感谢以下所有朋友对 [Doocs 技术社区](https://github.com/doocs) 所做出的贡献，[参与项目维护请戳这儿](https://doocs.github.io/#/?id=how-to-join)。\n\n\u003c!-- ALL-CONTRIBUTORS-LIST: START - Do not remove or modify this section --\u003e\n\n\u003ca href=\"https://opencollective.com/doocs/contributors.svg?width=890\u0026button=true\"\u003e\u003cimg src=\"https://opencollective.com/doocs/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST: END --\u003e\n\n## 公众号\n\n[Doocs](https://github.com/doocs) 技术社区旗下唯一公众号「**Doocs**」​，欢迎扫码关注，**专注分享技术领域相关知识及行业最新资讯**。当然，也可以加我个人微信（备注：GitHub），拉你进技术交流群。\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" style=\"width: 260px;\"\u003e\n      \u003cimg src=\"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/images/qrcode-for-doocs.png\" style=\"width: 400px;\"\u003e\u003cbr\u003e\n    \u003c/td\u003e\n    \u003ctd align=\"center\" style=\"width: 260px;\"\u003e\n      \u003cimg src=\"https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/images/qrcode-for-yanglbme.png\" style=\"width: 400px;\"\u003e\u003cbr\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n关注「**Doocs**」公众号，回复 **PDF**，即可获取本项目离线 PDF 文档（283 页精华），学习更加方便！\n\n\u003cimg src=\"./images/pdf.png\" style=\"width: 600px;\"\u003e\u003cbr\u003e\n","funding_links":["https://opencollective.com/doocs"],"categories":["HarmonyOS","Java","Blog/Tutorial","Java/Kotlin","Programming Languages :sunglasses:","Java 基础","Tutorial","后端开发框架及项目","编程语言","文档","Uncategorized","Java (504)","后端"],"sub_categories":["Windows Manager","Frequently Used","教程","Java","管理面板","Uncategorized","资源汇总"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoocs%2Fadvanced-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoocs%2Fadvanced-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoocs%2Fadvanced-java/lists"}