-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(docs): Added workers page for edge limitations
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: Workers | ||
description: Nitro provides out of the box support for deploying to Edge Workers. | ||
--- | ||
|
||
## Deploy to Workers | ||
|
||
Nitro provides out of the box support for deploying to different Edge Worker offerings as well as service workers. | ||
|
||
- [cloudflare](/deploy/providers/cloudflare#cloudflare-workers) | ||
- [vercel](/deploy/providers/vercel#vercel-edge-functions) | ||
- service-workers ([switch to this preset](/deploy/#changing-the-deployment-preset)) | ||
|
||
::alert{type="warning"} | ||
**Limitations** | ||
:br | ||
Deploying to edge workers has some limitations. See [limitations](/deploy/workers/#limitations) for more details. | ||
:: | ||
|
||
### Limitations | ||
|
||
- No support for raw TCP/IP traffic | ||
- Execution time is limited compared to classic serverless offerings (normally 15-30 seconds) | ||
- Limited access to storage | ||
|
||
> You can use the [unstorage](/guide/introduction/storage) driver `cloudflare-kv-http` or `cloudflare-kv-bindings` for Cloudflare workers | ||
- Size is very limited (normally a few MBs) | ||
- Limited or no access to Node.js APIs | ||
- [Cloudflare Workers APIs](https://developers.cloudflare.com/workers/runtime-apis) | ||
- [Vercel Edge Functions APIs](https://vercel.com/docs/concepts/functions/edge-functions/edge-functions-api) | ||
|
||
### Incompatible libraries | ||
|
||
::alert{type="info"} | ||
**Help us** | ||
:br | ||
If you come across a library that you assume to be incompatible with edge workers, please open an issue on the [nitro repo](https://github.com/unjs/nitro/issues/new/choose) and help us keeping this list up to date. | ||
:: | ||
|
||
The following libraries are known to be incompatible with edge workers because of one of the above mentioned limitations: | ||
|
||
- `mongodb` | ||
|
||
> There are possible fixes for MongoDB, like using Realm and the [Realm SDK](https://www.mongodb.com/docs/realm/sdk/node/) or | ||
> using http interfaces (only available when self hosting MongoDB), but these are untested. | ||
- `mysql` | ||
|
||
> You can find an example with a modified MySQL driver [here](https://github.com/cloudflare/worker-template-mysql) | ||
- `rhea` | ||
- `gremlin` | ||
- `ioredis` | ||
- `cassandra-driver` | ||
- `kafkajs` |