大系统小做,服务拆分,是互联网应用的特点,也符合敏捷交付的理念。对于传统软件,如Windows,Office等,都要经过一个漫长的需求,研发,测试,发布周期,在“唯快不破”的互联网时代,这显然是无法满足业务要求的,即使最后上线,也可能因为周期太长而不再适用了。
因此,对一个互联网服务,一般会首先完成最核心的功能,快速进行上线,不断进行迭代,后续再进行辅助功能跟进。对于核心功能,随着用户数的增加,会不断进行服务拆分,如何进行拆分,拆分到什么样的粒度,是不是微服务是解决问题的银弹?这些都要根据实际的应用场景来评估,绝不是越细越好,而是要达到一个优雅的平衡。
并发控制,服务隔离。并发控制,现在已经成为互联网服务基本要求,在应用程序端和数据库端,也都有成熟的方案,如果忽略,可能造成灾难性的后果。对于重要的服务,还要进行隔离,
例如同一个服务,要提供给内部调用,公司级调用和公司外开放服务调用,开放服务调用者我们一般认为是不可靠的,甚至有可能是恶意的,如果不进行隔离,开放服务调用有可能使得服务资源占满,对内也无法提供服务。从技术上,可以是硬件级隔离,全部隔离,也可以是前端应用的隔离。
Big system with small scale and service splitting are the characteristics of Internet applications and also conform to the concept of agile delivery. For traditional software, such as Windows and Office, they all have to go through a long cycle of demand, research and development, testing and release. In the Internet era where "speed is everything", this obviously cannot meet business requirements. Even if it is finally launched, it may no longer be applicable due to the long cycle.
Therefore, for an Internet service, the most core functions will generally be completed first, launched quickly, and continuously iterated, and then auxiliary functions will be followed up. For core functions, as the number of users increases, services will be continuously split. How to split and to what granularity? Is microservice the silver bullet to solve the problem? These must be evaluated according to the actual application scenario. It is not the case that the finer the better, but to achieve an elegant balance.
Concurrency control and service isolation. Concurrency control has now become a basic requirement for Internet services. There are also mature solutions on the application side and the database side. If ignored, it may cause disastrous consequences. For important services, we also need to isolate them.
For example, the same service needs to be provided for internal calls, company-level calls, and open service calls outside the company. We generally believe that open service callers are unreliable and may even be malicious. If we do not isolate them, open service calls may fill up service resources and make it impossible to provide services internally. Technically, it can be hardware-level isolation, full isolation, or isolation of front-end applications.