[20221018]本地運行與遠程運行.txt

来源:https://www.cnblogs.com/lfree/archive/2022/10/20/16808784.html
-Advertisement-
Play Games

定義:select語句中嵌套select語句,被嵌套的select語句是子查詢。 子查詢可以出現在: select ....(select).. from ....(select).. where ....(select).. 1.where後面嵌套子查詢 select * from emp whe ...


[20221018]本地運行與遠程運行.txt

--//鏈接http://blog.tanelpoder.com/2008/02/05/oracle-hidden-costs-revealed-part-1/.
--//裡面提到一個問題本地運行與遠程運行,oracle性能存在怎麼區別,理論講如果不考慮網路傳輸,兩組差別不大.
--//因為Oracle是一個客戶端伺服器資料庫系統。所有的執行都是在本地執行的,而不管客戶機的位置如何,因此性能是相同的。
--//作者給出一個例子,說明一些區別:

1.環境:
SCOTT@book> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.分別從widnows客戶端以及linux服務端測試看看.
--//註:lotslios.sql 來自 tpt 裡面的測試腳本.
--//測試在本地伺服器.
SCOTT@book> @spid
       SID    SERIAL# PROCESS                  SERVER    SPID       PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- ------ ------- ---------- --------------------------------------------------
        36      45801 14705                    DEDICATED 14706       26        206 alter system kill session '36,45801' immediate;

SCOTT@book> set timing on
SCOTT@book> @lotslios 1e8
generate lots of LIOs by repeatedly full scanning through a small table...
  COUNT(*)
----------
 100000000
Elapsed: 00:00:08.11
--//註:@lotslios 1e5根本測試不出來.

--//測試在客戶端windows:
SCOTT@78> @spid
       SID    SERIAL# PROCESS                  SERVER    SPID                     PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
        53      44367 4476:8736                DEDICATED 14714                     27        144 alter system kill session '53,44367' immediate;

SCOTT@78>  set timing on
SCOTT@78> @tpt/lotslios 1e8
generate lots of LIOs by repeatedly full scanning through a small table...
  COUNT(*)
----------
 100000000
Elapsed: 00:00:10.40

--//你可以運行多次,都是windows下測試時間大於在本地伺服器的測試時間.
--//作者通過使用他自己寫Snapper包以及V$SESSTAT,看不出任何差異.
--//使用strace跟蹤(註:作者的伺服器solaris,使用truss).
--//測試在本地伺服器,使用strace跟蹤服務端進程.
$ strace -cp 14706
Process 14706 attached - interrupt to quit
^CProcess 14706 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
   nan    0.000000           0         2           read
   nan    0.000000           0         2           write
   nan    0.000000           0        27           getrusage
   nan    0.000000           0        10           times
------ ----------- ----------- --------- --------- ----------------
100.00    0.000000                    41           total

--//測試在客戶端windows,使用strace跟蹤服務端進程.
$ strace -cp 14714
Process 14714 attached - interrupt to quit
^CProcess 14714 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 96.13    0.024820           0    949593           poll
  3.87    0.001000         500         2           read
  0.00    0.000000           0         2           write
  0.00    0.000000           0        83           getrusage
  0.00    0.000000           0        10           times
------ ----------- ----------- --------- --------- ----------------
100.00    0.025820                949690           total
--//很慢!!我不得按ctrl+c停止strace,你可以發現大量調用poll.
--//可以發現測試在客戶端windows,多了一個poll 系統調用,作者測試平臺solaris,調用的是pollsys.

# man -a pool
POLL(2)                    Linux Programmer's Manual                   POLL(2)

NAME
       poll, ppoll - wait for some event on a file descriptor

SYNOPSIS
       #include <poll.h>

       int poll(struct pollfd *fds, nfds_t nfds, int timeout);

       #define _GNU_SOURCE
       #include <poll.h>

       int ppoll(struct pollfd *fds, nfds_t nfds,
               const struct timespec *timeout, const sigset_t *sigmask);


