当前位置:网站首页>Dry goods daily visit over 100 million, office IM and open platform practice in Ctrip

Dry goods daily visit over 100 million, office IM and open platform practice in Ctrip

2021-05-04 15:07:36 Ctrip Technology

Author's brief introduction

 
Jim, Senior R & D Manager of Ctrip , Focus on Java&Go Back end R & D of technology stack . Currently committed to TripPal High availability of open platforms 、 Opening up process and core derived Services .


brief introduction

Ctrip's internal office IM The project started in 2016 Project establishment in , Experienced the simple office scene of pure IM service , To support simple office components IM application , It has evolved into an integrated office platform , And then evolved into the current integration IM Function of open enterprise efficiency platform . This paper summarizes the development course of these years and the future evolution direction , And focus on high availability 、 High performance and scalability perspective , Discuss the technology realization and development direction of open platform .
 
One 、 What is? IM

 picture

IM(Instant Message) Instant messaging , It is an online communication technology that provides real-time message transmission through the network . In the era of mobile Internet ,IM It's becoming more and more popular , Through various technical means, the cost of communication between users becomes extremely low , Communication efficiency and user experience have been greatly improved . and IM The emergence of the Internet has greatly changed the current form of Internet applications , Most Internet applications only need to achieve a certain scale , There must be something of its own IM The needs of , Instead of It's simply Relying on a third party ( For example, wechat 、 Yunxin, etc ).
 
Two 、 Ctrip Office IM Development history of

 picture

In the early days, Ctrip used Microsoft's IM Software lync And self-developed pure IM Software CtripTeam To support the communication needs within the enterprise , The software is in the maintainability 、 There are more or less flaws in scalability and usability . At the same time, with the development of the Internet , It is also not suitable for the growing office demand and user experience .

2017 About years ago , Using a ejabberd+erlang Self research IM Service Cchat The project came into being , The main goal of the project is to adopt self-developed technology IM On the basis of , Realization IM Combined with office . Improving IM Based on services , Supports some common office scenarios , Telephone 、 Fake bill 、 Check work attendance 、OA etc. , Embedded external pages are usually used 、 Jump to external address, etc . This transformation project laid the foundation for Ctrip office IM The foundation for continued development .

As the project deepens , The original system interaction mode and service management mode are gradually not suitable for more and more complex office scenarios and service governance requirements . So in 2019 It's a new year TripPal The transformation project of , Based on the company's international strategy , Strive to build a small program platform , Service number and other basic services . Combing 、 While optimizing the original service , Created many derivative Services .

2020 Beginning in mid year , On the basis of continuing to promote the one-stop office platform in enterprises , We need to support more external scenarios , The actual demand drives us to transform to an open platform , This is in the overall service architecture 、 Security 、 New requirements and challenges are put forward in scalability and other aspects .
 
3、 ... and 、 Ctrip TripPal Open platform practice

3.1 Overall framework

 picture


3.1.1 Gateway Gateway layer

This layer is the entry point for all request invocation traffic , The main functions are as follows :

  • Service routing ;

  • Centralized current limiting 、 Risk control 、 Log monitoring and other functions ;

  • call IDS (Identity Service) Verify the validity of the request , After the verification is passed , Users can be ID、Token Etc , adopt HttpHeader Back end services are transmitted in a transparent way , Back end services can be used directly UserID, You can do it again Token authentication ;


3.1.2 IDS (Identity Service) service

IDS At the same time, it supports authentication of many different types of access token , It's also responsible for issuing tokens , as well as RBAC+ Module level interface control .

in addition , For open applets ,TripPal Two authentication methods are provided :

1) The conventional Oauth Third party access .

 picture

2) The other is based on Oauth+ Third party authentication of open platform signature , For the access side, it's relatively simple .

 picture
 
3.1.3 Micro service layer

This layer is the business layer of the whole system , There are three types of micro services :

  • TripPal Open platform internal system micro service , Only after specific user authentication and permission verification pass , External access ;

  • Open platform provides OpenAPI; use Oauth+RBAC Control permissions in the same way ;

  • Self developed small program back-end service , According to security needs , All use Oauth+ Module permissions The first party of Applet server side ;


