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

update remote doc and latency 1.17.1 #1751

Merged
merged 6 commits into from
Sep 29, 2023
Merged
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion content/introduction/getting-started/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,4 @@ Want to dive even deeper? Here are some links to advanced topics:
* [Backups](https://www.dolthub.com/blog/2021-10-08-backups/)
* [Replication](https://www.dolthub.com/blog/2021-10-20-read-replication/)
* [Conflicts](https://docs.dolthub.com/concepts/dolt/conflicts)
* [Using a Remote with your Server](https://docs.dolthub.com/concepts/dolt/remotes)
* [Using a Remote with your Server](https://docs.dolthub.com/sql-reference/version-control/remotes#pushing-to-remote)
40 changes: 20 additions & 20 deletions content/reference/sql/benchmarks/latency.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,37 @@ attempt to run as many queries as possible in a fixed 2 minute time
window. The `Dolt` and `MySQL` columns show the median latency in
milliseconds (ms) of each query during that 2 minute time window.

The Dolt version is `1.16.4`.
The Dolt version is `1.17.1`.

<!-- START___DOLT___LATENCY_RESULTS_TABLE -->
| Read Tests | MySQL | Dolt | Multiple |
|-------------------------|-------|--------|----------|
| covering\_index\_scan | 2.07 | 2.91 | 1.4 |
| groupby\_scan | 12.98 | 17.95 | 1.4 |
| index\_join | 1.27 | 4.74 | 3.7 |
| index\_join\_scan | 1.21 | 2.22 | 1.8 |
| index\_scan | 33.12 | 57.87 | 1.7 |
| oltp\_point\_select | 0.14 | 0.39 | 2.8 |
| oltp\_read\_only | 2.66 | 7.17 | 2.7 |
| select\_random\_points | 0.3 | 0.72 | 2.4 |
| select\_random\_ranges | 0.37 | 0.95 | 2.6 |
| table\_scan | 33.12 | 57.87 | 1.7 |
| types\_table\_scan | 74.46 | 170.48 | 2.3 |
| covering\_index\_scan | 2.07 | 2.97 | 1.4 |
| groupby\_scan | 12.98 | 18.28 | 1.4 |
| index\_join | 1.3 | 4.82 | 3.7 |
| index\_join\_scan | 1.25 | 2.26 | 1.8 |
| index\_scan | 33.12 | 59.99 | 1.8 |
| oltp\_point\_select | 0.14 | 0.4 | 2.9 |
| oltp\_read\_only | 2.71 | 7.3 | 2.7 |
| select\_random\_points | 0.31 | 0.72 | 2.3 |
| select\_random\_ranges | 0.37 | 0.97 | 2.6 |
| table\_scan | 33.12 | 58.92 | 1.8 |
| types\_table\_scan | 75.82 | 173.58 | 2.3 |
| reads\_mean\_multiplier | | | 2.2 |

| Write Tests | MySQL | Dolt | Multiple |
|--------------------------|-------|-------|----------|
| bulk\_insert | 0.001 | 0.001 | 1.0 |
| oltp\_delete\_insert | 5.77 | 5.88 | 1.0 |
| oltp\_insert | 2.76 | 3.02 | 1.1 |
| oltp\_read\_write | 6.43 | 14.21 | 2.2 |
| oltp\_update\_index | 2.81 | 2.97 | 1.1 |
| oltp\_update\_non\_index | 2.91 | 2.91 | 1.0 |
| oltp\_write\_only | 3.82 | 7.17 | 1.9 |
| types\_delete\_insert | 5.47 | 6.32 | 1.2 |
| oltp\_delete\_insert | 5.18 | 5.88 | 1.1 |
| oltp\_insert | 2.71 | 2.86 | 1.1 |
| oltp\_read\_write | 6.32 | 14.21 | 2.2 |
| oltp\_update\_index | 2.61 | 2.91 | 1.1 |
| oltp\_update\_non\_index | 2.76 | 2.86 | 1.0 |
| oltp\_write\_only | 3.75 | 7.04 | 1.9 |
| types\_delete\_insert | 5.28 | 6.21 | 1.2 |
| writes\_mean\_multiplier | | | 1.3 |

| Overall Mean Multiple | 1.8 |
| Overall Mean Multiple | 1.9 |
|-----------------------|-----|
<!-- END___DOLT___LATENCY_RESULTS_TABLE -->
<br/>
86 changes: 86 additions & 0 deletions content/reference/sql/version-control/remotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,92 @@ Just like Git, Dolt supports syncing with a [remote database](../../../concepts/

Remotes are configured using the [`remote` command](../../cli.md#dolt-remote). You configure a remote with a name and a URL. When you want to use the remote, you refer to it by name. When you clone a remote, a remote named `origin` is automatically configured for you.

<h1 id="pushing-to-remote">Pushing to a Remote</h1>

Let's go through an example of how you can push data from a local Dolt database to a remote. In this example, we'll use the running Dolt server we created in the [Getting Started](https://docs.dolthub.com/introduction/getting-started/database) section to push a branch to [DoltHub.com](https://www.dolthub.com).

To do this, we'll need to authenticate our Dolt server against the remote so that it can perform writes.

First, we'll need to create an account or [sign-in](https://www.dolthub.com/signin) if we already one.

Next, we're going to create a database on DoltHub.com that will serve as the remote for our local Dolt server.

![Empty database as remote](../../../../content/.gitbook/assets/empty_database_as_remote.png)

Next, we can run the command [dolt login](https://docs.dolthub.com/cli-reference/cli#dolt-login) from our local Dolt CLI client. This command will help us authenticate our local client to DoltHub.com, associating our client with our DoltHub identity.

```
dolt login
Credentials created successfully.
pub key: l5bfb43fmqu8u8b59m8fp5cb8o1jcpt8281u94t80us35u6fgavg
/Users/dustin/.dolt/creds/6h68h8brsfu9580rqupi3h9icfhtd5s28ikoguejqqesq.jwk
Opening a browser to:
https://dolthub.com/settings/credentials#l5bfb43fmqu8u8b59m8fp5cb8o1jcpt8281u94t80us35u6fgavg
Please associate your key with your account.
Checking remote server looking for key association.
Retrying in 2
```

This command opens a web browser to DoltHub's credentials page where it will populate the Public Key field with a newly generated public key. In this example that public key is `pub key: l5bfb43fmqu8u8b59m8fp5cb8o1jcpt8281u94t80us35u6fgavg`.

On the credentials page, we just need to provide a description for our new key and click "Add".

![Add Dolt client credentials](../../../../content/.gitbook/assets/add_getting_started_creds.png)

Our local Dolt client (and running Dolt server) are now successfully authenticated to push to DoltHub databases where we have write access. The final output of `dolt login` will read:

```
Key successfully associated with user: coffeegoddd email dustin@dolthub.com
```

Using a MySQL client connected to the running Dolt server, let's give pushing to DoltHub.com a try. We're going to push our `main` branch, so first we check it out:

```
mysql> call dolt_checkout('main');
+--------+---------------------------+
| status | message |
+--------+---------------------------+
| 0 | Switched to branch 'main' |
+--------+---------------------------+
1 row in set (0.02 sec)
```

Now, we need to add the remote address for the DoltHub database we created to the Dolt server:

```
mysql> call dolt_remote('add', 'origin', 'coffeegoddd/getting_started');
+--------+
| status |
+--------+
| 0 |
+--------+
1 row in set (0.03 sec)
```

And then we can push:

```
mysql> call dolt_push('origin', 'main');
+--------+
| status |
+--------+
| 0 |
+--------+
1 row in set (0.77 sec)
```

And the data from our local Dolt server is now available on DoltHub.com!

![DoltHub database has changes](../../../../content/.gitbook/assets/dolthub_database_has_changes.png)

## Pushing from Dolt running in a container

In the example above, the local Dolt client and running Dolt server were successfully authenticated against DoltHub.com because neither was running in a containerized environment.

As a result, both the client and server were able to reference the same local directory Dolt uses to manage its global state. This directory can be set by defining `DOLT_ROOT_PATH`, but by default, is created at `$HOME/.dolt`. This directory houses global (client and server) configuration as well as all remote credentials, which are located in `$HOME/.dolt/creds`.

It's important to be aware of this global state directory in the event you wanted to authenticate a Dolt server running from within a container. To do so, you should run `dolt login` using a Dolt CLI client outside of the containerized environment to create new remote credentials, then mount your local `$HOME/.dolt` directory to the `DOLT_ROOT_PATH` of the container. This ensures that the Dolt server in the container has the credentials to write to your remote.

# Remote Actions

Sync functionality is supported via the [`clone`](../../cli.md#dolt-clone), [`fetch`](../../cli.md#dolt-fetch), [`push`](../../cli.md#dolt-push), and [`pull`](../../cli.md#dolt-pull).
Expand Down