In 2019, there were an estimated 8 million data centers in the world. This includes all datacenters, from the small ones being constituted from a floor in an industrial building with a few hundreds/ thousands of servers, from the major ones that host million of servers for both GAFA (Google, Apple, Facebook, Amazon), Microsoft, BATX (Baidu, Alibaba, Tencent, Xiaoming), and includes static and mobile departments of defense of various countries in the world datacenters.
If you want to know more, please go here. This data was sourced from the book Transportation and the Belt and Road Initiative, in which more data as well as the original primary sources of the data are available.