Meizu multi-computer room deployment plan
Why should we do multi-computer room deployment
After Meizu’s transformation in 2014-2015 and the explosion of sales, There are more and more Internet service businesses coming, and the user base is getting larger and larger. The previous expansion architecture of a single computer room can no longer meet the development of Meizu. In addition, in the domestic complex network environment, a single computer room cannot meet our reliability needs. In recent years, optical cables have often been dug up and power outages in computer rooms have occurred. For example, Alipay's optical fiber was dug out, causing business interruption; WeChat also suffered a large-scale failure last year, and its optical fiber was also dug out. In addition to the risk of single computer room failure, users also have strong demand for nearby access.
Technical Challenges
- Network delays and bandwidth limitations between computer rooms, renting a dedicated line from an operator is very expensive, and reliability cannot be guaranteed;
- Business Complex dependencies;
- Precise scheduling of traffic between computer rooms;
- Business changes cannot be too big.
The biggest challenge of the multi-computer room solution is a series of problems caused by network delays between computer rooms, such as consistency. Of course, there are also some mature solutions in the industry, such as Alibaba’s unitized solution. The business is enclosed in a unit according to users; Tencent's set solution and Weibo's cross-computer room solution are mainly written in a centralized manner and provide a quick switching solution.
Industry solutions
Meizu multi-computer room solution
We learn from the above solutions, sort out the business, and map it to the following two businesses:
- Read more and write less
- Separate by user
Read more and write less
This type of business is mainly reading and rarely writing, so we This type of business is even classified as read-only business.
The single-machine room structure of the application store is as follows:
The access end is divided into three businesses, API, developer community, and operation backend.
- The API provides an interface for mobile app stores to use. It mainly reads list data and displays it to users. For this part of "reading", we basically read it from the cache and rely heavily on the database. Small; then a small amount of "writing" comes from some statistical information, comments, etc.
- The developer community provides developers and App manufacturers with the opportunity to upload and maintain applications. It writes more data and reads and writes are basically balanced.
- The backend is provided for use by the company’s internal operations department. Functions such as list maintenance, application uploading and delisting, etc. also have a lot of “writing”.
After grading business availability, the application store (API interface) has the highest availability requirements, while the operational backend and developer community have slightly lower availability requirements.
Based on the above analysis, we only need to provide a multi-machine room solution for the application store (API interface).
The multi-computer room architecture of the application store is as follows:The deployment of the core computer room basically does not need to be changed. The data in our East China computer room is replicated through the synchronization function of MySQL, and the reading of list data Get the same as the core computer room and read from the Redis cache. The data cached by Redis is obtained from DB and flushed to Redis regularly using scheduled tasks.
In order to ensure data consistency, "writing" is still a single-point write, which is written directly to the core computer room across computer rooms. There are two types. One is to write to the remote computer room through the message queue. Even if there is a problem with the computer room network, our "writes" can be accumulated in MQ, which basically does not affect the user experience. The accumulated data will be pulled out after the network is smooth. . Another kind of "write" requires to know immediately whether the "write" is successful, so it is written directly to the database across the computer room. If there is a network problem in this part, it will cause failure, and we can perform downgrade processing.
In addition, we use GSLB to schedule the traffic in the computer room, which will be explained in detail later.
Read and write balancing business
Our read and write balancing business here has an important feature, that is, all data can be segmented according to the user dimension. There is little correlation between them. For example, our synchronization service synchronizes all data on the mobile phone (contacts, text messages, settings, wifi, input method preferences...) to the cloud. When the mobile phone is lost or needs to be refreshed and needs to be cleared, the data can be pulled at any time. Come down and make sure your data is never lost.
The following is the synchronization business single-room architecture:
Our user access interface is also divided into two parts, one for practical APIs on mobile phones, and the other for Web users can directly operate (modify contacts). The requests obtained by the web interface are forwarded to back-end services, such as contact synchronization, message synchronization, setting item synchronization and other services. The backend service then stores the user routing information in different DB shards.
It is more convenient to make a cross-computer room solution here. You can directly do global routing according to users and route to different computer rooms.
The cross-machine room architecture diagram is as follows:
We package business data and services into a single Unit, and one Unit serves a certain number of users. Each Unit contains complete data and services and can be deployed independently. Each computer room has multiple Units, and each user's data has a local backup and a remote backup. When the computer room fails, the backup data can be pulled up to serve users.
When users access our services through API, GSLB is used for scheduling. When users access business services, they first obtain the location of user data from GSLB (user data is only provided in a certain computer room at the same time), and then The client request is scheduled to the appropriate computer room.
Web requests are a challenge because web services cannot use GSLB, so user requests cannot be accurately scheduled. This plan will be discussed in the subsequent traffic scheduling.
Precise scheduling of computer room traffic
When it comes to multiple computer rooms, it involves traffic scheduling. The simplest way to schedule traffic is to use smart DNS services. As shown below:
Only DNS can determine which ISP and which region you are a user based on the IP in the request from LocalDNS, and then schedule it to the corresponding ISP and corresponding region. The core of the computer room is the IP library of smart DNS. There are several disadvantages:
- DNS hijacking. In our country, DNS hijacking occurs from time to time, especially by operators in second- and third-tier cities, blatantly. This basically cannot be solved by smart DNS
- If the local DNS is set to the DNS server specified by the user such as 8.8.8.8, the LocalDNS obtained by the smart DNS server is a US address and cannot correspond to the ISP. The smart DNS service can only The analysis is provided according to the designer's preference. At this time, the user may be resolved to the wrong ISP and wrong computer room.
- Cannot be scheduled based on user information. Some data are only available in specific computer rooms. Since the DNS protocol cannot carry user identifiers, it is difficult to achieve accurate analysis.
- Unable to detect server downtime.
From this, we have accessed the GSLB service for specific businesses:
This service avoids DNS requests and initiates requests Before accessing our own GSLB service (or HttpDNS), businesses can bring user IDs to locate which computer room their data is in, and use IP to access business services.
brings several obvious benefits:
* 可以根据IP或者UID等等信息精确调度。* 避免DNS劫持。* 用户手工设置DNS也不会调度错误。
Currently, all our client access is connected to GSLB, such as the application center mentioned above, user synchronized API access, etc.
But there are also problems. This solution is only suitable for client-side HTTP and HTTPS requests, and is not suitable for browser access. The browser does not know what your GSLB is. User synchronized API access can be done with GSLB, but when accessing the Web, GSLB cannot be used for traffic scheduling, because the browser does not recognize GSLB, and if you use smart DNS, you cannot accurately schedule traffic based on user ID.
Based on the above considerations, we proposed a third solution, GSLB smart DNS:
Before the user requests a service, find a server resolved by DNS. To obtain data, the back-end service will first find the GSLB service to find the computer room where the user data is located. If the user data is in the local computer room, the data will be returned directly. Otherwise, the user request will be redirected to the appropriate computer room to re-initiate the request.
This solution may cause the domain name in the user's browser to change, affecting the user experience. In addition, domain name hijacking cannot be avoided.
Summary:
This article mainly introduces Meizu’s multi-computer room disaster recovery plan and the problems and countermeasures encountered during the implementation process, as well as Meizu’s core computer room migration plan and solutions to the problems .
What insights and experiences do you have in multi-computer room deployment? Feel free to share in the comments.