--//轉載:http://blog.tanelpoder.com/2008/02/05/oracle-hidden-costs-revealed-part-1/.
So, there is a big difference in number of pollsys() system calls, depending on which client was used for connecting.
The pollsys syscall is normally used for checking whether there is any data that can be read from a file descriptor (or
whether the file descriptor is ready for receiving more writes). As TCP sockets on Unix are also accessed through file
descriptors, Oracle could be polling the client TCP connection file descriptor… but (without prior knowledge) we can
not be sure.
因此,pollsys()系統調用的數量有很大的差異,這取決於用於連接的客戶端。pollsys系統通常用於檢查是否有可以從文件描述符讀取的
數據(或者文件描述符是否準備好接收更多的寫操作)。由於Unix上的TCP套接字也可以通過文件描述符訪問,Oracle可以輪詢客戶端TCP連
接文件描述符…但是(沒有事先知識)我們不能確定。

...

Oracle client server communication normally works in RPC fashion – for example a client sends a command to Oracle and
Oracle doesn't return anything until the command is completed.
Oracle客戶端伺服器通信通常以RPC的方式工作——例如,客戶端向Oracle發送一個命令,而Oracle在該命令完成之前不會返回任何東西


Now if a user tries to cancel their query (using CTRL+C in sqlplus or calling OCIBreak in non-blocking OCI), a cancel
packet is sent to server over TCP. The packet will be stored in the server side receive buffer of OS TCP stack and
becomes available for reading for the server process (via a TCP socket). However if the server process is in a
long-running loop executing a query, it needs to periodically check the TCP receive socket for any outstanding packets.
And this is exactly what the pollsys() system call does.
現在,如果用戶試圖取消他們的查詢(在sqlplus中使用CTRL+C或在非阻塞OCI中調用OCIBreak),一個取消數據包將通過TCP發送到伺服器
。該數據包將存儲在OS TCP堆棧的伺服器端接收緩衝區中,並可為伺服器進程讀取(通過TCP套接字)。但是,如果伺服器進程處於執行查詢
的長時間運行的迴圈中,那麼它需要定期檢查TCP接收套接字中是否有任何未完成的數據包。這正是pollsys()系統所做的。

This approach for cancelling an operation is called in-band break, as the break packet is sent in-band with all other
traffic. The server process has to be programmed to periodically check for any newly arrived packets, even if it is
already busy working on something else.
這種取消操作的方法稱為in-band break,因為中斷包與所有其他業務一起在帶內發送。伺服器進程必須被編程,以定期檢查任何新到達
的數據包,即使它已經在忙於處理其他事情。

There are several functions in Oracle kernel where the developers have put the check for in-band breaks. This means that
in some highly repetitive operations (like nested loop join) the same functions are hit again and again – causing
frequent polling on the TCP socket. And too frequent polling is what causes the peformance degradation.
在Oracle內核中有幾個函數,開發人員可以檢查in-band breaks。這意味著在一些高度重覆的操作(如嵌套迴圈連接)中,相同的函數會被
反覆命中,導致TCP套接字上頻繁輪詢。而過頻繁的輪詢是導致性能下降的原因。

