Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PostgreSQLをAWS DMSで安心安全バージョンアップ/chugokudb_25_session1

Takahashi Ikki
November 30, 2018

PostgreSQLをAWS DMSで安心安全バージョンアップ/chugokudb_25_session1

2018年12月01日 に開催された
第25回中国地方DB勉強会 in 鳥取でのセッション1の資料です。

DMSを使ってRDS PostgreSQLのバージョンアップに挑戦してみました。

Takahashi Ikki

November 30, 2018
Tweet

More Decks by Takahashi Ikki

Other Decks in Technology

Transcript

  1. PostgreSQLΛAWS DMSͰ
    ҆৺҆શόʔδϣϯΞοϓ
    2018-12-01
    தࠃ஍ํDBษڧձ in ௗऔ(૔٢)
    ೔ຊPostgreSQLϢʔβʔձ தࠃ஍ํࢧ෦௕
    ߴڮ Ұٍ
    1

    View full-size slide

  2. ͓͠ͳ͕͖
    1. ࣗݾ঺հ
    2. DMSόʔδϣϯΞοϓͷΞʔΩςΫνϟߟ࡯
    3. AWS Database Migration Service ͱ͸
    4. σϞ
    5. AWS DMS ׆༻ࣄྫ
    6. ·ͱΊ
    2

    View full-size slide

  3. ஫ҙࣄ߲
    • εϥΠυ͸ެ։͠·͢ɻ
    • ࣭໰ͱ͔͝ࢦఠͱ͔ॾʑͷϑΟʔυόοΫ͕͍͟͝·ͨ͠Β
    #ChugokuDB ΁ ͓ئ͍க͠·͢ɻ
    • RDSͳͲͷAWSͷαʔϏεͷࣄલ஌͕ࣝඞཁͰ͢ɻ
    • RDS: AWS͕ఏڙ͢ΔϚωʔδυRDBαʔϏε
    3

    View full-size slide

  4. 1. ࣗݾ঺հ
    • ߴڮ Ұٍ
    • Ԭࢁࡏॅ
    • גࣜձࣾΦϛΧϨ WebΤϯδχΞ
    • ೔ຊPostgreSQLϢʔβʔձ
    தࠃࢧ෦௕
    • PostgreSQLྺ 5ϲ݄
    !
    4

    View full-size slide

  5. גࣜձࣾΦϛΧϨ
    (ࣗࣾʹ͍ͭͯͪΐͬͱએ఻)
    શࠃ35,000݅ͷࠗ׆ύʔςΟΛ
    ܝࡌͨ͠ϙʔλϧαΠτ
    25ສਓڧͷձһͷํʑʹ͝ར༻௖͍͍ͯ·
    ͢ɻ
    ࠗ׆ͱݴ͑͹ΦϛΧϨʂ
    \\݁ࠗ͸͍͍ͧʂʂ//
    5

    View full-size slide

  6. ʮPostgreSQLΛDMSͰ҆৺҆શόʔδϣϯΞοϓʯ
    ΦϛΧϨͰ͸ݱࡏਐߦܗͰDMSΛར༻ͯ͠
    DBϦϑΝΫλϦϯάϓϩδΣΫτΛߦ͍ͬͯ·͢ɻ
    ࠓճ͸DMSΛ׆༻ͯ͠ όʔδϣϯΞοϓ͕ʮग़དྷͦ͏ʯͳͷͰߟ͑ͯΈͨɻͬͯൃද಺༰Ͱ
    ※ ʮϕετϓϥΫςΟεʯͰ͸͋Γ·ͤΜɻ
    • DMSͬͯԿʁ
    • DMSΛΑΓόʔδϣϯΞοϓʹ׆͔͢ҝʹग़དྷΔࣄ.
    • DMSͷػೳ͚ͩͰߦ͑Δখ͞ͳϦϑΝΫλϦϯάɻ
    • DMSͰ͸Ҡߦग़དྷͳ͍΋ͷɻ
    6

    View full-size slide

  7. 2. DMSόʔδϣϯΞοϓͷ
    ΞʔΩςΫνϟߟ࡯
    7

    View full-size slide

  8. DMSͱ͸
    • ؆୯ʹઆ໌͢ΔͱɺωοτϫʔΫӽ͠ʹσʔλҠߦΛߦ͏ࣄ
    ͕ग़དྷΔαʔϏεɻ
    • ࠓճ͸͜ͷDMSΛ׆༻ͯ͠ϝδϟʔόʔδϣϯΞοϓΛߦ͏
    ࢼΈΛͯ͠Έ·͢ɻ
    ※ DMSʹ͍ͭͯ͸ޙͰৄ͘͠આ໌͠·͢
    8

    View full-size slide

  9. DMSͷόʔδϣϯΞοϓͷ
    ΞʔΩςΫνϟΛߟ͑Δ
    9

    View full-size slide

  10. DMSΛߏஙͯ͠
    ݱࡏͷRDSͱ͸ผʹཱͯͨ
    ϝδϟʔόʔδϣϯΞοϓޙͷRDS΁
    ϨϓϦέʔγϣϯ͢Δɻ
    ϝϦοτ
    • DMS͸͍ΘΏΔඇಉظͷ
    ϨϓϦέʔγϣϯαʔϏεͳͷͰ
    ݱࡏͷWebαʔϏεͷߏஙͱ͸
    ׬શʹಠཱͯ͠Քಇग़དྷΔɻ
    11

    View full-size slide

  11. WebαʔϏεΛఀࢭͯ͠ɺ
    DBࢀরΛVer11.0ͷํʹ੾Γସ͑·͢ɻ
    12

    View full-size slide

  12. DMSͷॲཧͷऴྃΛ֬ೝޙ
    WebαʔϏεΛ࠶։ͤ͞·͢ɻ
    ͜ΕʹΑͬͯɺ
    αʔϏεͷόοΫΤϯυ͕ΊͰͨ͘
    PostgreSQL Ver.11ʹͳΓ
    όʔδϣϯΞοϓ͕׬ྃͰ͢ɻ
    13

    View full-size slide

  13. ͜ͷखॱͷϝϦοτɾσϝϦοτ
    ϝϦοτ
    • DMSͷϨϓϦέʔγϣϯͷ஗Ԇ͕
    Max500msʙMin10ms ͱ͔ͳͷͰ࠷খͷμ΢ϯλΠϜͰ
    Ҡߦ͸ߦ͏ࣄ͕ग़དྷΔɻ
    • DMSͷՔಇ͕WebαʔϏεͱಠཱͯ͠ΔͷͰ
    όʔδϣϯΞοϓޙͷσʔλϕʔεʹ࠷ॳ͔Β
    खΛՃ͓͑ͯ͘ࣄ͕ग़དྷΔɻ
    • ݹ͍όʔδϣϯͷRDS͕࢒͍ͬͯΔͷͰ
    Կ͔͋ͬͨΒDBࢀরΛ໭͢ࣄͰݩͷ؀ڥΛ෮ݩग़དྷΔɻ
    14

    View full-size slide

  14. ͜ͷखॱͷϝϦοτɾσϝϦοτ
    σϝϦοτ
    • ඞͣఀࢭ͕൐͏ɻ
    • ҠߦλεΫͷઃఆ͸ࣗ෼Ͱߦ͏ඞཁ͕͋ΔͷͰ
    σʔλҠߦ׬ྃͷ୲อ͸ࣗ෼Ͱ͢Δඞཁ͕͋Δɻ
    • શͯͷύλʔϯʹ࢖͑ΔΘ͚Ͱ͸ແͦ͞͏ɻ
    (DMSͰҠߦग़དྷͳ͍΋ͷ͕͋Δ)
    15

    View full-size slide

  15. ୈҰষ·ͱΊ
    • ৽όʔδϣϯͷRDSΛཱͯɺͦͷRDSʹDMSͰσʔλΛྲྀ͢ɻ
    • αʔϏεͷՔಇΛͤͭͭ͞ɺϨϓϦέʔγϣϯΛਐΊΔࣄ͕
    ग़དྷΔɻ
    • ఀࢭ͕൐͏΋ͷͷ ࠷খݶͷμ΢ϯλΠϜͰϨϓϦέʔγϣϯ
    ΛਐΊΔࣄ͕ग़དྷΔɻ
    • Կ͔͋ͬͨ࣌ʹ͙͢ʹ໭͢ࣄ͕ग़དྷΔɻ
    16

    View full-size slide

  16. 3. AWS Database Migration
    Service ͱ͸
    17

    View full-size slide

  17. (ૣ͘ຊ୊ʹ͍ͬͯཉ͍͠)
    Θ͔Δ
    18

    View full-size slide

  18. AWS Database Migration Service
    ωοτϫʔΫӽ͠ʹ
    σʔλҠߦΛߦ͏ࣄ͕ग़དྷΔαʔϏε
    ಄จࣈΛऔͬͯɺDMSͱݺ͹ΕΔɻ
    ※ ੍ݶ͕͋ͬͯɺίϐʔݩɾίϐʔઌͷ
    ͲͪΒ͔͕AWSͷΤϯυϙΠϯτͰແ
    ͍ͱɺϨϓϦέʔγϣϯΛ͢Δࣄ͕ग़དྷ
    ͳ͍ɻ
    19

    View full-size slide

  19. AWS Database Migration Serviceͷ͝঺հ
    • AWS DMS Ͱ࢖ΘΕΔΩʔϫʔυ
    • ϨϓϦέʔγϣϯΠϯελϯεʹ͍ͭͯ
    • λεΫͷৼΔ෣͍ʹ͍ͭͯ
    • λεΫͷઃఆํ๏ʹ͍ͭͯ
    • ҟछDBؒҠߦͷࡍͷΧϥϜͷܕม׵ʹ͍ͭͯ
    • αϙʔτDBΤϯδϯɾόʔδϣϯʹ͍ͭͯ
    20

    View full-size slide

  20. AWS DMS Ͱ࢖ΘΕΔΩʔϫʔυ
    • ιʔεΤϯυϙΠϯτ
    • σʔλͷίϐʔݩɻEC2onDB, RDS, ΦϯϓϨDB, S3 ͳͲɻ
    • λʔήοτΤϯυϙΠϯτ
    • σʔλͷίϐʔઌɻEC2onDB, RDS, ΦϯϓϨDB, S3, DynamoDB ͳͲɻ
    • ϨϓϦέʔγϣϯΠϯελϯε
    • ίϐʔݩ͔Βίϐʔઌ΁σʔλͷϨϓϦέʔγϣϯΛߦ͏Πϯελϯεɻ
    • λεΫ
    • ιʔεɺλʔήοτɺϨϓϦέʔγϣϯΛ૊Έ߹Θͤͯ
    ͲͷςʔϒϧΛͲͷΑ͏ʹҠߦ͢Δ͔ΛఆΊͨϧʔϧɻ
    21

    View full-size slide

  21. ϨϓϦέʔγϣϯΠϯελϯεʹ͍ͭͯ
    • ΠϯελϯεΫϥε͸ T2, C4, R4ͷ̏छྨΛαϙʔτ.
    • T2: ։ൃɾݕূ༻
    • C4: େྔͷԋࢉΛߦ͏৔߹ʹ໾ཱͭɻ
    (AWSతʹ͸ ҟछDBҠߦ͸͜ΕΛ͢͢Ί͍ͯΔ)
    • R4: ϝϞϦ૿ՃΠϯελϯεɻ
    (ҰճͷτϥϯβΫγϣϯ΍σʔλྔ͕େ͖͍࣌͸͜Ε.)
    • ϚϧνAZʹରԠ͍ͯͯ͠ɺϑΣΠϧΦʔόʔΛαϙʔτ.
    • ࣮ࡍɺDMSͱ͓͕͔͔ͯۚ͠Δͷ͸Πϯελϯεར༻ྉͱετϨʔδ͚ͩɻ
    22

    View full-size slide

  22. λεΫͷৼΔ෣͍ͷछྨʹ͍ͭͯ
    λεΫͷৼΔ෣͍͸ओʹ3λΠϓ͋Δɻ
    • શϩʔυ+ܧଓతͳϨϓϦέʔγϣϯ(CDC).
    • طଘͷσʔλΛϑϧϩʔυͨ͠ޙ(PostgreSQLͩͱCOPYจͰߦ͏.)
    ͦͷޙ͸τϥϯβΫγϣϯϩά͔ΒܧଓతʹϨϓϦέʔγϣϯΛߦ͏.
    ֤DBΤϯδϯຖʹઐ༻ͷػೳΛ࢖͏ɻ(PostgreSQLͰ͸test_decodingϓϥ
    άΠϯͰ)
    • ࢦఆҐஔ͔ΒܧଓతͳϨϓϦέʔγϣϯ(CDC)
    • શϩʔυͷΈ
    23

    View full-size slide

  23. λεΫͷઃఆํ๏ʹ͍ͭͯ
    • ϨϓϦέʔγϣϯΛߦ͏ςʔϒϧͷࢦఆํ๏͸̎छྨ
    • userɿ จࣈྻҰகͰ user ςʔϒϧͷΈΛର৅ͱ͢Δɻ
    • user_%ɿ ਖ਼نදݱͰ user_xxx ςʔϒϧʹ߹க͢ΔશͯͷςʔϒϧΛର৅ͱ
    ͢Δɻ
    • ਖ਼نදݱͳͲͰෳ਺ࢦఆͨ͠৔߹͸λεΫ಺ͰฒྻͰςʔϒϧ͕ϩʔυ͞ΕΔɻ
    (σϑΥϧτͰ͸8ςʔϒϧ)
    • ·ͨɺλεΫʹ͸ΑΓ଎౓Λ্͛ΔҝʹϢχʔΫΠϯσοΫεΛ
    ࠷ޙʹషΔͳͲͷॲཧΛ΍ͬͯ͘ΕΔΦϓγϣϯͳͲ͕͋Δɻ
    24

    View full-size slide

  24. λεΫͷઃఆํ๏ʹ͍ͭͯ
    • ·ͨɺ֤ςʔϒϧʹରͯ͠ৄࡉʹҠߦϧʔϧΛઃఆ͢Δࣄ͕
    ग़དྷΔɻ
    • ྫ͑͹Ҡߦޙͷςʔϒϧ໊/ΧϥϜ໊Λมߋͨ͠Γ
    ର৅ͷσʔλΛWHERE۟ͷΑ͏ʹϧʔϧͰߜΓࠐΜͩΓ
    ग़དྷΔɻ
    25

    View full-size slide

  25. ࢀߟ ΦϛΧϨͷλεΫӡ༻ํ਑
    άϧʔϓ୯ҐͰখ͘͞ϨϓϦέʔγϣϯλεΫΛઃఆͯ͠
    ҠߦΛਐΊ͍ͯΔɻ
    ྫɿ ϢʔβʔҠߦλεΫ, ύʔςΟҠߦλεΫ, ༧໿ҠߦλεΫ, ...
    • ཧ༝
    Ҡߦ׬ྃͨ͠ςʔϒϧΑΓDMSͷλεΫΛ࡟আ͍ͯ͘͠ࣄΛ
    ૝ఆ͍ͯ͠ΔͨΊɻ
    ӡ༻Λͯ͠ؾ෇͍͕ͨɺখ͘͞λεΫΛ෼ׂ͓ͯ͘͠ࣄͰҰݸͷςʔϒϧҠߦ͕
    ࣦഊͨ࣌͠ʹαʔϏεશମͷো֐ʹͳΒͳ͍ɻ
    ࠓճͷ૝ఆͱͯ͠͸௕ظʹ౉ͬͯϨϓϦέʔγϣϯΛ͢Δ૝ఆͰແ͍ͷͰɺ
    ҰׅͰઃఆ͢Ε͹ྑͦ͞͏ɻ
    26

    View full-size slide

  26. DBҠߦͷࡍͷΧϥϜͷܕม׵ʹ͍ͭͯ
    • ιʔεͷܕ → DMSઐ༻ͷܕʹΩϟετ → λʔήοτͷܕʹΩϟετ ͱม׵͢Δɻ
    DMSͷܕ ಺༰
    STRING จࣈྻ
    DATE ೔෇஋
    DATETIME λΠϜελϯϓ஋
    INT1 1όΠτɺූ߸෇͖੔਺ (INT2, INT4, INT8͕͋Δ)
    BOOLEAN ϒʔϧ஋
    BLOB όΠφϦϥʔδΦϒδΣΫτ
    ※ ͦͷଞ
    27

    View full-size slide

  27. αϙʔτͯ͠ΔDBΤϯδϯ͓Αͼόʔδϣϯ
    ιʔε
    • PostgreSQL: 9.4Ҡߦ
    • MySQL: 5.5Ҡߦ
    • SQLServer: 2008R2Ҏ߱ (※ Express͸ඇαϙʔτ)
    • S3
    • ͳͲ...
    28

    View full-size slide

  28. αϙʔτͯ͠ΔDBΤϯδϯ͓Αͼόʔδϣϯ
    λʔήοτ
    • PostgreSQL: 9.4Ҡߦ
    • MySQL: 5.5Ҡߦ
    • SQLServer: 2008R2Ҏ߱ (※ Express͸ඇαϙʔτ)
    • RedShift
    • DynamoDB
    • S3
    • ͳͲ
    29

    View full-size slide

  29. 3. AWS DMSʹ͍ͭͯ ·ͱΊ
    • DMS͸ωοτϫʔΫӽ͠ʹϨϓϦέʔγϣϯΛ࣮ݱ͢ΔαʔϏε.
    • σʔλͷίϐʔݩͱઌΛࢦఆͯ͠ҠߦϧʔϧͱͳΔλεΫΛ࡞੒͢ΔࣄͰ
    σʔλͷҠߦ͸શͯDMSͷ੹຿Ͱ࣮ݱͯ͘͠ΕΔɻ
    • λεΫͷཻ౓Λଟͨ͘͠Γখͨ͘͞͠Γ͢ΔࣄͰ
    શମͷϨϓϦέʔγϣϯͷཻ౓Λௐ੔ग़དྷΔɻ
    • DMS୯ମͱͯ͠͸ϨϓϦέʔγϣϯΠϯελϯεͷӡ༻අ͕͔͔Δఔ౓Ͱ
    ҆ՁͰਐΊΔࣄ͕ग़དྷΔɻ
    30

    View full-size slide

  30. RDSΛ2୆ཱͯΔ(ׂѪ͢Δ)
    • PostgreSQL9.6 ͱ PostgreSQL10.5ΛཱͯΔ.
    • ιʔεͷRDSʹ͸ rds.logical_replication ʹ1ͱઃఆ͢Δඞཁ͕͋Δɻ
    • PostgreSQL9.6 ʹ users ςʔϒϧͳͲΛ࡞੒͢Δ.
    DMSͷΠϯελϯεΛཱͯΔ
    • ϨϓϦέʔγϣϯΠϯελϯε
    • ιʔεɺλʔήοτΛఆٛ.
    • ྫ) usersͷλεΫΛઃఆͯ͠ΈΔɻ
    32

    View full-size slide

  31. usersςʔϒϧͷൺֱ ͯ͠ΈΔ
    34

    View full-size slide

  32. • users ςʔϒϧൺֱʢݩʣ
    CREATE TABLE public.users (
    id integer NOT NULL,
    email character varying(255) NOT NULL,
    password character varying(255) NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
    );
    ALTER TABLE public.users OWNER TO chugokudb;
    CREATE SEQUENCE public.users_id_seq
    START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
    ALTER TABLE public.users_id_seq OWNER TO chugokudb;
    ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
    ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
    ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_email_key UNIQUE (email);
    ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);
    35

    View full-size slide

  33. • users ςʔϒϧൺֱʢҠߦઌʣ
    CREATE TABLE public.users (
    id integer NOT NULL,
    email character varying(255) NOT NULL,
    password character varying(255) NOT NULL,
    created_at timestamp(6) with time zone NOT NULL,
    updated_at timestamp(6) with time zone NOT NULL
    );
    ALTER TABLE public.users OWNER TO chugokudb;
    ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);
    36

    View full-size slide

  34. ׂͱҧ͏(׼)
    37

    View full-size slide

  35. ҧ͍
    • idΧϥϜ͕ serialͰͳ͘ͳͬͯΔɻ
    • emailʹݩʑுͬͯͨunique੍໿͕ແ͍ɻ
    39

    View full-size slide

  36. ஫ҙࣄ߲
    "AWS DMS͸ɺςʔϒϧɺϓϥΠϚϦΩʔɺ৔߹ʹΑͬͯ͸Ұ
    ҙͷΠϯσοΫεΛ࡞੒͠·͕͢ɺޮ཰తʹιʔε͔Βσʔλ
    ΛҠߦ͢ΔҝʹඞཁͰ͸ແ͍ଞͷΦϒδΣΫτ͸࡞੒͞Ε·ͤ
    Μɻ"
    ͸͍ɻ
    40

    View full-size slide

  37. DMSͷ௕ॴ
    • σʔλͷϨϓϦέʔγϣϯ͕ಘҙ
    => ͜Εʹਚ͖Δɻա౓ͳظ଴͸ͩΊɻ
    41

    View full-size slide

  38. DBఆٛΛ͋ΘͤΔํ๏
    • ํ๏1. ςʔϒϧఆٛͷΈΛpg_dumpͨ͠ޙɺ
    ͦͷϑΝΠϧΛϦετΞ͢Δɻ
    • ํ๏2. SCTΛ࢖༻͢Δɻ
    42

    View full-size slide

  39. SCT ͱ͸
    • Schema Conversion Tool
    • ΫϩεϓϥοτϑΥʔϜ(Linux, macOS, Windows)্Ͱಈ͘ε
    λϯυΞϩϯΞϓϦέʔγϣϯ.
    • ιʔεσʔλϕʔεͷεΩʔϚΛλʔήοτͷRDSΠϯελ
    ϯεͱޓ׵ੑͷ͋Δܗࣜʹࣗಈม׵ͯ͘͠ΕΔπʔϧɻ
    43

    View full-size slide

  40. ͬ͘͟Γ࢖͍ํ SCT_1
    • ProjectΛ࡞੒͢Δɻ
    • Projectʹ͸
    ιʔεͷΤϯδϯͱ
    λʔήοτͷΤϯδϯΛઃఆ͢Δɻ
    44

    View full-size slide

  41. ͬ͘͟Γ࢖͍ํ SCT_2
    • ProjectΛ࡞੒͢Δɻ
    • Projectʹ͸
    ιʔεͷΤϯδϯͱ
    λʔήοτͷΤϯδϯΛઃఆ͢Δɻ
    45

    View full-size slide

  42. ͬ͘͟Γ࢖͍͔Β SCT_3
    46

    View full-size slide

  43. ͬ͘͟Γ࢖͍ํ SCT_4
    • ϙνϙνͱςʔϒϧΛҎ͍߱ͯ͘͠ɻ
    • SchemaΛબ୒ͯ͠ Convert Schemaͱ
    ͢Δͱྑ͍Α͏ʹςʔϒϧఆٛΛΠϯ
    ϙʔτͯ͘͠ΕΔɻ
    • ӈଆͷεΩʔϚ΍ςʔϒϧΛબ୒ͯ͠
    Apply ͢Δͱ൓ө͞ΕΔɻ
    • ※ ֎෦Ωʔ੍໿ுͬͯΔ৔߹͸Τϥʔ
    ʹͳΒͳ͍Α͏ʹࣗ෼ͰؤுΔɻ
    • (ઈົʹ࢖͍ͮΒ͍..)
    47

    View full-size slide

  44. usersͷൺֱ
    48

    View full-size slide

  45. ؤுΕ͹ಉ͡DBΛ࡞Δࣄ͸ग़དྷΔ
    50

    View full-size slide

  46. ॴײ
    • DBͷఆٛͷΈɺϦετΞͨ͠ํָ͕ͦ͏ɻɻɻ
    51

    View full-size slide

  47. ࠷ऴతͳҠߦΞʔΩςΫνϟ
    1. pg_dumpͰ৽DBଆ΁ςʔϒϧఆٛͷΈΛઌʹద༻͢Δɻ
    2. dmsλεΫΛ࡞੒ͯ͠σʔλΛίϐʔ͢Δɻ
    3. DBΛࢀর͍ͯ͠ΔαʔϏεΛࢭΊΔɻ
    4. ιʔεDBଆʹϚʔΧʔͱͳΔσʔλΛҰ݅Insert͢Δɻ
    5. ϚʔΧʔ͕DMSͰλʔήοτDBʹҠߦ͞ΕΔࣄΛ֬ೝ͢Δɻ
    6. αʔϏεͷDBͷࢀরΛλʔήοτଆ΁มߋ͢Δɻ
    52

    View full-size slide

  48. Ҡߦ࣌ʹࢀߟͱͳΔϝτϦΫε
    CDCLatencySource
    • ιʔεDBͰ࣮ߦ͞Ε͔ͨ࣌ؒΒDMSΠϯελϯε͕
    COMMITΛݕ஌ͨ࣌ؒ͠ͷฏۉඵ
    CDCLatencyTarget
    • DMSΠϯελϯε͕COMMITΛݕ஌͔ͨ࣌ؒ͠Βλʔήοτ
    ʹద༻ͨ͠·Ͱͷฏۉඵ
    53

    View full-size slide

  49. 4. σϞ ·ͱΊ
    • DMSͰͷDBఆٛͷҠߦ͸೉͍͠ɻ
    • ఘΊ͸؊৺ͰɺSCTͰؤுΔ͔ pg_dumpͰςʔϒϧఆٛͷΈ
    Λઌʹ࡞͓ͬͯ͘ࣄΛ͓͢͢Ί͢Δɻ
    • σʔλͷҠߦͷΈΛDMSͷ੹຿Ͱ΍Δɻ
    54

    View full-size slide

  50. ࢥͬͯͨΜͱͪΌ͏͔ͬͨɾɾ
    DMSΛ࢖ͬͨDBόʔδϣϯΞοϓ͸
    ׂͱ؆୯ʹग़དྷΔͩΖ͏ɺͬͯࢥ͕ͬͯͨ
    DMS͚ͩͰ͸DBόʔδϣϯΞοϓΛߦ͏ͷ͸೉ͦ͠͏Ͱͨ͠ɻ
    ظ଴͞Εͯͨํɺ͢Έ·ͤΜɻ
    • ੹຿Λ੾Γ෼͚ͯɺDMS͸σʔλͷϨϓϦέʔγϣϯͷΈΛ
    ߦ͏ͷ͕ྑ͍Ͱ͢ɻ
    56

    View full-size slide

  51. ͜ͷΞʔΩςΫνϟͷதͰͷ࠷େͷϝϦοτ
    • ༧Ίόʔδϣϯͷ্͕ͬͨDBΠϯελϯεͱ
    Ҡߦ͞Εͨσʔλ͕͋ΔͷͰɺ
    લ΋ͬͯ઀ଓͯ͠ςετ͢Δࣄ͕ग़དྷΔɻ
    • CDCLatencyͷϝτϦΫεΛࢀߟʹఀࢭ࣌ؒΛݟੵ΋Δࣄ͕
    ग़དྷΔɻ
    => ׂͱʮ͍͑΍ͬʯͬͯ΍Γ͕ͪͳϝδϟʔόʔδϣϯΞοϓ
    ʹ͍ͭͯɺສશͷମ੍Ͱ๬ΊΔɻ
    57

    View full-size slide

  52. Πϕϯτࠂ஌
    • ୈ26ճ தࠃ஍ํDBษڧձ in Ԭࢁ
    • 2018-02-02(౔) 13:00ʙ
    59

    View full-size slide

  53. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·
    ͨ͠ʂʂ
    60

    View full-size slide