当前位置:网站首页>How to balance security and performance in SQL?
How to balance security and performance in SQL?
2022-07-28 20:39:00 【51CTO】

If you find yourself in the world of databases in some way , You must have some knowledge of database security and performance . Database management systems do bring benefits to databases , But have you considered the need to balance security and performance , In order to make your choice most effective ? This is what this article will discuss .
PART 01
Whether safety and performance are linked ?
First of all, consider a fact , Performance and safety are closely related . The main reason for this is , Developer , Whether junior or senior , At some point in his career, he began to realize :
- When safety is improved , Achieving performance goals often becomes a little difficult ( in other words , Developers often need “ make every attempt ” To achieve their goals )
- When improving performance , Sometimes at the cost of safety —— for instance , Relax authority and so on .
use Mark Eldridge Make a description of the drawing :

I hope you can understand the above meaning through this diagram . Of course , This arrow reflects the tradeoff between security and convenience in password management , This is related to SQL There is no direct relationship between security and performance in , But the two can be compared . Improving security usually means making performance related tasks more difficult , vice versa .
PART 02
SQL Security and performance in
Now? , You may want to know ,SQL in , How performance and security are integrated ? In a word , Obvious —— When one aspect ( Safety or performance ) In ascension , The other requires additional maintenance measures , vice versa . The following are some of the main measures that database administrators and developers usually think of when considering security and performance :

As shown in the table above , All choices usually have benefits , Or both advantages and disadvantages . In this field , You also need to consider another problem : Do you have the knowledge required to perform the operation ? Not having the necessary knowledge in the field of performance may not necessarily be a bad thing ( Learning knowledge in this field is fast , If one day your query does not perform well , After a day or two, the result may be very different ), however , In the field of security , Everything is changing and will bite you faster than expected : Ignore a necessary aspect or mistakenly introduce , We can assure you , In the future, when data thieves knock on the door , You will remember your mistakes ( Consider the example of permissions : It is dangerous to grant too many permissions to a user , Only absolutely necessary permissions should be granted ).
In case of performance or safety problems , How do you know how to correct mistakes ? This is not as simple as it looks at first , So some extra knowledge will help .
PART 03
Consequences of performance and safety problems
SQL Performance and creation in the world 、 Read 、 Update or delete (CRUT) Performance related , Security is usually related to the overall security of database instances , But when something goes wrong , How to determine which previous actions are harmful to the database , Why? ?
Thank goodness , The answer is quite simple —— Look at the consequences of your recent actions , Look at the table below . The following table links the possible measures to be taken before the problem starts with the most likely consequences :

As you can see , When determining the operation that caused the problem , The result of a particular option should be a good starting point . Each option has its own benefits , But each option also has some impact , So first of all, we need to understand the steps that need to be taken , Evaluate available options , And choose carefully .
Learn everything you need to do , Especially in dealing with performance and security , Especially if you don't have much background knowledge in database field , It could be very difficult : under these circumstances , First , Find out what kind of database management system you are using , Then read the documentation in the field of performance or security ( Or both , Depends on the need ).
Once the combination of performance and security is determined , You can consider using it SQL client : The performance of queries is closely related to how they are built ,SQL The client can not only help build better SQL Inquire about , And good SQL The client provides a series of additional options , For example, options to share query results with the team , Thus, it becomes easy to deal with the data in the database instance .
PART 04
SQL Security and performance of the client
As mentioned earlier , Correctly constructed SQL The client has a very wide range of responsibilities , Including automatically completing queries 、 Generate charts according to the output of the query .
SQL The client not only makes it easier to adjust the performance of the database instance ( for example , Pay close attention to the table structure to ensure that the database always maintains high performance ), It also allows you to perform other operations , such as , Share written queries with colleagues or teammates . It's like this :


Use appropriate SQL When the client , Be able to access some very valuable information , For example, it helps you pay close attention to the database schema ( See above ), Help you deal with the most valuable data , Or automatically complete the query , To help you improve database performance .
Of course , The security of the database instance is still your responsibility : For small development teams , Passing the database security checklist is enough . perhaps , Take a look at the security part of the selected database management system , Because many security related options depend on which database management system is used .
A good combination of security and performance can fully protect you from threats , At the same time, avoid complaints from database developers or customers . If the database and web Application alignment , You should :
- Initial (root) Strong password lock is used for account
- Do not provide users with permissions beyond strictly necessary ( for example , Users who only read from the database should only have SELECT Authority, etc )
- By using firewalls or developers following appropriate security procedures , Can resist, for example SQL Injection and other basic security threats
- It can be completed quickly without hindering other operations web All the queries required by the application (SQL The client is very suitable for this situation : The client usually provides the millisecond time required to complete the query , therefore , If which query is slow , That's where it starts .)
- It will not reduce the user experience
Among the suggestions given above , If you can take even a small part as part of your daily work , Will help you in SQL Find a good combination of performance and security .
Of course, it's easier said than done , But follow the suggestions given in this article and the selected database management system documentation , Everything can become easy . Don't forget , In the realm of databases , The development and changes of things change with each passing day , What is useful today may not be useful tomorrow —— In order to achieve excellence , Expand knowledge in two areas , And take appropriate measures according to the specific situation .
边栏推荐
- js win7透明桌面切换背景开始菜单js特效
- Linux Installation MySQL (pit filling version)
- DOS common commands
- Use of DDR3 (axi4) in Xilinx vivado (2) read write design
- 数据挖掘(数据预处理篇)--笔记
- Three steps to teach you unity serial communication
- Unity package exe to read and write excel table files
- Linxu [basic instructions]
- Solve the problem that jupyter cannot import new packages
- [task02: SQL basic query and sorting]
猜你喜欢

One article makes you understand what typescript is

The product power is greatly improved, and the new Ford Explorer is released
![[C语言刷题篇]链表运用讲解](/img/44/1de4e3f0712780680fbdc904dfe39a.png)
[C语言刷题篇]链表运用讲解

The engineering practice of super large model was polished, and Baidu AI Cloud released the cloud native AI 2.0 solution

C语言简单实例 1

Talking about canvas and three rendering modes in unity

想画一张版权属于你的图吗?AI作画,你也可以

“当你不再是程序员,很多事会脱离掌控”—— 对话全球最大独立开源公司SUSE CTO...

激光slam:LeGO-LOAM---代码编译安装与gazebo测试
![[pytorch] LSTM neural network](/img/c8/c1f92e7d4da7f07b85abe481f025bc.png)
[pytorch] LSTM neural network
随机推荐
Database tuning - connection pool optimization
Music says
Three steps to teach you unity serial communication
Raspberry pie 3b ffmpeg RTMP streaming
Other IPS cannot connect to the local redis problem solving and redis installation
Unity package project to vs deploy hololens process summary
Teach you unity scene switching progress bar production hand in hand
一个程序员的水平能差到什么程度?尼玛,都是人才呀...
UE4 3dui widget translucent rendering blur and ghosting problems
Related concepts of multitasking programming
Linxu [basic instructions]
根据openGauss/MogDB的lwtid查看线程堆栈。
Regular symbol description
Talking about canvas and three rendering modes in unity
js可拖拽alert弹窗插件
Raspberry pie 4B ffmpeg RTMP streaming
Linxu [permission, sticky bit]
Solve the problem that the nocturnal simulator cannot access the Internet after setting an agent
Solve the problem that jupyter cannot import new packages
Use of DDR3 (axi4) in Xilinx vivado (3) module packaging