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

docs: add manage & update sdk layout #1702

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion site/src/components/HeaderPopupProductMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Link from 'next/link';
export const HeaderPopupProductMenu = () => {
return (
<div className='grid h-full grid-cols-3 grid-rows-3 gap-4 overflow-hidden pb-2'>
<Link href='/docs/actors' className='col-span-2 row-span-3 '>
<Link href='/docs' className='col-span-2 row-span-3 '>
<Item
onMouseEnter={e => e.currentTarget.querySelector('video')?.play()}
onMouseLeave={e => e.currentTarget.querySelector('video')?.pause()}>
Expand Down
70 changes: 0 additions & 70 deletions site/src/content/docs/actors.mdx

This file was deleted.

5 changes: 5 additions & 0 deletions site/src/content/docs/builds.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Builds

Builds contain the code required to run an actor. Builds are uploaded to Rivet when running `rivet deploy`. Each actor is associated with a single build ID.

When a new build is uploaded, all actors are upgraded to use the new build. This process is usually transparent to you since the state is durable.
78 changes: 0 additions & 78 deletions site/src/content/docs/client/javascript.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion site/src/content/docs/connections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Example extends Actor<State, ConnectionParams> {
```

```typescript {{ "title": "client.ts" }}
const actor = client.get(
const actor = client.get<Example>(
{ name: 'example' },
{
parameters: { authToken: 'supersekure' }
Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/edge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See API documentation [here](/docs/api/actor/regions/list).

## Automatic region selection

By default, actors will choose the most optimal region based on the client's latency. This can be overridden if needed.
By default, actors will choose the optimal region based on the client's latency. This can be overridden if needed.

## Region selection

Expand Down
21 changes: 21 additions & 0 deletions site/src/content/docs/faq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# FAQ

## How are actors different from containers and servers?

Servers and containers and actors handle state and compute very differently:

| Feature | Servers and Containers | Actors |
| ----------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| **Compute and State** | Separate compute (application layer) from state (databases) | Keep state and compute together |
| **Scaling** | Need external services (load balancers, databases) to scale | Cheaper & automatically distribute load |
| **Performance** | Performance can be limited by network latency & complex locking mechanisms | Optimized performance by co-locating compute and state |
| **Latency** | Typically higher latency due to centralized data centers & database | Lower latency by deploying at the edge, closer to users |
| **High Availability** | Need manual configuration for high availability and fault tolerance | Provide built-in durability for crashes and fault isolation to prevent cascading failures |
| **Resource Efficiency** | Run continuously regardless of load, wasting resources when idle | Automatically sleep when inactive and wake instantly when needed |
| **DevOps Overhead** | Requires significant DevOps effort for setup and maintenance | Minimal DevOps overhead due to simpler, on-demand architecture |

## Can I use Rivet Actors with my existing database?

Yes.

Rivet Actors behaves similar to serverless platform (e.g. Lambda, Vercel Functions, etc.) and connect directly to your database. This is common for developers who need to work with relational data in conjunction with realtime functionality.
Binary file added site/src/content/docs/images/setup/actors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/src/content/docs/images/setup/builds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 38 additions & 13 deletions site/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,56 @@ import { Card as MyCard } from '@/components/Card';

# Welcome to Rivet

Rivet is a powerful platform for building real-time applications, offering a simplified approach to distributed computing. At the core of Rivet are Actors, with built-in support for remote procedure calls, state, events, and edge networking.
Rivet is a powerful platform for building real-time applications. At the core of Rivet are Actors, with built-in support for remote procedure calls, state, events, and edge networking.

## Why use Rivet Actors?

Rivet Actors offer several compelling advantages for building real-time applications:

- **Enhanced Performance**: By integrating compute (i.e., "RPC") with data (i.e., "state"), performance is significantly improved.
- **Simplified Architecture**: Replace complex infrastructure (e.g., caches, queues, pub/sub) with actors for a more straightforward architecture.
- **Built-in Fault Tolerance**: Actors provide natural fault tolerance as state is durable and failures do not cascade.
- **Reduced Latency**: Achieve lower latency for users by running at the edge and combining compute with data.

## Core primitives

- [**Remote Procedure Call**](/docs/rpc) (RPC) is how clients communicate with actors and how actors communicate with each other.
- [**State**](/docs/state) is the data belonging to each actor. State cannot be shared between actors. State is stored in memory (unless it's too large) for fast reads and writes. State is durable and will always survive a crash or upgrade. You can update state without having to do anything special.
- [**Events**](/docs/events) are used for real-time communication between clients and actors. Clients can subscribe to events with `actor.on("myEvent")`, and actors can publish events with `this.broadcast("myEvent")` or `connection.send("myEvent")`.
- [**Connections**](/docs/connections) represent a client that's currently connected to the actor. Connections have their own state, e.g., `userId`. You can use `onConnect` to authenticate connections before they can communicate with the actor.

To read more about architecting actors for scale, see [here](/docs/scaling).

## Get Started

<CardGroup>
<Card title="Initial Setup" href='/docs/setup' />
<Card title="What Are Actors?" href='/docs/actors' />
<Card title="Actor SDK" href='https://jsr.io/@rivet-gg/actor/doc' target='_blank' />
<Card title="JavaScript & TypeScript Client" href='/docs/client/javascript' />
<Card title='Initial Setup' href='/docs/setup' />
<Card title='Actor SDK' href='https://jsr.io/@rivet-gg/actor/doc' target='_blank' />
</CardGroup>

## Client SDKs

<CardGroup>
<Card title='JavaScript' href='https://jsr.io/@rivet-gg/actor-client' target='_blank' />
<Card title='TypeScript' href='https://jsr.io/@rivet-gg/actor-client' target='_blank' />
</CardGroup>

## Build with Rivet

<CardGroup>
<Card title="Remote Procedure Calls" href='/docs/rpc' />
<Card title="State" href='/docs/state' />
<Card title="Events" href='/docs/events' />
<Card title="Scaling & Concurrency" href='/docs/scaling' />
<Card title="Edge Networking" href='/docs/edge' />
<Card title='Create & Manage Actors' href='/docs/manage' />
<Card title='Remote Procedure Calls' href='/docs/rpc' />
<Card title='State' href='/docs/state' />
<Card title='Events' href='/docs/events' />
<Card title='Scaling & Concurrency' href='/docs/scaling' />
<Card title='Edge Networking' href='/docs/edge' />
</CardGroup>

## Resources

<CardGroup>
<Card title="Configuration" href='/docs/config' />
<Card title="Troubleshooting" href='/docs/troubleshooting' />
<Card title="Self-Hosting" href='/docs/self-hosting' />
<Card title='Configuration' href='/docs/config' />
<Card title='Troubleshooting' href='/docs/troubleshooting' />
<Card title='FAQ' href='/docs/faq' />
<Card title='Self-Hosting' href='/docs/self-hosting' />
</CardGroup>
Loading