However Oracle network layer has a sqlnet.ora parameter called break_poll_skip, which can help in such situations. This
parameters defines, how many times to just silently skip the TCP socket polling when the nsmore2recv() function is
called. The parameter defaults to 3 in recent versions, which means that only 1 of 3 polls are actually executed ( from
above test case it's seen that for 4 million consistent gets roughly 1/3 = 1.3 million pollsys() calls were executed ).
然而,Oracle網路層有一個名為break_poll_skip的sqlnet.ora參數,這可以在這種情況下提供幫助。此參數定義了當調用nsmore2recv()
函數時,只需無聲地跳過TCP套接字輪詢的次數。在最近的版本中,參數預設為3,這意味著實際3個輪詢中只有1個被執行(從上面的測試
用例可以看出,400萬一致得到大約1/3=130萬個民調系統()調用)。

--//換成執行lotslios 1e5,再使用strace跟蹤看看.
--//測試在本地伺服器,使用strace跟蹤服務端進程.
$ strace -cp 14706
Process 14706 attached - interrupt to quit
^CProcess 14706 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
   nan    0.000000           0         2           read
   nan    0.000000           0         2           write
   nan    0.000000           0        19           getrusage
   nan    0.000000           0        10           times
------ ----------- ----------- --------- --------- ----------------
100.00    0.000000                    33           total

--//測試在客戶端windows,使用strace跟蹤服務端進程.
$ strace -cp 14714
Process 14714 attached - interrupt to quit
^CProcess 14714 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.000018           0       897           poll
  0.00    0.000000           0         2           read
  0.00    0.000000           0         2           write
  0.00    0.000000           0        19           getrusage
  0.00    0.000000           0        10           times
------ ----------- ----------- --------- --------- ----------------
100.00    0.000018                   930           total
--//poll=897次.

SCOTT@78> set autot traceonly
SCOTT@78> @tpt/lotslios 1e5
generate lots of LIOs by repeatedly full scanning through a small table...
Elapsed: 00:00:00.06
Execution Plan
---------------------------
Plan hash value: 3691747574
-------------------------------------------------------------------------------
| Id  | Operation              | Name | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |      |     1 |    12 |    23P  (1)|999:59:59 |
|   1 |  SORT AGGREGATE        |      |     1 |    12 |            |          |
|*  2 |   COUNT STOPKEY        |      |       |       |            |          |
|   3 |    NESTED LOOPS        |      |  2401P|    15E|    23P  (1)|999:59:59 |
|   4 |     NESTED LOOPS       |      |    79T|   650T|   769G  (1)|999:59:59 |
|   5 |      NESTED LOOPS      |      |  2631M|    14G|    25M  (1)| 84:57:18 |
|   6 |       TABLE ACCESS FULL| OBJ$ | 87098 |   255K|   295   (1)| 00:00:04 |
|*  7 |       TABLE ACCESS FULL| OBJ$ | 30210 | 90630 |   293   (1)| 00:00:04 |
|*  8 |      TABLE ACCESS FULL | OBJ$ | 30210 | 90630 |   293   (1)| 00:00:04 |
|*  9 |     TABLE ACCESS FULL  | OBJ$ | 30210 | 90630 |   293   (1)| 00:00:04 |
-------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - filter(ROWNUM<=1e5)
   7 - filter("A"."OWNER#"="B"."OWNER#")
   8 - filter("B"."OWNER#"="C"."OWNER#")
   9 - filter("C"."OWNER#"="D"."OWNER#")
Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
       2706  consistent gets
          0  physical reads
          0  redo size
        346  bytes sent via SQL*Net to client
        471  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed

--//按照作者介紹break_poll_skip預設3, consistent gets/3 = 2706/3= 902,與跟蹤看到的897接近.
--//順便提一下,不知道作者如何測試的,@lotslios 10000,consistent gets達到了4089670.或許11.2.0.4執行計劃發生了變化.疑問??
--//因為返回是count(*),僅僅1行.即使設置arraysize=2 ,邏輯讀我的測試也是2706
--//可以通過改變break_poll_skip的sqlnet.ora參數,減少poll調用.

3.改變break_poll_skip參數在sqlnet.ora文件中.
--//修改break_poll_skip=10,註意測試時要重新登錄才生效!!

SCOTT@78> @ spid
       SID    SERIAL# PROCESS                  SERVER    SPID                     PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
        53      44369 5380:8500                DEDICATED 15041                     27        145 alter system kill session '53,44369' immediate;

SCOTT@78> set timing on
SCOTT@78> @tpt/lotslios 1e5
generate lots of LIOs by repeatedly full scanning through a small table...
  COUNT(*)
----------
    100000

Elapsed: 00:00:00.04

$ strace -cp 15041
Process 15041 attached - interrupt to quit
^CProcess 15041 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
   nan    0.000000           0         2           read
   nan    0.000000           0         2           write
   nan    0.000000           0       269           poll
   nan    0.000000           0        19           getrusage
   nan    0.000000           0        10           times
------ ----------- ----------- --------- --------- ----------------
100.00    0.000000                   302           total
--//2706/10 = 270.6,poll調用269,已經非常接近.

SCOTT@78> @tpt/lotslios 1e8
generate lots of LIOs by repeatedly full scanning through a small table...
  COUNT(*)
----------
 100000000
Elapsed: 00:00:09.99
--//比前面10.40快了一點點.

--//修改break_poll_skip=1000
$ grep break sqlnet.ora
break_poll_skip=1000

SCOTT@78> @ spid
       SID    SERIAL# PROCESS                  SERVER    SPID                     PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
        53      44371 4544:8592                DEDICATED 15081                     27        146 alter system kill session '53,44371' immediate;

SCOTT@78> set timing on
SCOTT@78> @tpt/lotslios 1e8
generate lots of LIOs by repeatedly full scanning through a small table...
  COUNT(*)
----------
 100000000
Elapsed: 00:00:09.65

SCOTT@78> @tpt/lotslios 1e5
generate lots of LIOs by repeatedly full scanning through a small table...
  COUNT(*)
----------
    100000

Elapsed: 00:00:00.04
$ strace -cp 15081
Process 15081 attached - interrupt to quit
^CProcess 15081 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
   nan    0.000000           0         2           read
   nan    0.000000           0         2           write
   nan    0.000000           0         3           poll
   nan    0.000000           0        19           getrusage
   nan    0.000000           0        10           times
------ ----------- ----------- --------- --------- ----------------
100.00    0.000000                    36           total

--//補充測試@tpt/lotslios 1e8:
SCOTT@78> @tpt/lotslios 1e8
generate lots of LIOs by repeatedly full scanning through a small table...
  COUNT(*)
----------
 100000000
Elapsed: 00:00:09.98

$ strace -cp 15081
Process 15081 attached - interrupt to quit
^CProcess 15081 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.000066           0      2849           poll
  0.00    0.000000           0         2           read
  0.00    0.000000           0         2           write
  0.00    0.000000           0        29           getrusage
  0.00    0.000000           0        10           times
------ ----------- ----------- --------- --------- ----------------
100.00    0.000066                  2892           total

SCOTT@78> set autot traceonly
SCOTT@78> @tpt/lotslios 1e8
SCOTT@78> set autot traceonly
SCOTT@78> @tpt/lotslios 1e8
generate lots of LIOs by repeatedly full scanning through a small table...

Elapsed: 00:00:09.68

Execution Plan
----------------------------------------------------------
Plan hash value: 3691747574

-------------------------------------------------------------------------------
| Id  | Operation              | Name | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |      |     1 |    12 |    23P  (1)|999:59:59 |
|   1 |  SORT AGGREGATE        |      |     1 |    12 |            |          |
|*  2 |   COUNT STOPKEY        |      |       |       |            |          |
|   3 |    NESTED LOOPS        |      |  2401P|    15E|    23P  (1)|999:59:59 |
|   4 |     NESTED LOOPS       |      |    79T|   650T|   769G  (1)|999:59:59 |
|   5 |      NESTED LOOPS      |      |  2631M|    14G|    25M  (1)| 84:57:18 |
|   6 |       TABLE ACCESS FULL| OBJ$ | 87098 |   255K|   295   (1)| 00:00:04 |
|*  7 |       TABLE ACCESS FULL| OBJ$ | 30210 | 90630 |   293   (1)| 00:00:04 |
|*  8 |      TABLE ACCESS FULL | OBJ$ | 30210 | 90630 |   293   (1)| 00:00:04 |
|*  9 |     TABLE ACCESS FULL  | OBJ$ | 30210 | 90630 |   293   (1)| 00:00:04 |
-------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(ROWNUM<=1e8)
   7 - filter("A"."OWNER#"="B"."OWNER#")
   8 - filter("B"."OWNER#"="C"."OWNER#")
   9 - filter("C"."OWNER#"="D"."OWNER#")


Statistics
----------------------------------------------------------
         12  recursive calls
          0  db block gets
    2859366  consistent gets
          0  physical reads
          0  redo size
        346  bytes sent via SQL*Net to client
        471  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          2  sorts (memory)
          0  sorts (disk)
          1  rows processed

--//2859366/1000= 2859.366

3.收尾:
--//取消break_poll_skip設置.
$ grep break sqlnet.ora
#break_poll_skip=1000

--//補充說明如果break_poll_skip設置10,100,使用strace跟蹤很慢.
--//break_poll_skip=100
SCOTT@78> @tpt/lotslios 1e8
generate lots of LIOs by repeatedly full scanning through a small table...
  COUNT(*)
----------
 100000000
Elapsed: 00:00:16.32
--//2859358  consistent gets

$ strace -cp 15165
Process 15165 attached - interrupt to quit
^CProcess 15165 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.000052           0     28487           poll
  0.00    0.000000           0         5           read
  0.00    0.000000           0         5           write
  0.00    0.000000           0         1           lseek
  0.00    0.000000           0        46           getrusage
  0.00    0.000000           0        26           times
------ ----------- ----------- --------- --------- ----------------
100.00    0.000052                 28570           total


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 如何修改屏幕解析度?switchresx mac是一款Mac上實用的屏幕解析度修改工具,快速的幫助您更改Mac顯示屏的解析度。操作界面簡單,採用嵌套的上下文菜單管理,更加方便您控制修改解析度的尺寸。 詳情:SwitchResX for Mac(屏幕解析度修改工具) 功能介紹 1、偏好窗格 switc ...
  • log-Client:10.0.0.12 log-Server:10.0.0.11 mysql:10.0.0.13 實現步驟: 啟用網路日誌服務的配置: https://www.cnblogs.com/heyongshen/p/16808684.html 1.在rsyslog伺服器上安裝連接mysq ...
  • 想要一款圖像調色軟體?小編為大家推薦Image 2 LUT Pro Mac版,一款專業的圖像調色小工具。Image 2 LUT Pro Mac版提供了一些非常有用的選項。除了著色的一般強度,您還可以控制其對圖像中膚色的影響。Image 2 LUT Pro Mac不需要專業的調試技術,幾個簡單的步驟就 ...
  • Linux下載安裝jdk1.8 一、下載 wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/o ...
  • rsyslog 系統日誌服務 rsyslog服務是CentOS 6 以後版本的系統日誌管理服務。 特點: 性能高、安全性好、基於模塊化設計 官方網站: https://www.rsyslog.com/ rsyslog系統日誌術語 facility:設施,從功能或程式上對日誌進行歸類 Priority ...
  • 什麼是資料庫事務? 事務,就是一系列操作的整體,其結果就是這一系列操作要麼全部成功,要麼全部失敗。 譬如說,一個經典的例子--轉賬。 A要轉帳給B 100塊錢,要經歷以下步驟: 1、扣除A賬戶100塊錢。 2、增加B賬戶100塊錢。 以上例子里的兩個步驟,要麼全部成功,要麼全部失敗,不然,就亂套了。 ...
  • 某能源企業成立於2008年,是成品油銷售領域的龍頭企業(以下簡稱“A企業”),由中外合資設立。A企業立足於陝西省及周邊地區,重點開展加油站運營管理及相關業務。目前在陝西、山西、河南、內蒙古自治區運營油站超過600座,會員超過600萬,每天為超過22萬名顧客提供高品質的燃油服務。 ...
  • where 子句,通常用於在找尋數據的時候做一個條件篩選,得到滿足條件的記錄行數; 註意:新增(insert)不能做篩選; where 子句中常見的運算符有如下幾種: 1. 比較運算符:> >= < <= != = 2. 算術運算符:+ - * / 3. 邏輯運算符:&(邏輯與——語法:and);| ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...