Do a simple program wang, share dry goods, talk about life.

Wechat public account: Advanced backend architecture

Follow me to find more dry goods, microservices, Spring source, JVM, SpringCloud Alibaba, K8S, etc.

If you found this article helpful, please give me a like and thank you for your support!

Database for our back-end students, it is simply the daily necessities of life, and it is dealing with every day. Recently, it was difficult to select a database, so I recorded the process.

The background,

There are currently 359 open source and commercial databases around the world, according to DB-Engines database popularity rankings.

In terms of application types, there are OLTP transactional databases, OLAP analytical databases, and HTAP hybrid databases.

From the storage mode, there are relational database and non-relational database (NoSQL) points. The NoSQL database is divided into key-value database, document database, column database, graph database and so on according to the data model supported.

Data formats and application scenarios are complex, and many requirements can not be solved by a single database. At the same time, the rise of micro-service architecture is also promoting different enterprise business scenarios to use different databases, if the improper choice, will lead to poor service performance.

2. Key points of selection

1. Business scenarios

Any database selection that deviates from the requirements of business scenarios is a hooligan. The decisive factor of database selection is the combination of business application scenarios, analysis of the existing demand and the new demand may appear in the future, to consider which database to choose.

What does a business do with a database? Analysis or trading? Or both? What kind of data does the business process? What are the database performance requirements?

2. Relational or temporal data?

If it is a traditional enterprise application such as ERP, CRM, or finance that requires transaction integrity and ACID transactions, then there is no doubt that a relational database is the best choice. If the business needs high-frequency, real-time, and continuous writes for iot data acquisition and monitoring, then a sequential database is the right choice.

3. Decide according to the data

What kind of data does the business process? Structured? Semi-structured? Unstructured data? Decide which data model you want to support. In principle, “Use the same library as the data model.”

If you want to store and process unstructured data such as images, audio, and video, then NoSQL databases are the best choice. Further, if the business needs to store information about characters in the game scene, experience items, friend rankings, etc., and this information is usually linked to ids (keys), then a key-value database is a good choice.

4. Swallowing

What are the data sizes, concurrent throughput, response time requirements that the business needs to process? Determines the performance requirements for the database.

If the business is second kill, Spring Festival train tickets, etc., there are ultra high peak business, then, distributed database will be a good choice.

Three, operable

Of course, we can’t ignore the operation and maintenance of the database when selecting the model. How about the technical reserve of our team? The selection should consider the skills of existing development, operation and maintenance personnel, and try to choose those with a short learning curve.

Database selection, many people will ignore the ecology, a good database is not only powerful, surrounding ecological improvement is very important. Compatibility with surrounding upstream and downstream products, supporting software, tools, and technical personnel have a great impact on the operation and maintenance.

Each database is not simple and requires a process to master. How can I quickly locate and resolve a database problem? Dbas have a lot of confidence if there is an active user community.

Four, cost,

The selection of database should not only consider the cost of hardware resources, software, service and labor of database deployment, but also consider the hidden cost, such as migration cost, maintenance cost, learning cost, operation cost and so on

Although distributed database is very popular, but also do not blindly follow the fashion, to use the right place, to know what scenario for distributed database, what scenario is not suitable, otherwise, not only failed to achieve the desired effect but also more money.

Five, the summary

Again, anything out of the business scene is a rogue. At present, there is no universal database, only the most appropriate database. Database selection or according to business needs to choose the most appropriate products, do not blindly follow the fashion, to catch up with the new hot.

Summary of historical articles

conclusion

The above is the summary and sharing of the previous content, thank you for your attention, thumbs up and favorites!

Wechat public account: Advanced backend architecture

More articles are coming, like to remember to give me a 👍, thank you for your support!

Public article synchronous update! Focus on me, don’t get lost!