{"id":16686291,"url":"https://github.com/oldratlee/reactive-practice-at-taobao","last_synced_at":"2025-04-05T11:13:37.613Z","repository":{"id":38844516,"uuid":"114800828","full_name":"oldratlee/reactive-practice-at-taobao","owner":"oldratlee","description":"♨️ Reactive @ 淘宝 | Reactive实践、推动、落地的记录与大会分享 | Flow Arch(流式架构)/Reactive Programming(RP/反应式编程) ","archived":false,"fork":false,"pushed_at":"2023-08-20T05:47:18.000Z","size":78794,"stargazers_count":476,"open_issues_count":1,"forks_count":89,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-03-29T10:11:27.489Z","etag":null,"topics":["flow","flow-arch","flow-oriented-ha","java","reactive","reactive-programming","rp","rxjava","stability","taobao"],"latest_commit_sha":null,"homepage":"https://github.com/oldratlee/taobao-reactive-practice","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oldratlee.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}},"created_at":"2017-12-19T18:59:00.000Z","updated_at":"2025-02-07T09:59:10.000Z","dependencies_parsed_at":"2023-02-09T20:01:13.875Z","dependency_job_id":null,"html_url":"https://github.com/oldratlee/reactive-practice-at-taobao","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldratlee%2Freactive-practice-at-taobao","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldratlee%2Freactive-practice-at-taobao/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldratlee%2Freactive-practice-at-taobao/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldratlee%2Freactive-practice-at-taobao/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oldratlee","download_url":"https://codeload.github.com/oldratlee/reactive-practice-at-taobao/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325696,"owners_count":20920714,"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":["flow","flow-arch","flow-oriented-ha","java","reactive","reactive-programming","rp","rxjava","stability","taobao"],"created_at":"2024-10-12T15:05:18.551Z","updated_at":"2025-04-05T11:13:35.522Z","avatar_url":"https://github.com/oldratlee.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ♨️ `Flow Arch`(流式架构)/`Reactive Programming`(`RP`/反应式编程) Practice\n\n[![知识共享协议（CC协议）](https://img.shields.io/badge/License-Creative%20Commons-FE6B3A.svg?logo=apache)\n![Licence: CC BY-NC-SA 4.0](https://github.com/oldratlee/reactive-practice-at-taobao/assets/1063891/b3ae3cf2-7ea3-483b-b374-499c7d78afda)](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)  \n[![GitHub stars](https://img.shields.io/github/stars/oldratlee/reactive-practice-at-taobao.svg?style=social\u0026label=Star)](https://github.com/oldratlee/reactive-practice-at-taobao/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/oldratlee/reactive-practice-at-taobao.svg?style=social\u0026label=Fork)](https://github.com/oldratlee/reactive-practice-at-taobao/fork)\n[![GitHub watchers](https://img.shields.io/github/watchers/oldratlee/reactive-practice-at-taobao.svg?style=social\u0026label=Watch)](https://github.com/oldratlee/reactive-practice-at-taobao/watchers)\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"https://github.com/oldratlee/reactive-practice-at-taobao/assets/1063891/94cd17cf-5d25-42b6-bc44-4e2c56ffc1fd\" alt=\"LaLaLoveOnMyMind-AnnWinsborn.jpg\" align=\"right\" width=\"20%\" /\u003e\u003c/a\u003e\n\n\u003e One way ticket and of life to live, pockets full of sunshine, lots of love to give. -- [La La Love On My Mind, Ann Winsborn](http://www.xiami.com/song/mQ37ro8c0de)  \n\u003e 体验生命的单程票，装满阳光口袋可以给你许许多多的爱。 —— [La La Love On My Mind, Ann Winsborn](http://www.xiami.com/song/mQ37ro8c0de)\n\u003e\n\u003e 因为单程（`one-way`）的生命，所以我们才能并需要全力生活。\n\u003e\n\u003e 异步（`async`）的系统，像这首歌一样流畅的节奏停不下来（`non-blocking`）。\n\u003e\n\u003e 点了[链接](http://www.xiami.com/song/mQ37ro8c0de)听听，摇起来～\n\n----------------------------------------------------\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [什么是 `Reactive`/反应式](#%E4%BB%80%E4%B9%88%E6%98%AF-reactive%E5%8F%8D%E5%BA%94%E5%BC%8F)\n- [准备/学习/了解的资料/书籍](#%E5%87%86%E5%A4%87%E5%AD%A6%E4%B9%A0%E4%BA%86%E8%A7%A3%E7%9A%84%E8%B5%84%E6%96%99%E4%B9%A6%E7%B1%8D)\n    - [`Java 8`](#java-8)\n    - [`RxJava`](#rxjava)\n    - [函数式编程](#%E5%87%BD%E6%95%B0%E5%BC%8F%E7%BC%96%E7%A8%8B)\n- [有哪些相关的类/库](#%E6%9C%89%E5%93%AA%E4%BA%9B%E7%9B%B8%E5%85%B3%E7%9A%84%E7%B1%BB%E5%BA%93)\n    - [1. `Java 8`的`Stream`](#1-java-8%E7%9A%84stream)\n    - [2. `ReactiveX`(`Rx`)/`RxJava`](#2-reactivexrxrxjava)\n    - [3. `Reactive Streams`(`RS`)](#3-reactive-streamsrs)\n- [Reactive Streams介绍](#reactive-streams%E4%BB%8B%E7%BB%8D)\n- [在软件大会上自己做的主题分享](#%E5%9C%A8%E8%BD%AF%E4%BB%B6%E5%A4%A7%E4%BC%9A%E4%B8%8A%E8%87%AA%E5%B7%B1%E5%81%9A%E7%9A%84%E4%B8%BB%E9%A2%98%E5%88%86%E4%BA%AB)\n- [相关资料](#%E7%9B%B8%E5%85%B3%E8%B5%84%E6%96%99)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n----------------------------------------------------\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"https://github.com/oldratlee/reactive-practice-at-taobao/assets/1063891/619eed0b-3950-4b8c-9a2c-cf8f756cbb30\" alt=\"reactive-red.png\" vspace=\"10px\" hspace=\"10px\" align=\"right\" width=\"20%\" \u003e\u003c/a\u003e\n\n# 什么是 `Reactive`/反应式\n\n`Reactive`说明了\n\n- 技术系统应用达成的 **期望要求**\n- 架构上的 **思路理念**\n- 技术上的 **核心手段**\n\n即也是`Reactive`本身的定义。具体参见：\n\n- [反应式宣言](https://www.reactivemanifesto.org/zh-CN)\n- 如果中文翻译看有些别扭的话，可以对照着看英文原版：[**_The Reactive Manifesto_**](https://www.reactivemanifesto.org/)。\n\n[![model-reactive-manifesto](https://github.com/oldratlee/reactive-practice-at-taobao/assets/1063891/7c60d55c-503c-4c9f-95e2-ee8fac73e9ca)](##)\n\n# 准备/学习/了解的资料/书籍\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"asserts/java8.jpeg\" height=\"150\" align=\"right\" /\u003e\u003c/a\u003e\n\n全异步化/流式架构 需要 捕捉操作并编排运行（延迟执行）。\n\n- 捕捉操作需要`Java 8 Lambda`语法的支持来精简表达。\n- 编排执行表达了业务逻辑。如何有效表达编排（即业务逻辑）对应了 `FP`上的思路做法。\n    - `OOP` 有效表达了 **业务概念**（模型/数据）\n    - 而`FP` 则有效表达了 **业务逻辑**（流程/转换）\n    - 两者互为补充\n\n## `Java 8`\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"asserts/java8-books.jpg\" height=\"150\" align=\"right\" /\u003e\u003c/a\u003e\n\n- [《Java 8实战》](https://book.douban.com/subject/26772632/)：面向Java 8的技能升级，包括Lambdas、流和函数式编程特性。\n    - 实战系列的一贯风格让自己快速上手应用起来。\n    - `Java 8`支持的`Lambda`是精简表达在语法上提供的支持。\n    - `Java 8`提供了`Stream`，学习和使用可以建立流式编程的认知。\n- [《Java 8函数式编程》](https://book.douban.com/subject/26346017/)\n    - Java 8的函数式用法的入门佳作，非常薄148面，简直不敢相信这么小的篇幅讲了这么多内容。\n    - 第9章讲并发程序编写，只短短10来面就广度了不少内容，  \n        几个关键点及其关联异同的讲解闪烁着思辨的光辉，很是精彩！ 🌈\n\n## `RxJava`\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"asserts/book-LearningRxjava.jpeg\" height=\"150\" align=\"right\" /\u003e\u003c/a\u003e\n\n- [《Learning RxJava: Reactive Programming with Java and ReactiveX》](https://book.douban.com/subject/27094562/) 英文版 2017年6月出版\n    - `RxJava 2`，循序渐进地介绍了使用和整体思路，推荐！\n    - 第一章 **_Thinking Reactively_**，讲了反应式设计和编程上的世界观和理念，推荐赶紧看看先～ 😘\n- [《Reactive Programming in Kotlin: Design and build non-blocking, asynchronous Kotlin applications with RXKotlin, Reactor-Kotlin, Android, and Spring》](https://book.douban.com/subject/27094562/) 英文版 2017年12月出版\n    - 也相当不错。用的是`Kotlin`语言。\n- [《Reactive Programming with RxJava: Creating Asynchronous, Event-Based Applications》](https://book.douban.com/subject/26894199/) 英文版 2016年10月出版\n    - 讲的是`RxJava 1`，思路是无区别的，也可以看看。\n\n## 函数式编程\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"asserts/book-FunctionalThinking.jpg\" height=\"150\" align=\"right\" /\u003e\u003c/a\u003e\n\n- [《函数式编程思维》](https://book.douban.com/subject/26587213/)：科普读物。\n- [《Java函数式编程》](https://book.douban.com/subject/27594722/)：讲的主题是函数式编程，用Java语言描述。\n    - 包含：`FP`思维、`FP`基础类库的讲解，偏重思想和基础。有了思维和基础，实际的实践和应用就会举重若轻。\n    - 讲解得平实、循序渐进，所以书有点厚500面\n    - 基于`Java`语言描述、手把手的构建`FP`的基础运行时结构，极大地降低了深入理解`FP`的门槛和难度。\n    - 书评/译序 http://qinghua.github.io/functional-programming-in-java/\n\n[![](asserts/forrest-gump.png)](https://coolshell.cn/articles/10822.html)\n\n# 有哪些相关的类/库\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"asserts/Java-8-Streams.png\" align=\"right\" width=\"20%\" /\u003e\u003c/a\u003e\n\n这里列的是比较广泛的相关。使用方式和思考方式是互通的，大家去学习和理解。\n\n##  1. `Java 8`的`Stream`\n\n即包`java.util.stream`。\n\n- [Java 8 中的 Streams API: Streams 的背景，以及 Java 8 中的使用 - IBM](https://www.ibm.com/developerworks/cn/java/j-lo-java8streamapi/)\n- [`java.util.stream`的官方`JavaDoc`](https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html)\n\n## 2. `ReactiveX`(`Rx`)/`RxJava`\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"asserts/rx.png\" align=\"right\" width=\"20%\" /\u003e\u003c/a\u003e\n\n`ReactiveX`（`Rx`）是 `Reactive eXtension`（`Reactive`扩展）的缩写。\n\n提供了`Reactive`编程支持，提供配套设施/工具的实现。\n\n- 官网 http://reactivex.io/\n- `RxJava 2`的[`Flowable`类的`JavaDoc`文档](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html)，图文并茂，非常值得一读！\n    - [`RxJava 2`的`JavaDoc`文档首页](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/package-summary.html#package.description)\n- `GitHub`仓库 https://github.com/ReactiveX/RxJava\n- [可视化`Reactive`操作符 - RxJS Marbles](http://rxmarbles.com)，可拖拽元素去理解每一个操作符的含义，非常值得玩一玩！\n\n## 3. `Reactive Streams`(`RS`)\n\n`Reactive Streams`（`RS`）规范 **简单了解** 一下就好～  \n\\# 在Java中，即是Java9 Flow API。\n\n`Reactive`的核心设计思路和底层模式，`RS`只提供的了`API`（4个接口）及规范（这个接口及其之间的实现契约），不包含实现。\n\n\u003e - 『核心』是指：全能、极简\n\u003e - 『底层』是指：比较原始，业务开发一般不会使用直接使用/实现这个`API`来编写业务逻辑。\n\u003e\n\u003e ------------------------\n\u003e\n\u003e `Rx`是业务开发使用的框架/库，而`Reactive Streams`是规范API。\n\u003e\n\u003e 在`Java`中，`RxJava`与`Reactive Streams`的关系，可以类比成：\n\u003e\n\u003e - `Spring MVC`与`Servlet API`\n\u003e - `MyBatis`与`JDBC API`\n\n- 官网 http://www.reactive-streams.org/\n- `RS`规范的`GitHub`仓库，包含了\n    - 规范概述 https://github.com/reactive-streams/reactive-streams-jvm#reactive-streams\n    - 规范及其设计上的用意 https://github.com/reactive-streams/reactive-streams-jvm#specification\n    - `Java`语言描述的\n        - 接口代码\n        - `TCK`（即 规范兼容测试套件）代码\n\n# Reactive Streams介绍\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"asserts/rs-class-diagram.png\" width=\"95%\" alt=\"Reactive Stream的核心概念及其关系\" /\u003e\u003c/a\u003e [.](asserts/reactive-stream-n-flow-design.asta)\n\n\u003ca href=\"##\"\u003e\u003cimg src=\"asserts/rs-sequence-diagram.png\" width=\"95%\" alt=\"Reactive Stream的时序图\" /\u003e\u003c/a\u003e [.](asserts/reactive-stream-n-flow-design.asta)\n\n# 在软件大会上自己做的主题分享\n\n- QCon2018北京 分享 @ 2018-4-21：\n    - [Reactive架构升级实践 —— 淘宝全站业务的全异步流式架构升级](https://2018.qconbeijing.com/presentation/462)\n    - [PPT的`PDF`文件](Reactive架构升级实践-李鼎-20180421-QCon北京.pdf)\n- 2018携程技术峰会 分享 @ 2018-11-23：\n    - [Reactive架构升级实践 —— 淘宝全站业务的全异步流式架构升级](https://techsummit.ctrip.com/2018/index.html)\n    - [PPT的`PDF`文件](淘宝应用架构升级-20181123-携程技术峰会.pdf)\n    - 进一步包含2018双11的进展\n- 2019 TOP100全球软件案例研究峰会 分享 @ 2019-11-16：  \n    - [面向流量的自适应高可用架构 —— 淘宝应用架构升级实践](https://www.top100summit.com/detail?id=14331)\n    - [PPT的`PDF`文件](面向流量的自适应高可用架构-淘宝应用架构升级实践-李鼎-20191116-Top100.pdf)\n    - 对应于`Reactive`架构/系统设计中的`Responsive to workload/Elastic`，或者说成上面我表达成的『面向流量/负载』的高可用 :)\n    - 分享过去一年多的思考、实现 与 2019双11实践落地及其收益效果。\n    - 高可用(HA) 不单是 **应对资源失效的高可用**，还有 **面向流量的高可用**。  \n        在今天对于应用架构来说，后者更是痛点，但业界的关注、思路、实践要落后很多。\n    - 让我们一起更多地关注 **面向流量的高可用**！大家和业界能更多正面思考与解决这只房间里的大象：  \n        流量不确定性带来的稳定性问题！\n\n# 相关资料\n\n- Reactive Programming\n    - [Reactive Programming with JDK 9 Flow API - oracle.com](https://community.oracle.com/docs/DOC-1006738)\n    - [Your Mouse is a Database - acm.org](https://queue.acm.org/detail.cfm?id=2169076)\n    - https://github.com/lucamezzalira/awesome-reactive-programming\n- Rx\n    - https://github.com/eleventigers/awesome-rxjava\n    - https://github.com/riiid/awesome-rx\n- FP\n    - http://www.vavr.io/ | https://github.com/vavr-io/vavr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldratlee%2Freactive-practice-at-taobao","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foldratlee%2Freactive-practice-at-taobao","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldratlee%2Freactive-practice-at-taobao/lists"}