at present TripPal Its core micro service application has reached 28 individual , Provide multi terminal services for the whole group (C End 、B End ) Basic service capabilities , Serve the whole company more than 500 A business application , On-line C The average number of end users exceeds 2 ten thousand , More than 100 million visitors a day .
 
3.2 IM service

 picture

at present TripPal Using a fully self-developed software based on Java Implementation classes ejabberd framework , The ground floor adopts XMPP Protocol to communicate .

Tips:
XMPP The full name is ExtensibleMessageing and Presence Protocol, Extensible message and presence protocol . It's open source on the Internet , Most flexible , The most widely used instant messaging protocol .
1999 year Jeremie Miller, First of all, it is proposed that Jabber, An open technology for instant messaging and presence , Based on this Agreement , Developed an open source service implementation jabberd. follow-up ,IETF The international standards organization is involved , establish Extensible Messageing and Presence Protocol(XMPP) Working group , And start Standardization .
2000 year ,jabberd The server 1.0 Version release , At that time Jabber The basic features of the agreement ( be based on XML The flow of , news , There is , Contact list, etc ) It's all fixed .
2004 year ,IETF Published RFC 3902 and RFC3921, Defined XMPP Core functions , Become a recommendation .
Follow up 2011 year ,IETF Published RFC6120 and RFC 6121, Updated XMPP Core definition of , Instead of the previous RFC 3920 and 3921.
at present XMPP The agreement was XMPP Standards Foundation Responsible for the management and operation of , Focus on IETF The basis of the definition XMPP Above the norm , How to develop open protocol extensions .

IM The server has done a lot of systematic optimization , Tuning from the underlying database 、 Upgrade the underlying communication service , Up to the top 、 Group 、 Group members and other core functions . The underlying communication service consists of erlang Complete migration to java Technology stack , Service reliability 、 Stretch and stretch 、 Improved security and performance ; At the same time, the service of the upper business was reformed , Greatly improved interface response , Service stability has also been improved , For the whole product development provides Important support . At present, this set of self-developed IM3.0 The service runs stably in the production environment , Overall resource consumption ratio 2.0 There is a big decline in the period of time .
 
3.3 TripPal Office derivative Services

In the actual enterprise office scenario , Especially in the context of complex organizational structure and management mode of large enterprises ,TripPal Gradually found out their own set of effective and suitable for Ctrip scene office intelligent application , For example, search the middle station , Message card , Intelligent approval center , Role services , Workflow engine, etc .

This paper briefly introduces 3 A service :

1) Intelligent approval center

 picture

Intelligent examination and approval platform integrates Ctrip's own examination and approval system as well as self-developed intelligent examination and approval configuration service , The service supports users to customize all details of the whole approval document and approval process .

 picture
 picture

2) Role services

 picture


Role service is based on the flexible definition of role scope and basic role , Support users to adjust flexibly , Dynamic management , And automatic access to the approval center , At the same time, open up the application docking channel .

The whole role service is divided into the following table in terms of product definition 4 The main concepts :

System concept
Introduce
management model
The range of roles (Scope)
Define the scope of the basic role , Such as : Platform R & D Center
Hierarchical management based on parent-child relationship
Basic role (Base Role)
Basic roles managed and defined by administrators , Such as : Administrators 、 person in charge 、PMO etc.
Platform or enterprise administrators manually manage
Fixed role (Role)
from [ The range of roles + Basic role ] The object of composition , Such as : Administrator of platform R & D Center
Managed by the role Creator
abstract Role
No role scope , Roles created based only on base roles , Designate some Scope The base role of the role should be created automatically on the
Managed by the role Creator

3) Online document

 picture


Online document service mainly provides online collaboration capability of documents , Support users at the same time / Real time view 、 edit 、 The ability to save and share . At the same time combined with IM Realize functions such as notification and feedback .

Technical implementation , The online documentation is based on CRDT Algorithm implementation is conflict free merge(LastWrite Wins)、 Finally, the multi terminal distributed solution is consistent , High availability at the same time 、 Fault tolerant features , In the event of a server failure , allow Shift Go to another machine and continue , Even if the server is completely down , The client can still work offline .
 
Four 、TripPal High availability practices

 picture

