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: persistence.md (consistent name for postgresql) #6429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
21 changes: 11 additions & 10 deletions docs/persistence.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Overview
Cadence has a well defined API interface at the persistence layer. Any database that supports multi-row transactions on
a single shard or partition can be made to work with cadence. This includes cassandra, dynamoDB, auroraDB, MySQL,
Postgres and may others. There are currently three supported database implementations at the persistence layer -
cassandra and MySQL/Postgres. This doc shows how to run cadence with cassandra and MySQL(Postgres is mostly the same). It also describes the steps involved
PostgreSQL and may others. There are currently three supported database implementations at the persistence layer -
cassandra and MySQL/PostgreSQL. This doc shows how to run cadence with cassandra and MySQL(PostgreSQL is mostly the same). It also describes the steps involved
in adding support for a new database at the persistence layer.

# Getting started on mac
Expand Down Expand Up @@ -50,16 +50,17 @@ cp config/development_mysql.yaml config/development.yaml
./cadence-server start --services=frontend,matching,history,worker
```

## PostgresQL
### Start PostgresQL server
## PostgreSQL
### Start PostgreSQL server
```
brew install postgres
brew services start postgres
```
When run tests and CLI command locally, Cadence by default uses a superuser `postgres` with password `cadence`.
You can use the following command to create user(role) and grant access:
```
$psql postgres
psql postgres

postgres=# CREATE USER postgres WITH PASSWORD 'cadence';
CREATE ROLE
postgres=# ALTER USER postgres WITH SUPERUSER;
Expand Down Expand Up @@ -130,8 +131,8 @@ persistence:
maxConns: 2 -- Number of tcp conns to cassandra server (single sub-system on one host) (optional)
```

## MySQL/Postgres
The default isolation level for MySQL/Postgres is READ-COMMITTED.
## MySQL/PostgreSQL
The default isolation level for MySQL/PostgreSQL is READ-COMMITTED.

Note that for MySQL 5.6 and below only, the isolation level needs to be
specified explicitly in the config via connectAttributes.
Expand All @@ -155,7 +156,7 @@ persistence:
tx_isolation: "READ-COMMITTED" -- required only for mysql 5.6 and below, optional otherwise
```

## Multiple SQL(MySQL/Postgres) databases
## Multiple SQL(MySQL/PostgreSQL) databases
To run Cadence clusters in a much larger scale using SQL database, multiple databases can be used as a sharded SQL database cluster.

Set `useMultipleDatabases` to `true` and specify all databases' user/password/address using `multipleDatabasesConfig`:
Expand Down Expand Up @@ -212,7 +213,7 @@ It's basically a CRUD API for every table in the schema. A sample schema definit
can be found [here](https://github.com/uber/cadence/blob/master/schema/mysql/v8/cadence/schema.sql)

Any database that supports this interface can be plugged in with cadence server.
We have implemented Postgres within the repo, and also here is [**an example**](https://github.com/longquanzheng/cadence-extensions/tree/master/cadence-sqlite) to implement any database externally.
We have implemented PostgreSQL within the repo, and also here is [**an example**](https://github.com/longquanzheng/cadence-extensions/tree/master/cadence-sqlite) to implement any database externally.


## For other Non-SQL Database
Expand All @@ -222,4 +223,4 @@ Cadence requires at least supporting:
2. Strong consistency Read/Write operations

This NoSQL persistence API interface can be found [here](https://github.com/uber/cadence/blob/master/common/persistence/nosql/nosqlplugin/interfaces.go).
Currently this is only implemented with Cassandra. DynamoDB and MongoDB are in progress.
Currently this is only implemented with Cassandra. DynamoDB and MongoDB are in progress.