メインコンテンツまでスキップ

CockroachDB

Squid は CockroachDB database に接続し、Squid application の data source として使用できます。​

CockroachDB は scalability 向けに設計された cloud-native distributed SQL database です。Squid を使用すると、CockroachDB database と統合し、他の database connector の data と join することもできます。

CockroachDB database を Squid と統合するには、次の step を完了します。

  1. Squid Console を開き、CockroachDB と使用する application を選択します。
  2. Connectors tab をクリックし、次に Available connectors をクリックします。
  3. CockroachDB connector を選択します。
  4. 次の configuration information を入力します。
  • Connector ID - 簡潔で connector の識別に役立つ ID を選択します。
  • Database endpoint - port number を含む database host。
  • CockroachDB username
  • CockroachDB password - password を非公開に保つには、Squid Secrets に保存します。
  • Schema - 接続する schema の name。指定しない場合は default の public schema が使用されます。
  • Database name - 接続する database の name。
  • SSL configuration(必要な場合)

CockroachDB connector

connection information を入力したら、Test connection をクリックして connection が正しく構成されていることを確認します。

Squid's IP address​

To prevent denial-of-service attacks, brute force password attacks, and other forms of malicious activity, some providers recommend restricting your network to allow access only from specific IP addresses. This procedure is commonly known as allowlisting, and it limits access to your resources by only accepting connections from a specific list of endpoints.

Refer to your resource provider to determine if you need to add Squid's IP addresses to your access list. If allowlisting is required, you can find Squid's IP addresses on the application overview page of the Squid Console (located in the Cloud Provider section).

allowlist に追加する IP address の方法については、Cockroach Labs documentationを確認してください。

Database の保護​

default では security rule が必要です。production environment では、security rule なしで connector への access を許可しないことが不可欠です。database data の保護について詳しくは、security rules documentationを参照してください。

Datatype Mapping​

以下の table は CockroachDB と Squid の datatype mapping を示します。

Postgresql TypeSquid Type
bigintnumber
bitstring
bit varyingstring
booleanboolean
byteastring
charstring
characterstring
character varyingstring
cidrstring
datedate
double precisionnumber
enumstring
inetstring
integerinteger
intervalstring
jsonmap or array
jsonbmap or array
macaddrstring
macaddr8string
mediumintinteger
moneynumber
numericnumber
realnumber
smallintinteger
textstring
timestring
time with time zonestring
time without time zonestring
timestampdate
timestamp with time zonedate
timestamp without time zonedate
tinyintinteger
uuidstring
varcharstring

Squid で CockroachDB data を操作する方法については、Client SDK documentationを参照してください。