Workers - China - Baidu

Are CloudFlare Workers available in China ?

I saw that CloudFlare partners with Baidu.

Baidu proposes OpenEdge which seems to be a solution of Edge Computing.

I wondered if CloudFlare Workers were also deployed on Baidu’s infrastructure ?

  1. When a static asset is pushed to CloudFlare, is it copied to Baidu Cloud ?
  2. When a worker is pushed to CloudFlare, is it copied to Baidu Cloud ?
  3. When a worker is called, but user is in China, does it call a Baidu Cloud worker ?
  4. When a CloudFlare worker writes data into KV, is it copied to a Baidu Cloud KV equivalent ?
  5. When a Baidu Cloud worker writes data into its KV equivalent, is it copied to CloudFlare KV ?

Picking a China provider on your own means:

  • Siloting urls : Administrate a dedicated url for China
  • Siloting codebases : Redevelop a “non-V8 isolates” Javascript code for China
  • Siloting databases: Writes on USA would not be reflected in China and vice-versa

I feel you, getting Cloudflare to work and be reliable in China would unlock a lot of conveniences. While you might get it to work from big cities in China, the larger part of the rural areas will cause issues. That’s why I suggest Ali Cloud, because their CDN and amount of datacenters reach a much larger part of China.

If you want to spend time and money on getting Cloudflare workers to work in China, then just you’d have to do tests from several China locations. Otherwise you’re just guessing as to what reach/performance you’ll have. (Unless Cloudflare can provide detailed answers, which I’ve been unable to find)

On Ali Cloud, there’s not much guessing, it’s their home turf and they know what they are doing.

1 Like

Marketshares mean nothing.
Network means everything.

Population density map

CloudFlare + Baidu Cloud

In 2015, CloudFlare partnering with Baidu Cloud claimed to manage 62 data center locations, including 17 data centers in mainland China:

Today, we're proud to announce our partnership with Baidu as well as the launch of 17 data centers across mainland China (...) Globally, CloudFlare’s network now extends to 62 data center locations

In 2020, Baidu CDN claimed 1000+ nodes in Mainland China:

Baidu Smart Cloud CDN supports 1000+ domestic nodes

https://cloud.baidu.com/product/cdn.html

http://baidu.netnic.com.cn/doc/CDN/ProductDescription/27.5CCDN.E8.8A.82.E7.82.B9.E5.88.86.E5.B8.83.html

… Which seems quite good.

Alibaba Cloud

In 2020, Alibaba Cloud claimed in to manage 63 availability zones in 21 regions, including 9 regions in Mainland China, for a total of 2300+ China Nodes:

Alibaba Cloud operates 63 availability zones in 21 regions (...) 2300+ China Nodes

https://www.alibabacloud.com/global-locations

… So 1300 more nodes in Mainland China claimed by Alibaba Cloud, than Baidu Cloud. That said, Alibaba Cloud seems unable to show all these nodes on a map.

In 2017, Cloudbility published a quick comparison on Alibaba Cloud, Baidu Cloud and Tencent Cloud

https://www.cloudbility.com/club/2989.html

Conclusion

Semantic difference between datacenter locations (CloudFlare), availability zones / regions (Alibaba Cloud), nodes (Baidu / Alibaba Cloud) are unclear. Not sure we can 100% compare (HDD/SSD, processor, software, speed connexion between nodes, …etc.), but at least it gives an idea.

Benchmarks would be interesting to compare real performance.
Then, real performance would have to be put in the perspective of siloting the Cloud between USA and China, which would be time consuming in terms of management, and unable to support global features.

In my use case, a global social network currently in development, I would grade higher a “Unified Cloud”, rather than a simple nodes count leading to a Cloud split. This is especially true since application in question is an offline-first PWA. It will be massively cached on client-side (browser). But there will still be bits of dynamic content downloaded through the network, for search engine results, messages, etc. It means CDN performance is the second more important factor.

I just see how the great firewall and censorship could be an issue, if the cloud reside in China and is not globally distributed, that will probably make things a lot easier. Take the Cloudflare Workers KV for example, does China has it’s own central KV store? What happens if it can’t be distributed to the rest of the world? How will users access the sites/data then? I’m not saying go with Ali Cloud, more saying, traditional servers rather than distributed might work better.

That is exactly what I would like to know.
How data can be exchanged / replicated in one direction or another.

Siloting China ?

I was unable to find information that Workers or KV where replicated in China, nor communication of { static assets or KV } was bi-directional.

It means for now I have to suppose that:

  • China has no Workers-equivalent feature
  • China static assets or KV-equivalent stay in China
  • China is an isolated region
  • China have to be processed separately
  • There is no need to keep a common url

And so on:

  • Siloted urls : Administrate a dedicated url for China
  • Siloted codebases : Redevelop a “non-V8 isolates” Javascript code for China
  • Siloted databases: Writes on USA will not be reflected in China and vice-versa

In addition, I saw that static sites are using Workers KV storage.

Problem is Workers KV storage is:

If we add benchmarks that show CloudFlare performs a little bit slower in average in comparison to GCP when it comes to CDN performance: https://www.cdnperf.com/cdn-compare?type=performance&location=world&cdn=cloudflare-cdn,google-cloud-cdn

I come to these conclusions:

  • Separate urls:
    • 1 url outside China
    • 1 url inside China
  • CDN provider outside China : GCP
  • Functions provider outside China
    • if CloudFlare is able to perf R/W in Cloud Storage: CloudFlare Workers
    • if CloudFlare is unable to perf R/W in Cloud Storage: Cloud Run
  • CDN provider inside China : TBD
  • Functions provider inside China : TBD

It’s important to see that even if CloudFlare Workers are fast, communicating with Cloud Storage will be done over the Internet and not inside CloudFlare or GCP networks, so ms gains by using Edge computing might be nullified by such a communication over the Internet.

I think CloudFlare Workers, or CloudFlare enabling China traffic were really good ideas, but the whole picture seems, as of 2020, incomplete.

2 Likes

I’ve spent a fair bit of time looking at performance in China. From what I have seen, if you can keep a request in China, performance will be pretty solid. As soon as it has to transit the “Great Firewall”, it becomes a mess; very inconsistent performance and reliability. I have tried a lot of different combinations of CDN and hosting provider, trying to understand it and improve it, and frankly I’m more confused now than when I started. I think you’ll be okay with GCP, somehow they get a pretty reliable connection out of there; AWS is pretty solid, too, from what I’ve seen… it’s possible I was just lucky in both cases, of course, but I continually tested over a few month timespan.

I think you’re on the right track. If you are starting from scratch and can manage it, a separate domain/site for China, hosted in China is the way to go. Unfortunately, not everyone can do that, and in that case, the goal should be to create as simple of a site as possible; assume a certain number of requests will randomly fail or have performance issues. Don’t rely on 3rd parties to deliver your content, manage the delivery yourself. Optimize everything, send as few bytes as you can, cache as much as you can in China.

I’m not sure how much I can talk about my experiences with Cloudflare in China, but it is true that some features there are either not supported or not recommended. As an example, Argo isn’t available there; that implies a few things, some of which aren’t obvious – sites exposed via an Argo Tunnel in the US are not available in China, for example. Overall, I like their strategy, partnering with providers in China, and the experience has been good. There’s definitely some bumps that I hope they’ll iron out. I’m hoping that the recent announcement of the partnership with JD is a sign that they are interested in improving their presence in China.

2 Likes

Thanks for this feedback !