当前位置:网站首页>优化接口性能
优化接口性能
2022-07-03 10:58:00 【inexaustible】
接口优化的八个要点
数据量比较大,批量操作数据入库
耗时操作考虑异步处理
恰当使用缓存
优化程序逻辑、代码
SQL优化
压缩传输内容
考虑使用文件/MQ等其他方式暂存,异步再落地DB
跟产品讨论需求最恰当,最舒服的实现方式
一、数据量比较大,批量操作数据入库
优化前:
//for循环单笔入库
for(TransDetail detail:list){
insert(detail);
}优化后:
// 批量入库,mybatis demo实现
<insert id="insertBatch" parameterType="java.util.List">
insert into trans_detail( id,amount,payer,payee) values
<foreach collection="list" item="item" index="index" separator=",">(
#{item.id}, #{item.amount},
#{item.payer},#{item.payee}
)
</foreach>
</insert>二、耗时操作考虑异步处理</
边栏推荐
- This article explains the complex relationship between MCU, arm, MCU, DSP, FPGA and embedded system
- Programmers' entrepreneurial trap: taking private jobs
- ASP. Net hotel management system
- Excel快速跨表复制粘贴
- Encapsulate a koa distributed locking middleware to solve the problem of idempotent or repeated requests
- CSRF
- Key switch: press FN when pressing F1-F12
- The R language uses the hist function in the native package (basic import package, graphics) to visualize the histogram plot
- DS90UB949
- Software testing weekly (issue 78): the more confident you are about the future, the more patient you are about the present.
猜你喜欢

Solve undefined reference to`__ aeabi_ Uidivmod 'and undefined reference to`__ aeabi_ Uidiv 'error

After a month, I finally got Kingdee offer! Share tetrahedral Sutra + review materials

聊聊Flink框架中的状态管理机制

STL教程10-容器共性和使用场景

This article explains the complex relationship between MCU, arm, MCU, DSP, FPGA and embedded system

uniapp scroll view 解决高度自适应、弹框滚动穿透等问题。

2022 northeast four provinces match VP record / supplementary questions

FL Studio 20 unlimited trial fruit arranger Download

After using the thread pool for so long, do you really know how to reasonably configure the number of threads?

软考中级软件设计师该怎么备考
随机推荐
一文搞懂Go语言Context
2022 northeast four provinces match VP record / supplementary questions
R language uses grid of gridextra package The array function combines multiple visual images of the ggplot2 package horizontally, and the ncol parameter defines the number of columns of the combined g
The manuscript will be revised for release tonight. But, still stuck here, maybe what you need is a paragraph.
Use typora to draw flow chart, sequence diagram, sequence diagram, Gantt chart, etc. for detailed explanation
Technical experts from large factories: how can engineers improve their communication skills?
Oracle 11g single machine cold standby database
STL教程10-容器共性和使用场景
Leetcode 46: full arrangement
Bi skills - permission axis
Double linked list of linear list
Analysis of JMM memory model
DS90UB949
How to clean up v$rman_ backup_ job_ Details view reports error ora-02030
Empire CMS no thumbnail smart tag (e:loop) two ways to judge whether there is a titlepic
Stm32hal library upgrades firmware based on flash analog U disk (detailed explanation)
How to become a senior digital IC Design Engineer (1-4) Verilog coding syntax: expression
Google Earth engine (GEE) -- when we use the front and back images to make up for the interpolation effect, what if there is no effect?
How to become a senior digital IC Design Engineer (1-3) Verilog coding syntax: Verilog behavior level, register transfer level, gate level (abstract level)
asyncio 警告 DeprecationWarning: There is no current event loop