Skip to content
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

Appwrite Network #1484

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PUBLIC_APPWRITE_COL_MESSAGES_ID=
PUBLIC_APPWRITE_COL_THREADS_ID=
PUBLIC_APPWRITE_DB_MAIN_ID=
PUBLIC_APPWRITE_FN_TLDR_ID=
PUBLIC_APPWRITE_DASHBOARD=
PUBLIC_APPWRITE_ENDPOINT=
PUBLIC_APPWRITE_PROJECT_ID=
PUBLIC_APPWRITE_PROJECT_INIT_ID=
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Appwrite Website has been built with the following frameworks:

## Development

_If this is your first time setting up the repository, please run `pnpm install` inside the repo's directory._
_If this is your first time setting up the repository, please run `pnpm install` inside the repo's directory and create a `.env` file based on `.env.example`._

To get the repo up and running in your local environment, use the following command:

Expand Down
1,702 changes: 833 additions & 869 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions src/routes/docs/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,28 @@
<p class="text-sub-body mt-1">Respond to server events in realtime.</p>
</a>
</li>
<li>
<a href="/docs/products/storage" class="web-card is-normal">
<img
src="/images/icons/illustrated/dark/storage.png"
alt=""
class="web-u-only-dark"
width="40"
height="40"
/>
<img
src="/images/icons/illustrated/light/storage.png"
alt=""
class="web-u-only-light"
width="40"
height="40"
/>
<h4 class="text-sub-body text-primary mt-2 font-medium">Network</h4>
<p class="text-sub-body mt-1">
Global infrastructure for serverless compute.
</p>
</a>
</li>
</ul>
</div>
</section>
Expand Down
7 changes: 7 additions & 0 deletions src/routes/docs/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
icon: 'icon-folder',
isParent: true
},
{
label: 'Network',
href: '/docs/products/network',
icon: 'icon-share',
isParent: true,
new: true,
},
{
label: 'AI',
href: '/docs/products/ai',
Expand Down
72 changes: 72 additions & 0 deletions src/routes/docs/products/network/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<script lang="ts">
import Docs from '$lib/layouts/Docs.svelte';
import Sidebar, { type NavParent, type NavTree } from '$lib/layouts/Sidebar.svelte';

const parent: NavParent = {
href: '/docs',
label: 'Network'
};

const navigation: NavTree = [
{
label: 'Getting started',
items: [
{
label: 'Overview',
href: '/docs/products/network'
}
]
},
{
label: 'Concepts',
items: [
{
label: 'Regions',
href: '/docs/products/network/regions'
},
{
label: 'Edges',
href: '/docs/products/network/edges'
},
{
label: 'CDN',
href: '/docs/products/network/cdn'
},
{
label: 'Endpoints',
href: '/docs/products/network/endpoints'
}
]
},
{
label: 'Features',
items: [
{
label: 'DDoS mitigation',
href: '/docs/products/network/ddos'
},
{
label: 'TLS',
href: '/docs/products/network/tls'
},
{
label: 'WAF',
href: '/docs/products/network/waf'
},
{
label: 'Compression',
href: '/docs/products/network/compression'
},
{
label: 'Caching',
href: '/docs/products/network/caching'
}
]
}
];
</script>

<Docs variant="two-side-navs">
<Sidebar {navigation} {parent} />
<slot />
</Docs>
68 changes: 68 additions & 0 deletions src/routes/docs/products/network/+page.markdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
layout: article
title: Network
description: Discover Appwrite’s network architecture with global regions, edge nodes, and optimized routing. Explore how it ensures low latency, reliable performance, and scalable infrastructure for modern applications.
---

Appwrite's network is designed to deliver low-latency, high-performance experiences for developers and end-users alike. It leverages a robust Content Delivery Network (CDN) with edge locations across multiple regions to ensure fast and reliable data delivery.

With distributed infrastructure and multiple deployment regions, Appwrite enables developers to build globally scalable applications while maintaining data sovereignty. Its architecture integrates seamlessly with APIs, storage, and databases, optimizing both speed and availability.

[NETWORK MAP HERE - REGIONS, EDGES AND POPs INCLUDED]

# Components {% #components %}
The Appwrite network is composed of multiple components that work together to deliver a seamless experience for developers and end-users. These components include:
eldadfux marked this conversation as resolved.
Show resolved Hide resolved

{% cards %}
{% cards_item href="/docs/products/network/regions" title="Regions" %}
Multi-region deployments for geo-redundancy, compliance and low-latency.
{% /cards_item %}
{% cards_item href="/docs/products/network/edges" title="Edges" %}
Edge nodes for fast request processing and reduced round-trip times.
{% /cards_item %}
{% cards_item href="/docs/products/network/cdn" title="CDN" %}
Distributed caching with optimized routing for faster, more reliable data delivery.
{% /cards_item %}
{% cards_item href="/docs/products/network/endpoints" title="Entrypoints" %}
Distributed caching with optimized routing for faster, more reliable data delivery.
{% /cards_item %}
{% /cards %}

## Region vs Edge {% #region-vs-edge %}
eldadfux marked this conversation as resolved.
Show resolved Hide resolved

In Appwrite, Regions are where all your core data and services live. This includes your databases, auth, functions, messaging, and storage. Regions are the source of truth, handling heavy workloads and ensuring your application runs reliably while keeping your data compliant with local regulations.

Edges are about speed. They process requests closer to your users using smart geo-routing, reducing latency by handling compute tasks at the nearest edge location. Edges are perfect for serving cached content, executing lightweight computations, and optimizing user interactions.

{% info title="Where to execute?" %}
The Appwrite Network is designed for flexibility. You can choose to run your serverless compute workload in your project's home region by using the `[ID].[REGION].appwrite.run` endpoint, or on the edge using the `[ID].appwrite.network` endpoint. Both your region and edge endpoints can be customized to use your own custom domain.
{% /info %}

# Architecture {% #architecture %}

Appwrite's network is designed to provide a balance between centralized compute and distributed delivery:
- Regions: Core infrastructure and data resides in global regions, where all services like databases, auth, functions, messaging, and storage operate. These regions ensure data sovereignty, compliance, and high availability for critical workloads.
- Edges: Distributed edge locations process requests closer to end-users, leveraging smart geo-routing to minimize latency. These edge handle tasks like caching, static content delivery, and lightweight compute to improve performance.
- Private Routing: Data moves between edge nodes and regions through optimized, low-latency connections to ensure fast and reliable communication.

This setup separates heavy backend processing in regions from latency-sensitive tasks at the edge, enabling efficient handling of global workloads with minimal performance trade-offs.

# Features {% #features %}

{% cards %}
{% cards_item href="/docs/products/network/ddos" title="DDoS mitigation" %}
Protects against distributed denial-of-service attacks, ensuring uninterrupted access.
{% /cards_item %}
{% cards_item href="/docs/products/network/tls" title="Transport Layer Security (TLS)" %}
Encrypts data in transit for secure and private communication.
{% /cards_item %}
{% cards_item href="/docs/products/network/tls" title="Web Application Firewall (WAF)" %}
Shields applications from common web vulnerabilities and attacks on the application layer.
{% /cards_item %}
{% cards_item href="/docs/products/network/compression" title="Compression" %}
Reduces data size in transit to improve transfer speed and efficiency.
{% /cards_item %}
{% cards_item href="/docs/products/network/caching" title="Caching" %}
Stores frequently accessed data for faster retrieval and lower latency.
{% /cards_item %}
{% /cards %}
61 changes: 61 additions & 0 deletions src/routes/docs/products/network/caching/+page.markdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
layout: article
title: Caching
description: Learn how Appwrite uses smart caching strategies at the region, edge, and CDN levels to optimize performance and protect dynamic APIs, with advanced options for enterprise customers.
---

Appwrite employs a multi-layered caching approach to enhance the performance of your applications. By utilizing caching at the **region**, **edge**, and **CDN** levels, Appwrite ensures faster response times, optimized resource usage, and efficient handling of dynamic workloads.

# Region-level {% #region-level %}

At the region level, Appwrite provides smart in-memory caching for various resources:

- **Documents**: Frequently accessed documents are cached in memory and automatically purged when updated, ensuring data consistency without manual intervention.
- **Storage files**: Frequently accessed files are cached in memory to reduce disk reads and improve performance.
- **Image transformations**: Processed images (e.g., resized or converted) are cached in memory for faster repeated requests, reducing processing overhead.

Region-level caching is tightly integrated with Appwrite's APIs, optimizing performance while preserving data integrity.

# Edge-level {% #edge-level %}

At the edge, Appwrite employs smart caching for specific use cases:

- **Compute builds**: Caches build artifacts for faster deployments and reduced latency during function executions.
- **Cold starts**: Pre-loads frequently accessed resources, reducing latency for new requests and improving application responsiveness.

Edge-level caching complements region-level caching, ensuring optimal performance for globally distributed applications.

# Private caching {% #cdn-caching %}
Appwrite's CDN layer includes **private caching**, a caching strategy designed to handle the dynamic and permission-sensitive nature of Appwrite’s APIs and resources securely.

**What is private caching?**

In the HTTP context, private caching allows responses to be cached but ensures they are only served to the specific user or client that requested them. This is achieved using HTTP headers that control caching behavior. For example:

- `Cache-Control: private, max-age=3600`
Indicates that the response can be cached, but only in a private cache (e.g., the user's browser).

- `Cache-Control: no-store`
Ensures that no part of the response is cached, useful for highly sensitive or frequently changing data.

- `Vary: Authorization`
Signals that the cached response varies based on the `Authorization` header, ensuring permission-specific responses are cached and served appropriately.

**Why use private caching?**

Appwrite's APIs often deliver personalized or restricted content based on user roles and permissions. Private caching ensures:

- **Security**: Sensitive resources are securely cached and only served to the correct user.
- **Permission awareness**: API responses are tailored to each user's permissions, ensuring consistent behavior.
- **Performance**: By caching user-specific responses, private caching reduces backend load while maintaining secure and accurate data delivery.

This approach prevents the accidental exposure of user-specific or restricted data through shared caches while still enabling performance optimizations where possible.

# Caching rules {% #custom-caching %}

Enterprise customers can collaborate with their Appwrite success manager to define custom caching rules tailored to their applications. This includes:
- Setting custom caching durations for specific resources.
- Defining exclusion rules for sensitive or frequently changing data.
- Optimizing cache invalidation strategies for complex workflows.

For more information on upgrading to the enterprise plan, [contact sales](https://appwrite.io/contact-us/enterprise).
25 changes: 25 additions & 0 deletions src/routes/docs/products/network/cdn/+page.markdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: article
title: Content delivery network (CDN)
eldadfux marked this conversation as resolved.
Show resolved Hide resolved
description: Learn about Appwrite’s CDN, designed to optimize content delivery with compression, and edge optimization for improved performance and reduced latency.
---

Appwrite's CDN (Content Delivery Network) is a globally distributed system designed to enhance the speed, reliability, and security of your application's content delivery. With points of presence (PoPs) in over 120 cities worldwide, the CDN ensures low latency and consistent performance for users, no matter their location.

[POPS MAP HERE - NO EDGES OR REGIONS INCLUDED]

# Key features {% #key-features %}

- Global coverage: Fast access to content for users across continents through over 120 PoPs worldwide. Available on all projects.
- Reduced latency: By caching static content at edge nodes, the CDN minimizes the distance between the user and the requested data, significantly reducing latency.
- Dynamic content: The CDN supports both static and dynamic content delivery, seamlessly integrating with backend services hosted in Appwrite regions.
- Content optimization: Appwrite's CDN uses advanced compression algorithms to reduce data transfer sizes, further improving delivery times.
- High availability: Distributed edge nodes and redundant routing ensure that content remains accessible even during regional outages or high traffic loads.

# Design {% #design %}

- Caching strategy: Configurable cache policies for control over TTL and content invalidation.
- Secure delivery: All content is transmitted over TLS for secure, encrypted connections.
- Integration: The CDN works seamlessly with the Appwrite edges and backend regions, providing a unified experience for developers.

By combining global caching, smart routing, and content optimization, the Appwrite CDN is built to handle the demands of modern, high-performance applications.
Loading
Loading