Albian Development NOTE 6-Albian Architecture

Source: Internet
Author: User

I wanted to write this article A long time ago . However, as a technician, I have suffered a lot but I have concepts and ideas in my mind, the implementation has not really started, so it has never been written. Now, the main part of Albian's net implementation has been completed by about 75%, and the standalone can barely work together, so I have the confidence to write this article on Albian architecture. After this article is completed, the following articles will describe how to use Albian, from simple to complex.

Speaking of Albian architecture, we need to talk about the origin of Albian. Albian actually comes from some development experience and actual project implementation in the e-commerce area. Although there is not much experience in e-commerce, but with the "standing on the shoulders of giants", Albian can be integrated. It can be seen that Albian is actually tailored for the e-commerce industry (I took Albian to communicate with my friends last week, and my friends put forward a lot of opinions. Finally, only a few of them were accepted, all that is lost are discussed and the difference between the Internet and e-commerce companies is relatively large ). Therefore, Albian is not suitable for MIS or ERP systems. We need to talk about the different characteristics of the Internet, e-commerce, MIS, and ERP traditional industries. In fact, the most appropriate or inappropriate problems are the massive and high concurrency problems faced by the Internet and e-commerce companies; MIS or ERP generally faces complex data relationships and complicated business problems. Because no matter the Internet, e-commerce, MIS, or ERP, database-oriented programming (odbp) is the final problem. Compared with the Internet and e-commerce, the data volume of a single table in a database may be large (even larger), and the database must also face severe read pressure (the classic 2-8 principle of the Internet ), however, due to the characteristics of the data itself, the correlation between the data is not strong, and there are usually few associated tables three or more times. However, MIS or ERP is completely different, the pressure on a single table is relatively small (generally at the W level, there are few 10 W or W, KW is almost extinct), but the relationship between tables such as foreign keys is indeed complicated, in addition, the user groups of MIS and ERP are relatively fixed, so the Read and Write pressure is generally controllable. Therefore, if you need to build an architecture, you need to build the architecture based on two completely different features. Some people may say that you just need to set up one architecture and add the switch. I personally think that one person can only do one thing to do well at the same time, So Albian is only for the Internet or e-commerce industry. The Albian architecture is actually very simple. Let's take a look at a picture to basically understand what Albian is like:

If you do not understand it, let's take a look at the text description: I personally think that the 1, 2, 3 method can be the most clear, so it is best to explain in this format:

  1. Albian is actually a service-oriented and data-oriented framework, which does not provide the Implementation of the UI Layer;
  2. Albian provides five components to build the entire underlying framework: Albian Manager server; Albian distributed locker server; Albian IOC; Albian ORM; Albian database router;
  3. Albian Manager server: manages the entire Albian environment, such as registering Albian, checking Albian, and restarting Albian. These features do not require high server performance, therefore, this machine can also be used as the Manager server of multiple Albian distributed locker servers;
  4. Albian distributed locker server: mainly provides objects for various applications.ProgramA Boundary lock, or a lock between processes. The lock function is similar to the lock function between mutex threads, except that mutex locks an object in the same process or application boundary, so that a thread can exclusively enjoy this object; albian distributed locker server locks the objects in the entire application system (not the operating system, but the whole site system), so that a process or application boundary excludes the object. Albian distributed locker Server is a programming rule like mutex. If you do not use this rule, the program can run, but it is not guaranteed that data synchronization between processes will not occur. Generally, the lock on the Albian distributed locker server is obtained first, and then the mutex in the process is obtained. The release steps are the opposite; the implementation of Albian distributed locker server has been determined to be put on Linux. It is implemented in pure C and the serviceCodeThe number of rows is estimated to be K-level;
  5. Albian IOC: A simple implementation of dependency injection. It simply provides the generation object and is managed and controlled by Albian. The reason for not implementing such problems as parameter injection and property injection is that it is not necessary to implement these problems, which increases complexity. Secondly, what Albian deems important is not in IOC, IOC only needs to provide some of the simplest and most concise functions to optimize the running performance;
  6. Albian ORM: A simple ORM implementation. In view of the characteristics of the Internet and e-commerce, Albian ORM removes many fewer functions than mature ORM on the market, because Internet and e-commerce are basically "single table, therefore, Albian only provides "single table" operations. Once the relationship between tables needs to be maintained, it is only troublesome for programmers.
  7. Albian database router: This is the focus of Albian's overall system architecture. The implementation theory of Albian database router is the famous cap theory (if you do not know the CAP theory, please google it ). However, in order to achieve the efficiency of massive data storage and operations, the Albian database router finally wrote an article on cap c to reduce the consistency requirements, use final consistency to ensure efficiency. Albian database router supports multi-database access, including heterogeneous databases. Albian database router also supports routing objects to specified databases and tables. Albian database router provides an interface for you to customize routing rules; albian database router also provides optimistic Distributed Transaction solutions (Common distributed algorithms's wait-free termination concept ).

For the overall architecture of Albian and the key router functions, see the following two:

This is a read/write splitting. the Albian database router will send the data reason to the database on the left Based on the configuration, and then synchronize the data to the following MySQL through the synchronization between databases, in this way, we can query MySQL on the right to reduce the pressure on the database;

This is written multiple times, and when an object is persistent, an object can be written to two databases at the same time according to the configuration of Albian database router.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.