at present TripPal Deployed in 3 A computer room , Divided into public clouds 1 A computer room and private cloud 2 A computer room . The overall architecture is deployed in multiple application rooms 、 The data layer spans the computer room DRC On the basis of , Use the principle of nearby access for service access , In case of any accident 2 All the computer rooms are connected , Can ensure that the core applications in the system can still provide services . Among them, the phase I deployment plan of the public cloud room has been completed , The phase II deployment plan and test plan are expected to be completed in 7 Month to complete , At that time, I can share with you some details and history of the hybrid cloud solution .
 
5、 ... and 、 The future architecture and evolution direction of open platform

The open platform is mainly for two groups , Developers and users . So there are two main directions , One is convenient development , It's mainly about lowering the threshold for developers 、 Lower R & D costs , Get through to different developers 、 Barriers between applications , To achieve ecological sharing . On the other hand , For actual users , Improving the user experience 、 Data security at the same time , Realize user service ability Hehe takes the initiative to discover .

5.1 developer

In this regard , At present, the mainstream open platform has provided strong support for developers , The main forms are divided into :

1) Front end trust


The purpose of front-end trust is to reduce or eliminate developers' back-end and open platform OpenAPI The way of interaction , To lower the access threshold for developers , Reduce workload . The main way is to control through authority 、 Signature 、 Encryption and other means enable small programs to get trusted data in the front end .

 picture

2) Low code (Low-Code)


Because a large number of Internet services belong to simple interaction or model interaction , Take this as the starting point , Based on building a reasonable model 、 Simple business functions, etc , It allows developers to drag and drop components 、 Simple pseudo business code and other forms provide programming entry , It can greatly reduce the R & D threshold and cost of developers , Break the line between users and developers , Improve the overall ecological vitality of the open platform .

 picture

3)ServerLess


Based on cloud native ServerLess Combined with low code , Open the developer's cloud programming portal , At the same time, it provides cloud based components , Allows developers to deploy real back-end application services without having to , Greatly reduce the operation and maintenance threshold of developers .

5.2 At the user level

At present, the mainstream open platforms in the industry are integrating and mining the service capabilities of users themselves , The investment is relatively small , There is no mature practice , We think that we can focus on two points in this respect .

One side , The transformation of the third-party application governance model to the mall . Application governance and promotion of conventional open platform , Basically, the application side independently manages and promotes , But as the number of applications increases dramatically , As well as the application side unilateral promotion difficulty and so on , There is an urgent need for an open platform to support and govern from the perspective of ecology as a whole . This can be done in security 、 Maintainability 、 Positive feedback on the application from the convenience and other dimensions , Realize the sustainability and capability sharing of open platform application ecology . meanwhile , In certain situations , Combined with user analysis 、 Big data and AI, Improve users' active or passive application discovery ability .

 picture

On the other hand , Build a software alliance that conforms to the open protocol between applications , Breaking down application barriers , Around service integration 、 The core principles of open applications , Make different Internet business or behavior realize data to a certain extent / Ability sharing . In general , A complex Internet service is usually composed of multiple heterogeneous sub services / The sub application consists of , such , By applying split 、 Open sharing, etc , To a certain extent, it makes the complex Internet business more refined 、 Lightweight 、 Scalable .

5.3 Open platform Standardization 、 Interworking

At present, the major Internet companies at home and abroad 、 Institutions and organizations have built a variety of open platforms , Used to provide a variety of information services , In the foreseeable future , There will be an integration between platforms 、 Standardization 、 The possibility of intercommunication . So building standard open protocols , The process of depositing open platforms to the bottom is crucial .

6、 ... and 、 summary

By achieving basic IM Open platform architecture , And derivative Services , We summed up IM Some of the core capabilities of open platforms :

  • Service integration , Integrate and provide basic service capabilities in different business scenarios

  • Open applications , Provide third party access capability

  • High performance , High availability


【 reference 】
[1] Facebook messager Technical documentation :Scalingthe Messages Application Back End ‘’
[2] Facebook messager Technical documentation :BuildingMobile-First Infrastructure for Messenger
[3]  Talking about IM Architecture design of the system
[4]  A set of original distributed instant messaging (IM) System theoretical framework scheme
[5]  Wechat technical director talks about architecture : The way of WeChat —— The greatest truths are the simplest ( Speech full text )


【 Recommended reading 】


 picture


 “ Ctrip technology ” official account

  Share , communication , grow up



版权声明
本文为[Ctrip Technology]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/05/20210504150602230f.html

随机推荐