Will using "Cloudflare Workers" benefit me?

Our project comprises of a VueJS app (front-end), NodeJS app (back-end), and a MongoDB database.
At the moment, all 3 are installed and run on a single server and everything works well.

Upon activating Cloudflare, the latency for JavaScript parsing actions increases from the usual 100ms to 3-4 seconds - which isn’t acceptable at all.

I do not have a very mature understanding of Cloudflare Workers yet but is it possible we could run our 2 JavaScript apps (VueJS and NodeJS) on the edge using Workers and only maintain the MongoDB on the server we currently host? Would this reduce the JavaScript parsing latency that I mention above? Is it possible to host the MongoDB within the Cloudflare cloud as well?

Expecting an elaborate explanation from the community here, thanks.

You’d need to first consider if Workers are appropriate for your project - they are not Node, they are V8 and therefore there’s some native Node APIs which aren’t available in a Worker. Some require polyfills and some don’t exist at all (i.e fs since Workers have no concept of a filesystem).

As far as talking to Mongo, that should be fine so long as it has a HTTP REST API in-front of it as Workers can only speak HTTP & WebSockets but no arbitrary TCP.

As for what’s causing your ‘parsing latency’ or if Workers will help that, it’s pretty hard to say without more information.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.