根据美国司法部的解释,蓝色警报旨在提供关于可能对执法人员构成直接和紧急威胁的个人的重要信息。这种警报的目的是及时通知公众,并让他们了解与这些罪犯相关的潜在危险。通过这种主动的方式,蓝色警报有助于增强社区的安全意识,促使人们采取必要的预防措施以保护自己和周围的人。这种警报系统的建立旨在提高对潜在威胁的警觉性,并加强执法机构与公众之间的沟通,以共尽管这些紧急通知对我们社会至关重要,但有时可能会对日常生活造成干扰,尤其是在午夜或重要活动时收到通知时。为了确保安全,我们建议您保持这些通知功能开启,但如果

Android中的轮询是一项关键技术,它允许应用程序定期从服务器或数据源检索和更新信息。通过实施轮询,开发人员可以确保实时数据同步并向用户提供最新的内容。它涉及定期向服务器或数据源发送请求并获取最新信息。Android提供了定时器、线程、后台服务等多种机制来高效地完成轮询。这使开发人员能够设计与远程数据源保持同步的响应式动态应用程序。本文探讨了如何在Android中实现轮询。它涵盖了实现此功能所涉及的关键注意事项和步骤。轮询定期检查更新并从服务器或源检索数据的过程在Android中称为轮询。通过

