Reactive������ �������������
� /��(��) 2018-11-23
��I} Id: oldratlee
} Github( https://github.com/oldratlee ) / oldratlee<at>gmail<dot>com / � / …
} Vimer / Tmuxer / Zsher
} J��7��;10�H�7�;$�XO*�����9?(���ZWB�/PAAS�/�DRPC/6#E�Y�
} �8\> transmittable-thread-local / java-dns-cache-manipulator< Owner} https://github.com/alibaba/transmittable-thread-local
} https://github.com/alibaba/java-dns-cache-manipulator
} LP[ https://github.com/oldratlee/translations
} Git� 5&� / ,"�3�S��C�V�Q@U<.��-)'<K�%R
} Java<T;I/O APION / PaxosLease��:AG<+=PaxosF4
} Dubbo2!��M��} https://github.com/apache/incubator-dubbo
�
������
�����
������
�������
��� ��
}� ��
} QPS�� 30%} RT�� 40%+
}���
} QPS��90%+} Load��70%+
��� - RT
����������
���� ����
�������
�������
RPC SOA
1 01
( / Load)1
( )( 1 )
RT Cache
RT
1
2
3
B
E
C
F
D
G
cache
A
�������
�
�
�&2
�%!
��
��0�
�!/3
�1�
�&2�
�&�'2�
# $-��.
�,���&
�&�"
��+�
��4*
�����)( ��'�
�� ��
StreamFlowFlux�
����
����
• ������������• ���� ����
�� vs.��������������
���
Your Mouse is a database!—— Erik Meijer
�������
�—����3��B%9�-�1(7�>)#�'�(48".��/+A5
filter/take/skip/distinctmerge/concat/zip/map/flatMap�@(if) /��& /�+
buffer/window/cache/publish;0 /6! /�,(��/��)
delay/interval :� /��
reduce/toList/count/groupBy/throttle)���B�� /<= /�4 /2�
1. �1��*�".�(��
2. �1�� $&?��(�'
�—������1. ���2. �6>�3. 0Scheduler(-5)�
#��*�(��B
"�0SchedulerE• ��RPCACache�?��#D ��;.�2D���0Scheduler(-5)�B
• ���# 7/38%�� subscribeOn/observeOn 2�B
$,�)4#5�!1C)4#5+=�(�<���&
�9�:�@ flatMapE���6>��#�'(�#
�—��
���
1
2
2
3
3
3
3
123��!��
��!Fork-Join��
CPU����������
���� ���
����1 2 ����
�—���
1. ��9�/ �0���
2. ,�=B#�)F�&+<�.<
��
7��.�.
�.!4
�.!4
APP
5E�.�.
5E�.�.
UI?(!4D3
?(: !4
��!4?(: ��!4@/��
��$-;�%'>�/����*C2
� �/��
��!4:
(��6$A")
18)
������
&7E8H@(Reactive Programming/RP)
Rx*/Reactor/…?C
Reactive Streams
�2Reactive
�$-;��J?C+�
• DG2 /96• 4�#% + 7���• '8�5+ /&7H@� #��&7���1>��
�0�
• =<-;0��"!�(• @F��.��2• =<��D�3
�$&7��J*B�
• &74,��� :• DG2KFlowable/�• D��K�A/+I�8E)
���+����2�)�%$�} 87.�2" �� Java 8.#�
} Lambda"
} ��<:��105;
} Reactive����3/&%.�*
} GitHub� RxJava Star 36k+Java87 Star No.1.�/&%
} �(�,
} �-��Reactive} Java 9.Flow API� Reactive Streams64�9'
} Spring 5�� Reactive! ����&% Reactor
data @ 2018-11
�������
�������
CacheTair
DBTDDL
RPCDubbo
JVM Coroutine
QueueMetaQ
EagleEye
���$
RxAOP
AliR
xUtil
!�� (MTop)
!��App
AliRxObjC
Sentinel��
RxJava / RxSwift / …
��������� +����
����
1. "�%
2. ���
3. ��
RxJava
�����#� TTL&��&���'
61'%1. Rx*�RxJava / RxSwift / RxJS / …�
} �+(8��7������v2} �Android��),�05�,���} &���2 +$ 2 +�2} *7�
RxJava Github� Star3�-Java�2. Reactor
} .�(8!�3��} Spring���#���"
3. Akka} Scala4�,��/�9�
�����)���*
1. ��(#��&��Reactive Streams!$����(#�"�
2. ����(#���������(# �"� '��%������
���1. '<QH(RPC)!�46,��G�Dubbo 3�
2. (J�)�� (Gateway)!} 3-�9>%&��(�7�L)T�O�Flowable
} ����46,(<)%O�Flowable
3. M?(Cache) 4. 1$(Queue)
} ����I2���B�T.B���;
5. DB(JDBC)RBlockS} �Ali JVMK=(C�)I2B�} .�0=I2B�
6. @�D"
7. �:4FP/A
} +8(<I2/�5E ����*N!#
8. iOS Objective-C�RxQH} �� AliRxObjC (�G)
��1. 9�*)�.2.a
} )��X�2.�%T�
} S[��Case} NU>X�
} 71,D2.5@�E
2. RY.2.} PK/�RY.(V�G�
2.5@)��<+F=
1. HI/"'�/T��3�} �6��2.5@:�
2. B]Match2.(�CPUJ�0_�Load)
} ��M��� Z(V
3. ,D^LA-<9
} W#2.5@ 8\;`QC!&
4. ,DJ���
} �,D2.5@?O4$
�������
} ��
} � ��
} �
} � �
} ��
} � ��
} ���
} ���!
} ����
��
Masters
Masters
������
��
��
"�Masters
��
��
Masters
Masters
��
����
�������—��� �2018�11�} =KTNh]�U"ik1H.�MD�A�=KTNjO�=Kc
} HSFgTair���*=KcCS&0j<.�Y`O�>Z} B�.� CPU4�7:=K} eE=KckEventLoop / Provider / Consumer /da[��=Kc} '�?69#
} da_Jh\?LFik6% �(,jVG�\?95���)R} Q�QfW* AliJDK(JVMPI)6^JVM5API�da�_Jh1+-@i} Q�;da�8H(7:=K)�]��
} O��=K��3b�Xh1H&��*i} .���2�$������*�1H6^����X
} 6^�XjMTopgHSFgEagleEyegRxJava�!���*�O�/&
�����
} ���6.��A(Backpressure)} &<1�';I���B=�* 5E
} 2018#11����:U�)��
} �A�" >?A�2R�@P4N
} �%3�0�" J�/�
} ���G,/�.�H�$8QF
} 7KC� Kotlin�L9O!����9.�M9-DS(FP�+T
����������
���������
Thanks!