この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。
大栗です。
Aurora Postgresql互換が東京リージョンにやってきました!
Amazon Aurora with PostgreSQL Compatibility is Available in the Asia Pacific (Tokyo) Region
Auroraの状況
先日はAurora MySQL 2系(MySQL5.7互換)の正式リリースがありましたが、やっとPostgreSQL互換のAuroraが東京に来ました。一般的に使用できるリージョンのAurora対応状況は以下のようになっています。
リージョン | MySQL 5.6 | MySQL 5.7 | PostgreSQL |
---|---|---|---|
米国東部 (バージニア北部) | ◯ | ◯ | ◯ |
米国東部 (オハイオ) | ◯ | ◯ | ◯ |
米国西部 (北カリフォルニア) | ◯ | ◯ | |
米国西部 (オレゴン) | ◯ | ◯ | ◯ |
アジアパシフィック (ムンバイ) | ◯ | ◯ | ◯ |
アジアパシフィック (ソウル) | ◯ | ◯ | |
アジアパシフィック (シンガポール) | ◯ | ||
アジアパシフィック (シドニー) | ◯ | ◯ | ◯ |
アジアパシフィック (東京) | ◯ | ◯ | ◯ <- New! |
カナダ (中部) | ◯ | ◯ | ◯ |
EU (フランクフルト) | ◯ | ◯ | ◯ |
EU (アイルランド) | ◯ | ◯ | ◯ |
EU (ロンドン) | ◯ | ◯ | |
EU (パリ) | ◯ | ◯ | ◯ |
南米 (サンパウロ) | ◯ |
使用できるインスタンスクラスは以前と変わらずにdb.r4.large 〜 db.r4.16xlarge となっています。まだPostgreSQL互換にはT2系が無いので検証でもR4系を使用する必要があります。
インスタンスクラス | 時間あたりの料金(東京リージョン) |
---|---|
db.r4.large | $0.35 |
db.r4.xlarge | $0.70 |
db.r4.2xlarge | $1.40 |
db.r4.4xlarge | $2.80 |
db.r4.8xlarge | $5.60 |
db.r4.16xlarge | $11.20 |
試してみる
起動する
東京リージョンでRDSのコンソールを開き、DB インスタンスの起動
をクリックします。
PostgreSQL 対応
の選択肢が増えています。MySQL 5.7互換は古いルックアンドフィールのコンソールでは表示されませんでしたがPostgreSQL互換は古くてもちゃんと表示されます。
以降は、以下のエントリーに沿ってAuroraを起動します。
確認する
Auroraにログインします。
$ psql -h aurora-postgresql.abcdefghijkl.ap-northeast-1.rds.amazonaws.com -U awsuser -d mydb
Password for user awsuser:
psql (9.6.6, server 9.6.3)
SSL connection (protocol: TLSv1.2, cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
mydb=>
導入済みモジュールを確認してみます。同バージョン(9.6.3)のPostgreSQL for RDSと比較すると以下のモジュールが増えています。pgRoutingは地理空間の経路探索機能を提供してくれるので面白い使い方ができそうです。
- xml2
- apgunit
- apgcc
- pageinspect
- pgrouting
- aurora_stat_utils
mydb=> select * FROM pg_available_extensions;
name default_version installed_version comment
------------------------------+-----------------+-------------------+---------------------------------------------------------------------------------------------------------------------
pgstattuple 1.4 show tuple-level statistics
uuid-ossp 1.1 generate universally unique identifiers (UUIDs)
xml2 1.1 XPath querying and XSLT
citext 1.3 data type for case-insensitive character strings
dblink 1.2 connect to other PostgreSQL databases from within a database
isn 1.1 data types for international product numbering standards
dict_int 1.0 text search dictionary template for integers
fuzzystrmatch 1.1 determine similarities and distance between strings
ltree 1.1 data type for hierarchical tree-like structures
pltcl 1.0 PL/Tcl procedural language
postgis 2.3.4 PostGIS geometry, geography, and raster spatial types and functions
dict_xsyn 1.0 text search dictionary template for extended synonym processing
apgunit 1.0 Extension for unit testing
pgcrypto 1.3 cryptographic functions
pg_freespacemap 1.1 examine the free space map (FSM)
hstore 1.4 data type for storing sets of (key, value) pairs
plv8 1.5.3 PL/JavaScript (v8) trusted procedural language
postgres_fdw 1.0 foreign-data wrapper for remote PostgreSQL servers
postgis_tiger_geocoder 2.3.4 PostGIS tiger geocoder and reverse geocoder
unaccent 1.1 text search dictionary that removes accents
chkpass 1.0 data type for auto-encrypted passwords
pgaudit 1.0 provides auditing functionality
address_standardizer_data_us 2.3.4 Address Standardizer US dataset example
log_fdw 1.0 foreign-data wrapper for Postgres log file access
test_parser 1.0 example of a custom parser for full-text search
tsearch2 1.0 compatibility package for pre-8.3 text search functions
ip4r 2.0
plpgsql 1.0 1.0 PL/pgSQL procedural language
earthdistance 1.1 calculate great-circle distances on the surface of the Earth
tsm_system_rows 1.0 TABLESAMPLE method which accepts number of rows as a limit
plperl 1.0 PL/Perl procedural language
plcoffee 1.5.3 PL/CoffeeScript (v8) trusted procedural language
pg_visibility 1.1 examine the visibility map (VM) and page-level visibility info
address_standardizer 2.3.4 Used to parse an address into constituent elements. Generally used to support geocoding address normalization step.
hstore_plperl 1.0 transform between hstore and plperl
pg_stat_statements 1.4 track execution statistics of all SQL statements executed
cube 1.2 data type for multidimensional cubes
apgcc 1.0 Extension for checking consistency between heap and index
tablefunc 1.0 functions that manipulate whole tables, including crosstab
pageinspect 1.5 inspect the contents of database pages at a low level
tsm_system_time 1.0 TABLESAMPLE method which accepts time in milliseconds as a limit
intagg 1.1 integer aggregator and enumerator (obsolete)
sslinfo 1.2 information about SSL certificates
plls 1.5.3 PL/LiveScript (v8) trusted procedural language
pgrowlocks 1.2 show row-level locking information
pg_trgm 1.3 text similarity measurement and index searching based on trigrams
btree_gin 1.0 support for indexing common datatypes in GIN
bloom 1.0 bloom access method - signature file based index
pgrouting 2.4.2 pgRouting Extension
pg_buffercache 1.2 examine the shared buffer cache
pg_hint_plan 1.1.3
pg_prewarm 1.1 prewarm relation data
aurora_stat_utils 1.0 Statistics utility functions
btree_gist 1.2 support for indexing common datatypes in GiST
postgis_topology 2.3.4 PostGIS topology spatial types and functions
intarray 1.2 functions, operators, and index support for 1-D arrays of integers
(56 rows)
さいごに
re:Invent 2016でPostgreSQL互換のAuroraが発表されて以来ずっと東京に来ることを待ち望んでいた方も多数いらっしゃったと思います。本日ようやくやってきました。既存のPostgreSQL for RDSからも簡単に移行できるので早速検証するのはいかがでしょうか。