为了提升用户体验并防止数据或进度丢失,Android应用程序开发者必须避免意外退出。他们可以通过加入“再次按返回退出”功能来实现这一点,该功能要求用户在特定时间内连续按两次返回按钮才能退出应用程序。这种实现显著提升了用户参与度和满意度,确保他们不会意外丢失任何重要信息Thisguideexaminesthepracticalstepstoadd"PressBackAgaintoExit"capabilityinAndroid.Itpresentsasystematicguid

1.java复杂类如果有什么地方不懂,请看:JAVA总纲或者构造方法这里贴代码,很简单没有难度。2.smali代码我们要把java代码转为smali代码,可以参考java转smali我们还是分模块来看。2.1第一个模块——信息模块这个模块就是基本信息,说明了类名等,知道就好对分析帮助不大。2.2第二个模块——构造方法我们来一句一句解析,如果有之前解析重复的地方就不再重复了。但是会提供链接。.methodpublicconstructor(Ljava/lang/String;I)V这一句话分为.m

如何将WhatsApp聊天从Android转移到iPhone?你已经拿到了新的iPhone15,并且你正在从Android跳跃?如果是这种情况,您可能还对将WhatsApp从Android转移到iPhone感到好奇。但是,老实说,这有点棘手,因为Android和iPhone的操作系统不兼容。但不要失去希望。这不是什么不可能完成的任务。让我们在本文中讨论几种将WhatsApp从Android转移到iPhone15的方法。因此,坚持到最后以彻底学习解决方案。如何在不删除数据的情况下将WhatsApp

原因:1、安卓系统上设置了一个JAVA虚拟机来支持Java应用程序的运行,而这种虚拟机对硬件的消耗是非常大的;2、手机生产厂商对安卓系统的定制与开发,增加了安卓系统的负担,拖慢其运行速度影响其流畅性;3、应用软件太臃肿,同质化严重,在一定程度上拖慢安卓手机的运行速度。

1.启动ida端口监听1.1启动Android_server服务1.2端口转发1.3软件进入调试模式2.ida下断2.1attach附加进程2.2断三项2.3选择进程2.4打开Modules搜索artPS:小知识Android4.4版本之前系统函数在libdvm.soAndroid5.0之后系统函数在libart.so2.5打开Openmemory()函数在libart.so中搜索Openmemory函数并且跟进去。PS:小知识一般来说,系统dex都会在这个函数中进行加载,但是会出现一个问题,后

1.自动化测试自动化测试主要包括几个部分,UI功能的自动化测试、接口的自动化测试、其他专项的自动化测试。1.1UI功能自动化测试UI功能的自动化测试,也就是大家常说的自动化测试,主要是基于UI界面进行的自动化测试,通过脚本实现UI功能的点击,替代人工进行自动化测试。这个测试的优势在于对高度重复的界面特性功能测试的测试人力进行有效的释放,利用脚本的执行,实现功能的快速高效回归。但这种测试的不足之处也是显而易见的,主要包括维护成本高,易发生误判,兼容性不足等。因为是基于界面操作,界面的稳定程度便成了


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools
