Google Cloud

Google Cloud เปิดตัวบริการใหม่ที่สำคัญในงาน I/O 2022 ปีนี้คือ ฐานข้อมูล AlloyDB ที่เข้ากันได้กับ PostgreSQL 100% (อิงอยู่บน PostgreSQL 14 เวอร์ชันล่าสุด) แต่สถาปัตยกรรมข้างหลังออกแบบใหม่หมด มีความเร็วอ่านเขียนทั่วไปเพิ่มขึ้นจาก PostgreSQL 4 เท่า และถ้าเป็นการคิวรีข้อมูลมาวิเคราะห์จะเร็วขึ้นสูงสุด 100 เท่า

เราสามารถเรียก AlloyDB ว่าเป็นคู่แข่งของ Amazon Aurora ที่ AWS นำ MySQL/PostgreSQL มาปรับแต่งเพิ่มเติม (แต่ฝั่งกูเกิลมีเฉพาะ PostgreSQL) ซึ่งกูเกิลก็ชูว่า AlloyDB เร็วกว่า Aurora PostgreSQL 2 เท่าด้วยเช่นกัน

ฟีเจอร์อื่นของ AlloyDB คือฟีเจอร์ด้านวิเคราะห์ข้อมูล และใช้ machine learning ช่วยจัดการฐานข้อมูล ทั้งการแบ็คอัพ แพตช์ สเกล และ replication ให้อัตโนมัติ กูเกิลการันตี SLA ที่ 99.99% ซึ่งน้อยกว่าฐานข้อมูล Cloud Spanner หนี่งหลัก (99.999%) แต่ก็มีโจทย์การใช้งานและราคาที่ต่างกัน


สถาปัตยกรรมเบื้องหลัง AlloyDB คือการแยกส่วน compute และ storage ออกจากกัน ในฐานข้อมูล relational database แบบดั้งเดิม เซิร์ฟเวอร์เครื่องเดียวมีทั้งส่วน compute/storage รวมกัน ทำงานจบในตัว และขยายด้วยวิธี scale up เพิ่มเครื่องให้ใหญ่ขึ้น ซีพียูแรงขึ้น สตอเรจมากขึ้น ซึ่งไม่ค่อยยืดหยุ่นนัก

ฐานข้อมูลยุคถัดมาที่เริ่มมีคลาวด์ เปลี่ยนมาใช้วิธี scale out เพิ่มจำนวนเครื่องแทน ข้อดีคือแก้ปัญหาเรื่องปริมาณพื้นที่สตอเรจให้ยืดหยุ่นกว่าเดิม แต่ยังเจอข้อจำกัดเรื่องการวางแผนพื้นที่สตอเรจให้เหมาะสม ต้องบาลานซ์ระหว่างพื้นที่เยอะเกินความต้องการ กับพื้นที่หรือ I/O ไม่เพียงพอในจังหวะโหลดหนักๆ (spike หรือ hotspot)

AlloyDB แก้ปัญหาข้างต้นด้วยการแยกส่วน compute และ storage จากกันอย่างสิ้นเชิง ทั้งสองส่วนสามารถสเกลแบบคลัสเตอร์ได้ และใช้แคชมาคั่นกลางในหลายจุดเพื่อรองรับโหลดแต่ละประเภท

จุดเด่นอย่างหนึ่งของ AlloyDB คือแก้ปัญหาเรื่อง read-only replica หรือการทำซ้ำฐานข้อมูลให้อ่านได้อย่างเดียว (แก้ปัญหาฐานข้อมูลเดียวรองรับโหลดการอ่านไม่ไหว ซึ่งมีข้อจำกัดเรื่องการซิงก์ข้อมูลระหว่าง replica ตามมา) ด้วยการสร้าง multiple read-only replica instances ขึ้นมาหลายๆ ชุด โดยไม่ต้องทำสำเนาฐานข้อมูลจริงๆ

เหตุผลเป็นเพราะ AlloyDB แยกตัวข้อมูลที่เก็บจริง (storage layer) กระจายอยู่หลายๆ โซนของคลาวด์อยู่แล้ว ดังนั้นก็แค่สร้าง replica instance ขึ้นมาหลายๆ ตัว ซึ่งอาจเรียกข้อมูลจริงที่อยู่คนละแห่งกันได้เลย

สถาปัตยกรรมส่วน storage layer ของ AlloyDB (กรอบสีฟ้าในภาพ) แยกได้เป็น 3 ส่วนย่อยคือ

  1. log storage สำหรับเขียน write-ahead log (WAL) แบบรวดเร็วมาก
  2. log processing service (LPS) เพื่อประมวลผล WAL และสร้างบล็อคสำหรับเก็บข้อมูล
  3. block storage พื้นที่เก็บข้อมูลจริงๆ โดยมีฟีเจอร์ sharding, แยกเก็บตาม region ของคลาวด์ เพื่อป้องกันปัญหาสตอเรจพังทั้งโซน

จากภาพ เริ่มจาก primary database instance เขียนการเปลี่ยนแปลงของฐานข้อมูล (INSERT/DELETE/UPDATE) เป็น WAL log ส่งเข้ามาที่ log processing service (LPS) ให้ดำเนินการเปลี่ยนแปลงข้อมูลจริงๆ ที่เก็บใน block storage อีกที

จากนั้น บล็อคข้อมูลสามารถถูกส่งให้ replica instance อื่นๆ ได้โดยตรง เมื่อนำมาประกอบเข้ากับ WAL log ที่ส่งมาจาก primary instance เราก็จะได้ replica instance ที่สามารถทำงานได้เหมือนกันทันที โดยไม่ต้องสร้างสำเนาข้อมูลขึ้นมาทั้งก้อน

กูเกิลอธิบายว่า สถาปัตยกรรมนี้แยกส่วน compute/storage จากกันอย่างสิ้นเชิง ในการประมวลผล log (LPS) สามารถ scale-out ต่างหากได้โดยไม่ต้องยุ่งกับการสำเนาข้อมูล ฝั่งการเก็บข้อมูลบล็อค ก็สามารถกระจายความเสี่ยงข้อมูลพังทั้งโซน (zonal failure) โดยสำเนาบล็อคทั้งหมดข้ามโซนของคลาวด์ได้

การแยก compute/storage ด้วยกันยังช่วยแก้ปัญหาคอขวด IO และไม่จำเป็นต้องทำจุด checkpoint ของฐานข้อมูลทั้งก้อน เลเยอร์ของ compute ทำหน้าที่แค่คิวรีงานตามสั่งอย่างเดียว ส่วนเลเยอร์ storage ก็เก็บข้อมูลอย่างเดียว การสั่งแบ็คอัพ ทำที่เลเยอร์ storage ไม่กระทบทรัพยากรที่ใช้ในเลเยอร์ของ compute

รายละเอียดทางเทคนิคเพิ่มเติมอ่านได้จาก Google Cloud

กูเกิลเน้นกลุ่มลูกค้าที่ต้องการย้ายจากฐานข้อมูลแบบเดิมๆ (เช่น Oracle) มายัง AlloyDB ที่เป็นฐานข้อมูลโอเพนซอร์ส แต่มีประสิทธิภาพสูงกว่า และออกบริการช่วยย้ายข้อมูล Oracle to PostgreSQL มาให้พร้อมกัน

ส่วนวิธีคิดเงินของ AlloyDB แยกคิด 3 ส่วน (ตัวอย่างราคาเขต us-central1) คือ

  • CPU/memory ($0.06608 / vCPU hour + $0.0112 / GB hour)
  • Storage ($0.0004109 per GB)
  • Networking (ingress ฟรี, egress ข้ามเขต $0.02/GB)

ที่มา - Google

Hiring! บริษัทที่น่าสนใจ

Carmen Software company cover
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd. company cover
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime company cover
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group company cover
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies company cover
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand company cover
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software company cover
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE company cover
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud company cover
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise company cover
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank company cover
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank company cover
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.) company cover
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd. company cover
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group company cover
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited company cover
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd. company cover
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV company cover
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB company cover
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd. company cover
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH company cover
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks company cover
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd. company cover
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech company cover
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd company cover
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand company cover
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai company cover
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand