[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"site-config":3,"primary-menu":20,"tags-cloud":109,"tagposts-interview-2":293},{"config":4,"socialLinks":19},{"title":5,"subtitle":6,"logoUrl":7,"faviconUrl":8,"footerText":9,"beianIcp":10,"beianPublicSecurity":9,"seoDescription":11,"seoKeywords":12,"homepageTitle":13,"homepageSubtitle":14,"analyticsHeadCode":15,"planetQrcodeUrl":16,"planetIntroHtml":9,"planetCtaText":17,"updatedAt":18},"编码世界","用编码改变世界","https:\u002F\u002Fcdn.mashangan.com\u002Fupload\u002F2026\u002F09\u002F2f277021172f43f6bb34e1c115760b7f.png","https:\u002F\u002Fcdn.mashangan.com\u002Fupload\u002F2026\u002F09\u002Fdcbad022e68c4a729a5dc4997a9bba8a.png","","苏ICP备2026073884号","编码世界（mashangan.com）是面向 Java 后端与 Go 语言的系统化编程教程站：提供\nMyBatis Plus、Lombok、Java 8、IDEA、Docker 等原创图文教程，以及 JVM、并发、\nSpring、MySQL、Redis、消息队列、计算机网络等大厂面试八股题库，另有可落地的\n项目实战系列，帮你从入门到精通。","编码世界,Java教程,Go语言教程,Docker教程,MyBatis Plus教程,Lombok教程, Java 8新特性,IDEA教程,Java面试题,八股文,JVM面试题,Java并发面试题, MySQL面试题,Redis面试题,Spring面试题,消息队列面试题,高并发,分库分表, Netty面试题,计算机网络面试题,AI Agent,RAG,程序员学习路线","Java全栈系统化编程教程","覆盖 MyBatis Plus、Lombok、Java 8、IDEA、Go、Docker 等原创图文教程，配套大厂面试八股题库，从入门到精通，持续更新","\u003Cscript>\nvar _hmt = _hmt || [];\n(function() {\n  var hm = document.createElement(\"script\");\n  hm.src = \"https:\u002F\u002Fhm.baidu.com\u002Fhm.js?f00af7e56d956c02e11efed4131379b0\";\n  var s = document.getElementsByTagName(\"script\")[0]; \n  s.parentNode.insertBefore(hm, s);\n})();\n\u003C\u002Fscript>\n","https:\u002F\u002Fcdn.mashangan.com\u002Fupload\u002F2026\u002F09\u002Fc1a8f5de46584d3eb0bc762c180a5db9.png","扫码加入知识星球","2026-10-05T13:09:51.904487Z",[],{"metadata":21,"spec":24,"menuItems":35},{"name":22,"creationTimestamp":23},"primary","2026-09-12T06:13:55.024154Z",{"displayName":25,"menuItems":26},"主菜单",[27,28,29,30,31,32,33,34],"88c3f10b-321c-4092-86a8-70db00251b74","menu-item-izrtmxer","c4c814d1-0c2c-456b-8c96-4864965fee94","menu-item-tags","menu-item-column","menu-item-tools","menu-item-zsxq","menu-item-ocrxlczu",[36,45,55,64,73,82,91,100],{"displayName":37,"metadata":38,"spec":40,"status":43,"children":44},"首页",{"name":27,"creationTimestamp":39},"2026-09-12T06:13:54.422830Z",{"displayName":37,"href":41,"priority":42,"menuName":22},"\u002F",0,{"displayName":37,"href":41},[],{"displayName":46,"metadata":47,"spec":49,"status":53,"children":54},"Java面试八股",{"name":28,"creationTimestamp":48},"2026-09-13T09:42:02.854891Z",{"displayName":46,"href":50,"target":51,"priority":52,"menuName":22},"\u002Fjava-interview","_self",1,{"displayName":46,"href":50},[],{"displayName":56,"metadata":57,"spec":59,"status":62,"children":63},"文章",{"name":29,"creationTimestamp":58},"2026-09-12T06:13:54.457307Z",{"displayName":56,"href":60,"priority":61,"menuName":22},"\u002Farchives",2,{"displayName":56,"href":60},[],{"displayName":65,"metadata":66,"spec":68,"status":71,"children":72},"标签",{"name":30,"creationTimestamp":67},"2026-10-07T00:42:42.754151Z",{"displayName":65,"href":69,"priority":70,"menuName":22},"\u002Ftags",3,{"displayName":65,"href":69},[],{"displayName":74,"metadata":75,"spec":77,"status":80,"children":81},"项目实战",{"name":31,"creationTimestamp":76},"2026-09-14T00:35:08.138170Z",{"displayName":74,"href":78,"target":51,"priority":79,"menuName":22},"\u002Fcolumn",4,{"displayName":74,"href":78},[],{"displayName":83,"metadata":84,"spec":86,"status":89,"children":90},"在线工具",{"name":32,"creationTimestamp":85},"2026-09-14T00:35:08.171474Z",{"displayName":83,"href":87,"target":51,"priority":88,"menuName":22},"\u002Ftools",5,{"displayName":83,"href":87},[],{"displayName":92,"metadata":93,"spec":95,"status":98,"children":99},"知识星球",{"name":33,"creationTimestamp":94},"2026-09-14T00:35:08.199145Z",{"displayName":92,"href":96,"target":51,"priority":97,"menuName":22},"\u002Fzsxq",6,{"displayName":92,"href":96},[],{"displayName":101,"metadata":102,"spec":104,"status":107,"children":108},"特价云服务",{"name":34,"creationTimestamp":103},"2026-09-25T15:30:59.201614Z",{"displayName":101,"href":105,"target":51,"priority":106,"menuName":22},"\u002Fserver",7,{"displayName":101,"href":105},[],[110,117,124,131,138,145,152,159,166,172,178,184,191,197,203,209,215,221,227,233,239,245,251,257,263,269,275,281,287],{"metadata":111,"spec":113,"postCount":116},{"name":112},"tag-04980744",{"displayName":114,"slug":115},"面试题","interview",118,{"metadata":118,"spec":120,"postCount":123},{"name":119},"tag-93f725a0",{"displayName":121,"slug":122},"Java","java",68,{"metadata":125,"spec":127,"postCount":130},{"name":126},"tag-05b6053c",{"displayName":128,"slug":129},"Docker","docker",43,{"metadata":132,"spec":134,"postCount":137},{"name":133},"tag-1cba77c3",{"displayName":135,"slug":136},"IDEA","idea",32,{"metadata":139,"spec":141,"postCount":144},{"name":140},"tag-116a0109",{"displayName":142,"slug":143},"数字孪生","digital-twin",19,{"metadata":146,"spec":148,"postCount":151},{"name":147},"tag-a2fb95ac",{"displayName":149,"slug":150},"MyBatis Plus","mybatis-plus",18,{"metadata":153,"spec":155,"postCount":158},{"name":154},"tag-cc6220f9",{"displayName":156,"slug":157},"Lombok","lombok",15,{"metadata":160,"spec":162,"postCount":165},{"name":161},"tag-2a2d595e",{"displayName":163,"slug":164},"Spring","spring",10,{"metadata":167,"spec":169,"postCount":165},{"name":168},"tag-1d8a4975",{"displayName":170,"slug":171},"消息队列","mq",{"metadata":173,"spec":175,"postCount":165},{"name":174},"tag-17245299",{"displayName":176,"slug":177},"并发","concurrency",{"metadata":179,"spec":181,"postCount":165},{"name":180},"tag-4921c0e2",{"displayName":182,"slug":183},"AI","ai",{"metadata":185,"spec":187,"postCount":190},{"name":186},"tag-53bb7900",{"displayName":188,"slug":189},"卫星仿真","satellite",9,{"metadata":192,"spec":194,"postCount":88},{"name":193},"tag-62377bcf",{"displayName":195,"slug":196},"Spring Cloud","spring-cloud",{"metadata":198,"spec":200,"postCount":88},{"name":199},"tag-81c3b080",{"displayName":201,"slug":202},"MySQL","mysql",{"metadata":204,"spec":206,"postCount":88},{"name":205},"tag-86a1b907",{"displayName":207,"slug":208},"Redis","redis",{"metadata":210,"spec":212,"postCount":88},{"name":211},"tag-18897dcf",{"displayName":213,"slug":214},"Elasticsearch","elasticsearch",{"metadata":216,"spec":218,"postCount":88},{"name":217},"tag-6ce80d8e",{"displayName":219,"slug":220},"JVM","jvm",{"metadata":222,"spec":224,"postCount":88},{"name":223},"tag-aa4e1b8c",{"displayName":225,"slug":226},"Dubbo","dubbo",{"metadata":228,"spec":230,"postCount":88},{"name":229},"tag-9e30c249",{"displayName":231,"slug":232},"Netty","netty",{"metadata":234,"spec":236,"postCount":88},{"name":235},"tag-2199ace5",{"displayName":237,"slug":238},"ZooKeeper","zookeeper",{"metadata":240,"spec":242,"postCount":88},{"name":241},"tag-7c298a76",{"displayName":243,"slug":244},"设计模式","design-pattern",{"metadata":246,"spec":248,"postCount":88},{"name":247},"tag-6cf6cea9",{"displayName":249,"slug":250},"高可用","high-availability",{"metadata":252,"spec":254,"postCount":88},{"name":253},"tag-918786ab",{"displayName":255,"slug":256},"分库分表","sharding",{"metadata":258,"spec":260,"postCount":88},{"name":259},"tag-91e02cd2",{"displayName":261,"slug":262},"计算机网络","network",{"metadata":264,"spec":266,"postCount":88},{"name":265},"tag-dd302f94",{"displayName":267,"slug":268},"操作系统","os",{"metadata":270,"spec":272,"postCount":88},{"name":271},"tag-1b359d87",{"displayName":273,"slug":274},"Tomcat","tomcat",{"metadata":276,"spec":278,"postCount":79},{"name":277},"tag-f0d71b77",{"displayName":279,"slug":280},"MyBatis","mybatis",{"metadata":282,"spec":284,"postCount":52},{"name":283},"tag-a118a308",{"displayName":285,"slug":286},"时序数据库","tsdb",{"metadata":288,"spec":290,"postCount":42},{"name":289},"tag-34d1f91f",{"displayName":291,"slug":292},"Go","go",{"page":61,"size":294,"total":116,"items":295,"first":309,"last":309,"hasNext":304,"hasPrevious":304,"totalPages":97},20,[296,336,365,394,423,452,486,515,544,573,602,636,665,694,723,752,786,815,844,873],{"metadata":297,"spec":300,"status":311,"categories":316,"tags":329},{"name":298,"creationTimestamp":299},"post-hc-seckill-a6b50dfa","2026-09-13T10:01:14.438458Z",{"title":301,"slug":302,"cover":9,"excerpt":303,"publishTime":305,"categories":306,"tags":308,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"秒杀系统如何设计？","hc-seckill",{"raw":9,"autoGenerate":304},true,"2026-09-13T10:01:14.624258Z",[307],"high-concurrency",[112,174],false,"PUBLIC",{"permalink":312,"excerpt":313,"lastModifyTime":314,"phase":315},"\u002Farchives\u002Fhc-seckill","一、挑战 高并发、库存有限、防超卖、防刷。 二、优化手段 1. 前端 按钮置灰，防止重复提交。 答题\u002F验证码防机器人。 2. 网关层 限流（用户维度、IP 维度）。 静态资源 CDN。 3. 应用层 Redis 预减库存，判断是否还有库存。 异步下单：请求写 MQ，消费者处理订单。 本地缓存挡热点商","2026-09-16T09:16:40.701998Z","PUBLISHED",[317],{"metadata":318,"spec":323,"status":327,"postCount":88},{"name":307,"creationTimestamp":319,"labels":320,"annotations":321},"2026-09-13T09:13:26.047027Z",{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},"updating",{"displayName":324,"slug":307,"cover":9,"description":325,"priority":326,"hideFromList":309,"preventParentPostCascadeQuery":309},"高并发面试题","高并发场景面试题：线程模型、锁优化、无锁化设计、缓存异步化与吞吐量提升实战。",30,{"permalink":328,"postCount":88,"visiblePostCount":88},"\u002Fcategories\u002Fhigh-concurrency",[330,333],{"metadata":331,"spec":332},{"name":112},{"displayName":114,"slug":115},{"metadata":334,"spec":335},{"name":174},{"displayName":176,"slug":177},{"metadata":337,"spec":340,"status":347,"categories":351,"tags":358},{"name":338,"creationTimestamp":339},"post-hc-degrade-2891db76","2026-09-13T10:01:14.271595Z",{"title":341,"slug":342,"cover":9,"excerpt":343,"publishTime":344,"categories":345,"tags":346,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"服务降级和熔断的区别？","hc-degrade",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:14.323663Z",[307],[112,174],{"permalink":348,"excerpt":349,"lastModifyTime":350,"phase":315},"\u002Farchives\u002Fhc-degrade","一、降级（Degrade） 主动关闭非核心功能，保证核心功能可用。 如大促时关闭评论、推荐，保交易。 是一种策略，通常按预设规则触发。 二、熔断（Circuit Breaker） 下游服务故障时，上游不再调用，直接返回降级结果。 类似电路保险丝，防止故障蔓延。 基于错误率、响应时间等指标自动触发。 ","2026-09-16T09:16:39.827390Z",[352],{"metadata":353,"spec":356,"status":357,"postCount":88},{"name":307,"creationTimestamp":319,"labels":354,"annotations":355},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":324,"slug":307,"cover":9,"description":325,"priority":326,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":328,"postCount":88,"visiblePostCount":88},[359,362],{"metadata":360,"spec":361},{"name":112},{"displayName":114,"slug":115},{"metadata":363,"spec":364},{"name":174},{"displayName":176,"slug":177},{"metadata":366,"spec":369,"status":376,"categories":380,"tags":387},{"name":367,"creationTimestamp":368},"post-hc-current-limit-1b6bf9d1","2026-09-13T10:01:14.087902Z",{"title":370,"slug":371,"cover":9,"excerpt":372,"publishTime":373,"categories":374,"tags":375,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"常见的限流算法？","hc-current-limit",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:14.146105Z",[307],[112,174],{"permalink":377,"excerpt":378,"lastModifyTime":379,"phase":315},"\u002Farchives\u002Fhc-current-limit","一、固定窗口 把时间分成固定窗口，窗口内计数，超过阈值限流。 - 优点：简单。 - 缺点：窗口边界可能突刺（如窗口末尾和下一个窗口开头各来一半，合起来超限）。 二、滑动窗口 把窗口分成多个小格子，随时间滑动，统计格子总数。 - 解决固定窗口的边界问题。 - 实现稍复杂。 三、漏桶算法 请求进桶，桶以","2026-09-16T09:16:40.266278Z",[381],{"metadata":382,"spec":385,"status":386,"postCount":88},{"name":307,"creationTimestamp":319,"labels":383,"annotations":384},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":324,"slug":307,"cover":9,"description":325,"priority":326,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":328,"postCount":88,"visiblePostCount":88},[388,391],{"metadata":389,"spec":390},{"name":112},{"displayName":114,"slug":115},{"metadata":392,"spec":393},{"name":174},{"displayName":176,"slug":177},{"metadata":395,"spec":398,"status":405,"categories":409,"tags":416},{"name":396,"creationTimestamp":397},"post-hc-cache-strategy-fbfb1ec0","2026-09-13T10:01:13.884052Z",{"title":399,"slug":400,"cover":9,"excerpt":401,"publishTime":402,"categories":403,"tags":404,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"高并发下的缓存策略？","hc-cache-strategy",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:13.929859Z",[307],[112,174],{"permalink":406,"excerpt":407,"lastModifyTime":408,"phase":315},"\u002Farchives\u002Fhc-cache-strategy","一、缓存层级 L1：浏览器缓存。 L2：CDN 缓存。 L3：Nginx\u002F网关缓存。 L4：应用本地缓存（Caffeine、Guava）。 L5：分布式缓存（Redis）。 L6：数据库。 二、缓存更新策略 Cache Aside：应用先查缓存，没有查数据库，写入缓存。删除缓存（不是更新）。最常用。","2026-09-16T09:16:38.657076Z",[410],{"metadata":411,"spec":414,"status":415,"postCount":88},{"name":307,"creationTimestamp":319,"labels":412,"annotations":413},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":324,"slug":307,"cover":9,"description":325,"priority":326,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":328,"postCount":88,"visiblePostCount":88},[417,420],{"metadata":418,"spec":419},{"name":112},{"displayName":114,"slug":115},{"metadata":421,"spec":422},{"name":174},{"displayName":176,"slug":177},{"metadata":424,"spec":427,"status":434,"categories":438,"tags":445},{"name":425,"creationTimestamp":426},"post-hc-optimize-58adf088","2026-09-13T10:01:13.708765Z",{"title":428,"slug":429,"cover":9,"excerpt":430,"publishTime":431,"categories":432,"tags":433,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"高并发系统的优化手段有哪些？","hc-optimize",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:13.755494Z",[307],[112,174],{"permalink":435,"excerpt":436,"lastModifyTime":437,"phase":315},"\u002Farchives\u002Fhc-optimize","一、前端优化 CDN 加速静态资源。 浏览器缓存、资源合并压缩。 页面懒加载、预加载。 二、网关层 Nginx 负载均衡，动静分离。 限流（令牌桶、漏桶）。 缓存静态页面。 三、应用层 多级缓存：本地缓存（Caffeine）+ 分布式缓存（Redis）。 异步化：消息队列削峰填谷。 线程池调优，合理","2026-09-16T09:16:37.698197Z",[439],{"metadata":440,"spec":443,"status":444,"postCount":88},{"name":307,"creationTimestamp":319,"labels":441,"annotations":442},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":324,"slug":307,"cover":9,"description":325,"priority":326,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":328,"postCount":88,"visiblePostCount":88},[446,449],{"metadata":447,"spec":448},{"name":112},{"displayName":114,"slug":115},{"metadata":450,"spec":451},{"name":174},{"displayName":176,"slug":177},{"metadata":453,"spec":456,"status":463,"categories":467,"tags":479},{"name":454,"creationTimestamp":455},"post-sharding-shardingsphere-9d880c74","2026-09-13T10:01:13.510910Z",{"title":457,"slug":458,"cover":9,"excerpt":459,"publishTime":460,"categories":461,"tags":462,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"ShardingSphere 的核心功能？","sharding-shardingsphere",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:13.565762Z",[256],[253,112],{"permalink":464,"excerpt":465,"lastModifyTime":466,"phase":315},"\u002Farchives\u002Fsharding-shardingsphere","一、定位 ShardingSphere 是分布式数据库中间件，提供分库分表、读写分离、数据加密等能力。 二、三种模式 ShardingSphere-JDBC：嵌入应用，JAR 包方式，性能好但只支持 Java。 ShardingSphere-Proxy：独立部署代理，支持多语言，有网络开销。 Sha","2026-09-16T09:16:37.209427Z",[468],{"metadata":469,"spec":473,"status":477,"postCount":88},{"name":256,"creationTimestamp":470,"labels":471,"annotations":472},"2026-09-13T09:13:26.020943Z",{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":474,"slug":256,"cover":9,"description":475,"priority":476,"hideFromList":309,"preventParentPostCascadeQuery":309},"分库分表面试题","分库分表面试题：分片策略、路由扩容、分布式主键、跨片查询与数据一致性方案。",29,{"permalink":478,"postCount":88,"visiblePostCount":88},"\u002Fcategories\u002Fsharding",[480,483],{"metadata":481,"spec":482},{"name":253},{"displayName":255,"slug":256},{"metadata":484,"spec":485},{"name":112},{"displayName":114,"slug":115},{"metadata":487,"spec":490,"status":497,"categories":501,"tags":508},{"name":488,"creationTimestamp":489},"post-sharding-migration-5d5ab7fd","2026-09-13T10:01:13.348573Z",{"title":491,"slug":492,"cover":9,"excerpt":493,"publishTime":494,"categories":495,"tags":496,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"分库分表扩容如何平滑迁移？","sharding-migration",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:13.392795Z",[256],[112,253],{"permalink":498,"excerpt":499,"lastModifyTime":500,"phase":315},"\u002Farchives\u002Fsharding-migration","一、取模扩容问题 user_id % 4 改为 % 8，大部分数据需要迁移。 二、方案一：停机迁移 停机，写脚本把数据按新规则重新分配。 简单但有停机时间。 三、方案二：双写 + 迁移 新数据同时写旧分片和新分片。 后台把旧数据迁移到新分片。 校验一致后，切读到新分片。 停写旧分片。 - 不停机但复","2026-09-16T09:16:38.181057Z",[502],{"metadata":503,"spec":506,"status":507,"postCount":88},{"name":256,"creationTimestamp":470,"labels":504,"annotations":505},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":474,"slug":256,"cover":9,"description":475,"priority":476,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":478,"postCount":88,"visiblePostCount":88},[509,512],{"metadata":510,"spec":511},{"name":112},{"displayName":114,"slug":115},{"metadata":513,"spec":514},{"name":253},{"displayName":255,"slug":256},{"metadata":516,"spec":519,"status":526,"categories":530,"tags":537},{"name":517,"creationTimestamp":518},"post-sharding-id-gen-2d3d5a55","2026-09-13T10:01:13.134819Z",{"title":520,"slug":521,"cover":9,"excerpt":522,"publishTime":523,"categories":524,"tags":525,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"分布式 ID 生成方案有哪些？","sharding-id-gen",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:13.220993Z",[256],[253,112],{"permalink":527,"excerpt":528,"lastModifyTime":529,"phase":315},"\u002Farchives\u002Fsharding-id-gen","一、UUID 优点：本地生成，无网络开销，唯一。 缺点：无序，索引效率低；太长。 二、数据库自增 优点：简单，有序。 缺点：单库瓶颈；分库后不全局唯一。 三、号段模式 从数据库批量获取 ID 段（如 1-1000），在内存中使用。 优点：性能高，减少数据库压力。 缺点：服务重启可能断号。 四、Sno","2026-09-16T09:16:35.488658Z",[531],{"metadata":532,"spec":535,"status":536,"postCount":88},{"name":256,"creationTimestamp":470,"labels":533,"annotations":534},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":474,"slug":256,"cover":9,"description":475,"priority":476,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":478,"postCount":88,"visiblePostCount":88},[538,541],{"metadata":539,"spec":540},{"name":253},{"displayName":255,"slug":256},{"metadata":542,"spec":543},{"name":112},{"displayName":114,"slug":115},{"metadata":545,"spec":548,"status":555,"categories":559,"tags":566},{"name":546,"creationTimestamp":547},"post-sharding-key-7d06fbdb","2026-09-13T10:01:12.933408Z",{"title":549,"slug":550,"cover":9,"excerpt":551,"publishTime":552,"categories":553,"tags":554,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"如何选择分片键？","sharding-key",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:12.988421Z",[256],[112,253],{"permalink":556,"excerpt":557,"lastModifyTime":558,"phase":315},"\u002Farchives\u002Fsharding-key","一、选择原则 查询频率高：最常用的查询条件字段，如 user_id、order_id。 分布均匀：避免数据倾斜，如不要用性别（只有两个值）。 业务关联：关联表用相同分片键，减少跨库 join。 不可变：分片键值一旦确定不能改。 二、常见分片键 用户 ID：用户相关数据，如订单按 user_id 分片","2026-09-16T09:16:36.607917Z",[560],{"metadata":561,"spec":564,"status":565,"postCount":88},{"name":256,"creationTimestamp":470,"labels":562,"annotations":563},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":474,"slug":256,"cover":9,"description":475,"priority":476,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":478,"postCount":88,"visiblePostCount":88},[567,570],{"metadata":568,"spec":569},{"name":112},{"displayName":114,"slug":115},{"metadata":571,"spec":572},{"name":253},{"displayName":255,"slug":256},{"metadata":574,"spec":577,"status":584,"categories":588,"tags":595},{"name":575,"creationTimestamp":576},"post-sharding-strategy-f725fb51","2026-09-13T10:01:12.754097Z",{"title":578,"slug":579,"cover":9,"excerpt":580,"publishTime":581,"categories":582,"tags":583,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"分库分表有哪些策略？","sharding-strategy",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:12.803252Z",[256],[112,253],{"permalink":585,"excerpt":586,"lastModifyTime":587,"phase":315},"\u002Farchives\u002Fsharding-strategy","一、垂直拆分 垂直分库：按业务拆分库，如用户库、订单库、商品库。 垂直分表：按字段拆分表，如主表存常用字段，扩展表存大字段。 解决：单库压力、单表字段过多。 二、水平拆分 水平分库：同一张表数据按规则分到多个库。 水平分表：同一张表数据按规则分到多张表。 解决：单表数据量过大。 三、分片规则 范围：","2026-09-16T09:16:35.972485Z",[589],{"metadata":590,"spec":593,"status":594,"postCount":88},{"name":256,"creationTimestamp":470,"labels":591,"annotations":592},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":474,"slug":256,"cover":9,"description":475,"priority":476,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":478,"postCount":88,"visiblePostCount":88},[596,599],{"metadata":597,"spec":598},{"name":112},{"displayName":114,"slug":115},{"metadata":600,"spec":601},{"name":253},{"displayName":255,"slug":256},{"metadata":603,"spec":606,"status":613,"categories":617,"tags":629},{"name":604,"creationTimestamp":605},"post-netty-heartbeat-12b221d2","2026-09-13T10:01:12.589477Z",{"title":607,"slug":608,"cover":9,"excerpt":609,"publishTime":610,"categories":611,"tags":612,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Netty 如何实现心跳检测？","netty-heartbeat",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:12.638155Z",[232],[229,112],{"permalink":614,"excerpt":615,"lastModifyTime":616,"phase":315},"\u002Farchives\u002Fnetty-heartbeat","一、IdleStateHandler Netty 提供 IdleStateHandler 检测空闲状态。 ch.pipeline().addLast(new IdleStateHandler(5, 0, 0, TimeUnit.SECONDS));\n 三个参数：读空闲时间、写空闲时间、所有空闲时间。","2026-09-16T09:16:11.001714Z",[618],{"metadata":619,"spec":623,"status":627,"postCount":88},{"name":232,"creationTimestamp":620,"labels":621,"annotations":622},"2026-09-13T09:13:25.996566Z",{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":624,"slug":232,"cover":9,"description":625,"priority":626,"hideFromList":309,"preventParentPostCascadeQuery":309},"Netty 面试题","Netty 面试题：Reactor 线程模型、ByteBuf、零拷贝、编解码与常见内存泄漏排查。",28,{"permalink":628,"postCount":88,"visiblePostCount":88},"\u002Fcategories\u002Fnetty",[630,633],{"metadata":631,"spec":632},{"name":229},{"displayName":231,"slug":232},{"metadata":634,"spec":635},{"name":112},{"displayName":114,"slug":115},{"metadata":637,"spec":640,"status":647,"categories":651,"tags":658},{"name":638,"creationTimestamp":639},"post-netty-sticky-packet-db78caff","2026-09-13T10:01:12.394145Z",{"title":641,"slug":642,"cover":9,"excerpt":643,"publishTime":644,"categories":645,"tags":646,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Netty 如何解决粘包拆包？","netty-sticky-packet",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:12.445874Z",[232],[229,112],{"permalink":648,"excerpt":649,"lastModifyTime":650,"phase":315},"\u002Farchives\u002Fnetty-sticky-packet","一、问题 TCP 是字节流，没有消息边界，多个请求可能粘在一起（粘包），一个请求可能被拆分（拆包）。 二、解决方案 固定长度：FixedLengthFrameDecoder，每条消息固定长度。 特殊分隔符：DelimiterBasedFrameDecoder，按换行符等分隔。 长度字段：Length","2026-09-16T09:16:10.566524Z",[652],{"metadata":653,"spec":656,"status":657,"postCount":88},{"name":232,"creationTimestamp":620,"labels":654,"annotations":655},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":624,"slug":232,"cover":9,"description":625,"priority":626,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":628,"postCount":88,"visiblePostCount":88},[659,662],{"metadata":660,"spec":661},{"name":229},{"displayName":231,"slug":232},{"metadata":663,"spec":664},{"name":112},{"displayName":114,"slug":115},{"metadata":666,"spec":669,"status":676,"categories":680,"tags":687},{"name":667,"creationTimestamp":668},"post-netty-bytebuf-9e659725","2026-09-13T10:01:12.219331Z",{"title":670,"slug":671,"cover":9,"excerpt":672,"publishTime":673,"categories":674,"tags":675,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Netty 的 ByteBuf 设计？","netty-bytebuf",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:12.269412Z",[232],[112,229],{"permalink":677,"excerpt":678,"lastModifyTime":679,"phase":315},"\u002Farchives\u002Fnetty-bytebuf","一、与 ByteBuffer 对比 JDK ByteBuffer 只有一个 position，读写切换需 flip()，易出错。 ByteBuf 有 readerIndex 和 writerIndex 两个指针，读写分离，无需 flip。 二、核心方法 readXxx() \u002F writeXxx()：","2026-09-16T09:15:44.072779Z",[681],{"metadata":682,"spec":685,"status":686,"postCount":88},{"name":232,"creationTimestamp":620,"labels":683,"annotations":684},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":624,"slug":232,"cover":9,"description":625,"priority":626,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":628,"postCount":88,"visiblePostCount":88},[688,691],{"metadata":689,"spec":690},{"name":112},{"displayName":114,"slug":115},{"metadata":692,"spec":693},{"name":229},{"displayName":231,"slug":232},{"metadata":695,"spec":698,"status":705,"categories":709,"tags":716},{"name":696,"creationTimestamp":697},"post-netty-pipeline-7fcc13c5","2026-09-13T10:01:12.057563Z",{"title":699,"slug":700,"cover":9,"excerpt":701,"publishTime":702,"categories":703,"tags":704,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Netty 的 ChannelPipeline 机制？","netty-pipeline",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:12.104621Z",[232],[112,229],{"permalink":706,"excerpt":707,"lastModifyTime":708,"phase":315},"\u002Farchives\u002Fnetty-pipeline","一、定义 每个 Channel 有一个 Pipeline，由多个 ChannelHandler 组成，形成责任链。入站和出站事件在 Pipeline 中传播。 二、入站和出站 InboundHandler：处理入站事件（读、连接建立等），从 head 向 tail 传播。 OutboundHandl","2026-09-16T09:16:10.087911Z",[710],{"metadata":711,"spec":714,"status":715,"postCount":88},{"name":232,"creationTimestamp":620,"labels":712,"annotations":713},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":624,"slug":232,"cover":9,"description":625,"priority":626,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":628,"postCount":88,"visiblePostCount":88},[717,720],{"metadata":718,"spec":719},{"name":112},{"displayName":114,"slug":115},{"metadata":721,"spec":722},{"name":229},{"displayName":231,"slug":232},{"metadata":724,"spec":727,"status":734,"categories":738,"tags":745},{"name":725,"creationTimestamp":726},"post-netty-reactor-452c619b","2026-09-13T10:01:11.735905Z",{"title":728,"slug":729,"cover":9,"excerpt":730,"publishTime":731,"categories":732,"tags":733,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Netty 的 Reactor 线程模型？","netty-reactor",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:11.908097Z",[232],[112,229],{"permalink":735,"excerpt":736,"lastModifyTime":737,"phase":315},"\u002Farchives\u002Fnetty-reactor","一、Reactor 模式 基于事件驱动，I\u002FO 多路复用监听多个连接，事件就绪后分发给处理器。 二、Netty 三种模型 单线程 Reactor：一个线程处理所有连接的 accept 和 I\u002FO，简单但不适合高并发。 多线程 Reactor：一个 Acceptor 线程接收连接，I\u002FO 由线程池处理","2026-09-16T09:15:45.558022Z",[739],{"metadata":740,"spec":743,"status":744,"postCount":88},{"name":232,"creationTimestamp":620,"labels":741,"annotations":742},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":624,"slug":232,"cover":9,"description":625,"priority":626,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":628,"postCount":88,"visiblePostCount":88},[746,749],{"metadata":747,"spec":748},{"name":112},{"displayName":114,"slug":115},{"metadata":750,"spec":751},{"name":229},{"displayName":231,"slug":232},{"metadata":753,"spec":756,"status":763,"categories":767,"tags":779},{"name":754,"creationTimestamp":755},"post-dubbo-vs-feign-492bd570","2026-09-13T10:01:11.561540Z",{"title":757,"slug":758,"cover":9,"excerpt":759,"publishTime":760,"categories":761,"tags":762,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Dubbo 和 OpenFeign 的区别？","dubbo-vs-feign",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:11.608721Z",[226],[223,112],{"permalink":764,"excerpt":765,"lastModifyTime":766,"phase":315},"\u002Farchives\u002Fdubbo-vs-feign","一、对比 维度 Dubbo OpenFeign 协议 多协议（dubbo 默认） HTTP 性能 高（二进制协议） 较低（HTTP+JSON） 服务治理 完善（路由、熔断、限流） 需配合 Sentinel 注册中心 必需 必需 语言 Java 为主 跨语言（HTTP） 适用 内部服务调用 内外通用 ","2026-09-16T09:15:44.673817Z",[768],{"metadata":769,"spec":773,"status":777,"postCount":88},{"name":226,"creationTimestamp":770,"labels":771,"annotations":772},"2026-09-13T09:13:25.917842Z",{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":774,"slug":226,"cover":9,"description":775,"priority":776,"hideFromList":309,"preventParentPostCascadeQuery":309},"Dubbo 面试题","Dubbo 面试题：RPC 原理、注册中心、负载均衡、SPI 扩展与服务治理机制。",25,{"permalink":778,"postCount":88,"visiblePostCount":88},"\u002Fcategories\u002Fdubbo",[780,783],{"metadata":781,"spec":782},{"name":223},{"displayName":225,"slug":226},{"metadata":784,"spec":785},{"name":112},{"displayName":114,"slug":115},{"metadata":787,"spec":790,"status":797,"categories":801,"tags":808},{"name":788,"creationTimestamp":789},"post-dubbo-rpc-2946497d","2026-09-13T10:01:11.371736Z",{"title":791,"slug":792,"cover":9,"excerpt":793,"publishTime":794,"categories":795,"tags":796,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Dubbo 的 RPC 调用过程？","dubbo-rpc",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:11.419823Z",[226],[112,223],{"permalink":798,"excerpt":799,"lastModifyTime":800,"phase":315},"\u002Farchives\u002Fdubbo-rpc","一、代理层 Consumer 调用接口方法，实际调用的是代理对象（JDK 动态代理或 Javassist）。 二、路由层 Cluster：集群容错，处理调用失败。 Directory：管理 Provider 列表。 Router：根据路由规则过滤 Provider。 LoadBalance：从 Pr","2026-09-16T09:15:45.125834Z",[802],{"metadata":803,"spec":806,"status":807,"postCount":88},{"name":226,"creationTimestamp":770,"labels":804,"annotations":805},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":774,"slug":226,"cover":9,"description":775,"priority":776,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":778,"postCount":88,"visiblePostCount":88},[809,812],{"metadata":810,"spec":811},{"name":112},{"displayName":114,"slug":115},{"metadata":813,"spec":814},{"name":223},{"displayName":225,"slug":226},{"metadata":816,"spec":819,"status":826,"categories":830,"tags":837},{"name":817,"creationTimestamp":818},"post-dubbo-spi-053de0a7","2026-09-13T10:01:11.161638Z",{"title":820,"slug":821,"cover":9,"excerpt":822,"publishTime":823,"categories":824,"tags":825,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Dubbo 的 SPI 机制？","dubbo-spi",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:11.215283Z",[226],[223,112],{"permalink":827,"excerpt":828,"lastModifyTime":829,"phase":315},"\u002Farchives\u002Fdubbo-spi","一、SPI 定义 Service Provider Interface，服务提供接口。Java 有自带 SPI，Dubbo 对其增强。 二、Dubbo SPI 优势 按需加载，不一次性加载所有实现。 支持自适应扩展（@Adaptive），运行时动态选择实现。 支持自动包装（Wrapper），AOP ","2026-09-16T09:15:41.272158Z",[831],{"metadata":832,"spec":835,"status":836,"postCount":88},{"name":226,"creationTimestamp":770,"labels":833,"annotations":834},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":774,"slug":226,"cover":9,"description":775,"priority":776,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":778,"postCount":88,"visiblePostCount":88},[838,841],{"metadata":839,"spec":840},{"name":223},{"displayName":225,"slug":226},{"metadata":842,"spec":843},{"name":112},{"displayName":114,"slug":115},{"metadata":845,"spec":848,"status":855,"categories":859,"tags":866},{"name":846,"creationTimestamp":847},"post-dubbo-loadbalance-2e6422fe","2026-09-13T10:01:10.977842Z",{"title":849,"slug":850,"cover":9,"excerpt":851,"publishTime":852,"categories":853,"tags":854,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Dubbo 的负载均衡策略？","dubbo-loadbalance",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:11.023987Z",[226],[112,223],{"permalink":856,"excerpt":857,"lastModifyTime":858,"phase":315},"\u002Farchives\u002Fdubbo-loadbalance","一、四种策略 Random（默认）：随机，按权重加权随机。 RoundRobin：轮询，按权重轮询，慢的 Provider 会累积请求。 LeastActive：最少活跃调用，慢的 Provider 收到更少请求。 ConsistentHash：一致性哈希，相同参数请求到同一 Provider。 二","2026-09-16T09:15:42.198255Z",[860],{"metadata":861,"spec":864,"status":865,"postCount":88},{"name":226,"creationTimestamp":770,"labels":862,"annotations":863},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":774,"slug":226,"cover":9,"description":775,"priority":776,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":778,"postCount":88,"visiblePostCount":88},[867,870],{"metadata":868,"spec":869},{"name":112},{"displayName":114,"slug":115},{"metadata":871,"spec":872},{"name":223},{"displayName":225,"slug":226},{"metadata":874,"spec":877,"status":884,"categories":888,"tags":895},{"name":875,"creationTimestamp":876},"post-dubbo-architecture-9ce704df","2026-09-13T10:01:10.788551Z",{"title":878,"slug":879,"cover":9,"excerpt":880,"publishTime":881,"categories":882,"tags":883,"priority":42,"pinned":309,"deleted":309,"visible":310,"allowComment":304},"Dubbo 的整体架构？","dubbo-architecture",{"raw":9,"autoGenerate":304},"2026-09-13T10:01:10.836412Z",[226],[223,112],{"permalink":885,"excerpt":886,"lastModifyTime":887,"phase":315},"\u002Farchives\u002Fdubbo-architecture","一、核心角色 Provider：服务提供者，暴露服务。 Consumer：服务消费者，调用远程服务。 Registry：注册中心，服务注册与发现。 Monitor：监控中心，统计调用次数和耗时。 Container：服务运行容器。 二、调用流程 Provider 启动时向 Registry 注册服务","2026-09-16T09:15:43.605509Z",[889],{"metadata":890,"spec":893,"status":894,"postCount":88},{"name":226,"creationTimestamp":770,"labels":891,"annotations":892},{"haloweb.section":115},{"tutorial.halo.run\u002Fstatus":322},{"displayName":774,"slug":226,"cover":9,"description":775,"priority":776,"hideFromList":309,"preventParentPostCascadeQuery":309},{"permalink":778,"postCount":88,"visiblePostCount":88},[896,899],{"metadata":897,"spec":898},{"name":223},{"displayName":225,"slug":226},{"metadata":900,"spec":901},{"name":112},{"displayName":114,"slug":115}]