-
Notifications
You must be signed in to change notification settings - Fork 321
new blog for parallel chunk uploads #2966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eldadfux
wants to merge
1
commit into
main
Choose a base branch
from
feat-fatser-uploads
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "stars": 55973, | ||
| "fetchedAt": "2026-05-04T21:03:24.879Z" | ||
| } | ||
| "stars": 55982, | ||
| "fetchedAt": "2026-05-05T10:41:28.857Z" | ||
| } | ||
131 changes: 131 additions & 0 deletions
131
src/routes/blog/post/faster-storage-uploads-parallel-chunks/+page.markdoc
This file contains hidden or 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,131 @@ | ||
| --- | ||
| layout: post | ||
| title: "Up to 2x faster Appwrite Storage uploads with parallel chunks" | ||
| description: Appwrite SDKs now upload Storage chunks in parallel on runtimes with native concurrency, tuned for real browsers and networks, often roughly 2x faster, with no API changes. | ||
| date: 2026-05-05 | ||
| cover: /images/blog/faster-storage-uploads-parallel-chunks/cover.png | ||
| timeToRead: 9 | ||
| author: eldad-fux | ||
| category: announcement | ||
| featured: false | ||
| --- | ||
|
|
||
| Uploading large files to [Appwrite Storage](/docs/products/storage) should feel snappy on a good connection and **bearable on real-world networks**. Until now, SDKs typically sent file chunks **one after another**. That approach is simple and reliable, but it leaves performance on the table. Each chunk waits for the previous one, so you rarely saturate bandwidth or use the browser's ability to run several HTTP requests in parallel. | ||
|
|
||
| We are releasing updated **Appwrite SDKs** that upload **multiple chunks at the same time**, with defaults tuned for **how browsers and HTTP clients actually behave**. In our benchmarks, uploads are often **about twice as fast** - and in many cases we see gains in the **roughly 100-200%** range depending on file size, latency, and network conditions. | ||
|
|
||
| We are adding this behavior to **all Appwrite SDKs that run on platforms with native concurrency support** - environments where the runtime can keep **several HTTP requests in flight at once** (for example overlapping requests via **async I/O** in JavaScript, Python, and Dart, or **goroutines** and similar primitives in other server stacks). If a target environment **cannot** overlap network calls in a supported way, the SDK continues to upload chunks **sequentially**, which remains correct but does not unlock the same throughput. | ||
|
|
||
| # Why sequential chunks cap your speed | ||
|
|
||
| Chunked uploads exist so large files do not need to live entirely in memory and so failures can be retried at chunk granularity. The tradeoff is that **strictly sequential** chunking means **underused bandwidth** (the connection often sits idle while the client waits on the next chunk), **latency stacked in series** (every chunk pays its own round trip one after another), and **browser limits left unused** (browsers allow multiple connections per origin, but a single in-flight upload does not use that capacity). | ||
|
|
||
| The server must accept chunks in a well-defined way and assemble a complete file safely. Making uploads parallel required **both** smarter clients **and** a backend that could handle **out-of-order** and **concurrent** chunk writes without corrupting metadata or final assembly. | ||
|
|
||
| # What we shipped | ||
|
|
||
| The same **establish-then-parallelize** pattern is implemented **everywhere the host runtime supports it**. Each SDK uses that language's native concurrency primitives so multiple chunk requests run together without blocking each other on the wire. The updated SDKs establish the upload - for example, by sending the **first chunk** in a controlled way to obtain an upload identifier - then upload **remaining chunks concurrently** up to a **fixed maximum parallelism**. We intentionally avoid "as many requests as possible," which can hurt performance or run into browser and server limits. | ||
|
|
||
| For **JavaScript-family** SDKs (Web, Node, React Native), testing under throttling and more realistic network conditions pointed to a **concurrency of eight** as a practical sweet spot. Higher concurrency is not always better. Beyond a point you contend for connections, CPU, and memory without gaining throughput. Other languages pick limits that fit their **runtime defaults and HTTP stacks**. The goal is the same everywhere - use **native concurrency** where it exists, instead of bolting on fragile custom thread pools at the application layer. | ||
|
|
||
| On the server, parallel uploads only work in production if the stack can accept chunks **in any order** (within the rules of the API), **assemble** the final file correctly when multiple workers are involved, and keep **metadata consistent** when several requests touch the same upload state at nearly the same time. We hardened the platform for exactly that. Chunk data can flow concurrently while **short, scoped critical sections** protect the small amount of state that must stay atomic - so you get **parallel throughput** without sacrificing **correctness** under load. | ||
|
|
||
| All of this stays **fully inside the Appwrite SDK**. Your integration keeps the same Storage upload calls and patterns as today; chunking, concurrency, and ordering on the wire are implementation details you do not configure or branch on. **Update to the latest Appwrite SDK** for your language or runtime and you inherit the faster uploads without rewriting upload code. | ||
|
|
||
| The examples below are the same **`createFile`** calls you use today. Point them at a large file, bump the SDK and server, and uploads get faster with **no extra parameters** for parallelism. Use the drop-down to switch between Web, Node.js, Python, and Flutter. | ||
|
|
||
| {% multicode %} | ||
| ```client-web | ||
| import { Client, Storage, ID } from 'appwrite'; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') | ||
| .setProject('<PROJECT_ID>'); | ||
|
|
||
| const storage = new Storage(client); | ||
|
|
||
| const uploaded = await storage.createFile({ | ||
| bucketId: 'videos', | ||
| fileId: ID.unique(), | ||
| file: document.getElementById('uploader').files[0] | ||
| }); | ||
| ``` | ||
| ```server-nodejs | ||
| import { Client, Storage, ID } from 'node-appwrite'; | ||
| import { InputFile } from 'node-appwrite/file'; | ||
|
|
||
| const client = new Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') | ||
| .setProject('<PROJECT_ID>') | ||
| .setKey('<API_KEY>'); | ||
|
|
||
| const storage = new Storage(client); | ||
|
|
||
| const uploaded = await storage.createFile({ | ||
| bucketId: 'videos', | ||
| fileId: ID.unique(), | ||
| file: InputFile.fromPath('./large-video.mp4', 'large-video.mp4') | ||
| }); | ||
| ``` | ||
| ```server-python | ||
| from appwrite.client import Client | ||
| from appwrite.services.storage import Storage | ||
| from appwrite.id import ID | ||
| from appwrite.input_file import InputFile | ||
|
|
||
| client = Client() | ||
| client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') | ||
| client.set_project('<PROJECT_ID>') | ||
| client.set_key('<API_KEY>') | ||
|
|
||
| storage = Storage(client) | ||
|
|
||
| uploaded = storage.create_file( | ||
| bucket_id='videos', | ||
| file_id=ID.unique(), | ||
| file=InputFile.from_path('./large-video.mp4'), | ||
| ) | ||
| ``` | ||
| ```client-flutter | ||
| import 'package:appwrite/appwrite.dart'; | ||
|
|
||
| final client = Client() | ||
| .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') | ||
| .setProject('<PROJECT_ID>'); | ||
|
|
||
| final storage = Storage(client); | ||
|
|
||
| final uploaded = await storage.createFile( | ||
| bucketId: 'videos', | ||
| fileId: ID.unique(), | ||
| file: InputFile.fromPath( | ||
| path: './large-video.mp4', | ||
| filename: 'large-video.mp4', | ||
| ), | ||
| ); | ||
| ``` | ||
| {% /multicode %} | ||
|
|
||
| # Numbers that match "real internet," not just localhost | ||
|
|
||
| Local benchmarks are misleading. Everything feels fast until you add **latency**, **loss**, and **variable bandwidth**. We focused on **throttled** and **staging-style** runs to approximate what your users see. | ||
|
|
||
| One representative large-file case is a **~256 MB** upload that dropped from on the order of **two minutes** to under **a minute** with parallel chunks and tuned concurrency - **in the ballpark of 2x faster** in that scenario. Across different file sizes and setups, we repeatedly saw improvements in the **~100-200%** range relative to the older sequential behavior. | ||
|
|
||
| Your mileage will vary with region, device, bucket location, and network. The consistent story is **materially faster uploads** without asking application developers to hand-roll concurrency. | ||
|
|
||
| # What you need to do | ||
|
|
||
| 1. **Upgrade** your Appwrite SDKs to the latest release that includes parallel chunked uploads (see the changelog for your language). No API migration - same methods and flows as before. | ||
| 2. **Ensure your Appwrite instance** is on a release that includes the server-side support for concurrent and out-of-order chunk handling (self-hosters should upgrade the platform, not only the SDK). | ||
|
|
||
| # Why this matters everywhere you upload | ||
|
|
||
| Whether the uploader runs in a **browser**, on a **phone**, or in a **backend job**, the wins show up whenever the SDK can use the runtime's **native concurrency** to overlap chunk uploads. You do not need different strategies per platform beyond upgrading the SDK and server. The same Storage API keeps working, with smarter client-side scheduling. | ||
|
|
||
| Faster uploads mean snappier dashboards, quicker backups, and less time staring at progress bars in mobile and web apps. By combining **parallel chunk uploads** in the SDKs with **realistic per-runtime concurrency limits** and a **server built for concurrent assembly**, we are delivering a clear step forward in performance - measured in **real-world conditions**, not only ideal lab networks. | ||
|
|
||
| # More resources | ||
|
|
||
| - [Appwrite Storage documentation](/docs/products/storage) | ||
| - [The easiest way to add file uploads to your app](/blog/post/easiest-file-uploads) |
This file contains hidden or 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,15 @@ | ||
| --- | ||
| layout: changelog | ||
| title: "Up to 2x faster Appwrite Storage uploads with parallel chunks" | ||
| description: Appwrite SDKs now upload Storage chunks in parallel on runtimes with native concurrency, often roughly 2x faster, with no API changes for developers. | ||
| date: 2026-05-05 | ||
| cover: /images/blog/faster-storage-uploads-parallel-chunks/cover.png | ||
| --- | ||
|
|
||
| Appwrite **SDKs** now upload **Storage** file chunks **in parallel** where the host runtime supports overlapping HTTP requests (for example Web, Node, React Native, Python, Dart, and other server SDKs). Chunking, concurrency limits, and ordering are handled **inside the client**; your **`createFile`** calls stay the same. | ||
|
|
||
| Self-hosted projects should run an Appwrite release that supports **concurrent and out-of-order** chunk assembly on the server. After that, **upgrade the SDK** to the latest version for your platform to pick up the faster uploads automatically. | ||
|
|
||
| {% arrow_link href="/blog/post/faster-storage-uploads-parallel-chunks" %} | ||
| Read the announcement | ||
| {% /arrow_link %} |
This file contains hidden or 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
2 changes: 2 additions & 0 deletions
2
src/routes/docs/references/[version]/[platform]/[service]/descriptions/storage.md
This file contains hidden or 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
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\ No newline at end of filein the diff). Both differ from the original file's formatting and can cause noisy future diffs or tool warnings. This file is likely auto-generated — if so, the generator should be the one to maintain consistent formatting.