How start-up Internet companies build their own technical framework

Scope of application

本文主要针对小型互联网公司,特别适用于手机APP的后台架构,基本可以支撑5万日活
本文会对可能用到的相关技术进行技术选型的说明,以及相对应的设备的采购。

Technical indicators

说一下一些技术指标的计算过程可以作为其他同学的参考
  • QPS, if it is 50,000 daily activities, the use is concentrated in 4 hours a day, and each user generates about 100 requests, then on average, the requests our system should support is: 50000 * 100 / (4 * 60 * 60) = 350qps/s
  • Business data business volume, we are a news business, there may be other businesses, such as games, shopping malls, etc., the basic business data added every day will be in the same order of magnitude, 10,000 per day, and the information related to users is also A relatively large piece, such as user subscriptions and other behaviors, has a total of 50,000 users, and it may take about 100 pieces of data to save relevant information.
  • Cache size Main business data and user-related hotspot data are stored in the cache for a limited time, and it takes about 5 GB.
  • Log size User logs and request logs. About 3 G a day

Technology Architecture

N_X_WQV20_4SF61NZUYO
Because the overall structure is a small company, we build it based on Alibaba Cloud, and explain the content and technology selection in the figure below:

load balancing

 可选方案: SLB, Nginx.
 - SLB要收钱,但是比较便宜,有保证,不会挂。 但是可配置的很少,不能根据域名做ip映射
 - Nginx, 没啥缺点,需要一定的知识。
建议: SLB + Nginx, SLB绑定域名作为统一的入口,然后每个服务器上再搭建Nginx.

CDN

用于缓存静态文件等等。 七牛和阿里的都还可以。
- 七牛要做的久一点, 各种图片处理的接口要完善一些
- 阿里的CDN要稍微好一点点, 但是没有不安全的访问方式,访问稍微没有那么灵活。 图片处理功能弱一点。

Distributed calling framework

Currently available are ZK + dubbo. ZK + Motan, ZK + dubbox, edas.

  • dubbo, Ali's service governance framework, is no longer maintained, and the switching response is a bit slow
  • dubboX, Dangdang is based on dubbo, it is still maintained and can be used, recommended.
  • Motan, Weibo's service governance mining construction, just open source, need to learn, recommended.
  • Edas, Alibaba Cloud service, requires money, very intrusive, not recommended

SQM

The options are: ActiveMQ, Alibaba Cloud Messaging, robbitMQ, 
each with its own advantages, but considering the difficulty of operation and maintenance, Alibaba Cloud Messaging is recommended.

Say it again

用来做缓存, 自建成本有点高,需要Codis, 分片,集群,主从等等,很麻烦。 建议直接用阿里的

database

主要基于读写分离和主从复制考虑,目前可以自建和选用阿里的DRDS。
- DRDS 要花钱,成本较高,没有必要
- 自建,  不用中间件,直接12只读, 然后配置读写分离的数据源,内网SLB进行读集群。解决之。

search

建议ELK, 可以自动同步数据库,除了搜索引擎的功能外,还可以做日志搜索,监控系统。

Description of some typical business scenarios

  • The bottom layer of the business is made into an SOA module, and services are provided externally through the distributed call framework.
  • Make a small system alone to run scheduled tasks
  • The hot data is placed in the cache, and then the cache is updated through MQ
  • Logs and other data are necessary to consider the last Mongo

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326629875&siteId=291194637