What? Tomcat- even be considered middleware?

About MyCat groundwork has written two articles on:

  1. MySQL can only do small projects? Song Ge to say a few words!
  2. The North Sea There Data, it called Kun, Kun great, a MySQL does not fit!

Today is the last time pave the way back you can meet the big Boss!

Originally today in relation to speak MyCat, but I found that there is a concept worth and we talk about, and that is Java middleware!

Because MyCat is a distributed database middleware , to understand MyCat, you have to first know in the end what is the middleware!

Last year, Song Ge in an external training in specialized talked middleware, I had wanted to share directly about the script, but did not find, it is also hands-struck.

Introduction to Middleware

Speaking of middleware, many people first thought is messaging middleware, messaging middleware then in addition to it? In fact, our daily development, too much exposure to the middleware, we look at a description on Wikipedia:

Middleware (English: Middleware), also translated middleware, interposer, it is software that provides the connection between the system software and application software, in order to communicate between the various software components. In the framework of modern information technology applications such as Web services, service-oriented architecture and other items used widely. Such as databases, Apache's Tomcat, IBM's WebSphere, BEA's WebLogic application server, the East through the company's Tong series of middleware and Kingdee Middleware Company belong.

See this, you may be surprised that we were unconsciously unconsciously so many middleware has been used up! Even Tomcat is a middleware!

Middleware, by definition, what is the connection between the two software, the software is an adhesive between, a thing like glue. It is located in the operating system and applications between us, allowing developers to easily handle communications, input and output, allowing developers to focus on their business logic development.

That is to say, it seems really a little bit like Tomcat middleware! Located between our operating systems and applications!

Middleware Category

There are a lot of middleware, as early as 1998 IDC middleware company will be divided into six categories, domestic middleware-related books published before 2005, many of which are in accordance with the six categories of points, namely:

  1. Terminal emulation / screen conversion
  2. Data access middleware (UDA)
  3. Middleware, remote procedure call (RPC)
  4. Message Oriented Middleware (MOM)
  5. Transaction middleware (TPM)
  6. Object-Oriented Middleware

In addition to this side messaging middleware and transaction middleware you may have heard, other middleware estimates are rarely heard, because times are changing, and some middleware slowly being phased out (such as terminal emulation / screen conversion middleware), while others slowly merged into other frameworks go (such as remote procedure call middleware).

Database Middleware

So what is a database middleware it?

We mentioned in previous articles, if the large amount of data, we need the data sub-library sub-table after points finish, originally present data in a database, now there are multiple databases, then we might project structure It will look like a:

We configure complex Java code in multiple data sources, separate read and write the configuration, even when the data query pretreatment data, such as loading from a first plurality of DB data sorting, filtering, etc. operations, so that our Java code mingled a lot of independent business methods, and these come in doping code, most are still repetitive.

In order to make developers put more energy into the business, we introduce database middleware, like this:

Very vivid description of what this chart is middleware! A thing is interposed between the two applications. After introduction MyCat middleware, our application will only need to connect MyCat on the line, and then to operate the various MyCat DB, sorting the respective distributed database, and the result set, data filtering and other operations are done in the MyCat, Java application so that we in turn can focus on developing the business, and those who repeat the operation is complicated, but also to MyCat to complete.

If there is no database middleware, Java applications then we will face the fragmented clusters, data source switching, transaction processing, data aggregation and so many problems, so Java applications originally the focus on the business, will spend a lot of It works to deal with the issue after the fragment, but most of the code and are repeated!

有了数据库中间件,应用只需要集中与业务处理,大量的通用的数据聚合,事务,数据源切换都由中间件来处理,中间件的性能与处理能力将直接决定应用的读写性能,所以在项目中选择一款好的数据库中间件至关重要。

结语

好了,本文就简单介绍下中间件的基本概念,下文就可以正式开始聊分布式数据库中间件了!

如果小伙伴觉得松哥自己写的技术文章还过得去的话,欢迎积极转发,松哥每隔 15 天会根据微信后台数据,选一个分享转发最多的一位小伙伴,送一本松哥自己的签名书或者 Java 领域的经典书籍,欢迎大家积极参与,下一次开奖时间在下周。

参考资料:

  1. MyCat 官方文档
  2. 曾宪杰.大型网站系统与Java中间件实践[M].北京:电子工业出版社,2014.

关注公众号【江南一点雨】,专注于 Spring Boot+微服务以及前后端分离等全栈技术,定期视频教程分享,关注后回复 Java ,领取松哥为你精心准备的 Java 干货!

Guess you like

Origin www.cnblogs.com/lenve/p/11105604.html