Skip to Content
DuckDB: 起動して実行中
book

DuckDB: 起動して実行中

by Wei-Meng Lee
March 2025
Intermediate to advanced
308 pages
5h 8m
Japanese
O'Reilly Media, Inc.
Content preview from DuckDB: 起動して実行中

第9章. MotherDuckを使ってクラウドでDuckDBを使う

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

これまで、ローカルに保存されているデータであれ、リモートサーバに保存されているデータであれ、マシンにインストールしたDuckDBを使ってデータを操作する方法を学んできた。マシン上でDuckDBを使用するには、DuckDBをインストールし、Anacondaなどの開発環境をセットアップする必要がある。しかし、マシンをセットアップする手間をかけずに、データを高速に分析したい場合はどうすればいいのだろうか?MotherDuckの登場だ。

MotherDuckは、DuckDB上に構築されたサーバーレスのクラウド分析プラットフォームである。クラウドベースの管理性、拡張性、高度な分析機能を提供することで、DuckDBを強化している。要するに、自分のマシンをセットアップしなくても、MotherDuckを使って本書で学んだすべての演算子を実行できるのだ。エキサイティングだろう?

この章では、MotherDuckを使い始め、分析タスクに活用する方法を説明する。具体的には、以下のことを学ぶ:

  • データベースのアップロードと作成

  • データベースを他者と共有する

  • 共有データベースをアタッチする

  • データベースへのクエリ

  • SDL文の作成にAIを活用する

  • ローカルのDuckDBデータベースとMotherDuckを接続する

  • ローカルとリモートのDuckDBデータベースを操作するハイブリッドクエリを実行する。

まずはマザーダックについての基本的なことから始めよう。

マザーダックについて

多くのデータ分析ユーザにとって、複雑なデータインフラは必ずしも必要ではない。必要なのは、データを簡単にホストし共有できるサーバーレス・データウェアハウスであることが多い。この、MotherDuckの出番だ。MotherDuckを使えば、簡単にデータをクラウドにアップロードし、クエリを開始することができる。MotherDuckは、Parquet、CSV、JSON、Iceberg、Delta Lakeといった様々なデータ形式をサポートしている。さらに、デュアル実行と呼ばれる機能により、クエリの一部をローカルで実行し、他の一部をクラウドで実行することができる。

さらに、MotherDuckは各ユーザに個別の独立したコンピュートインスタンスを代入することで、管理を効率化し、コストを削減する。これらのインスタンスは、数テラバイトに及ぶワークロードを管理するために、個別に拡張することができる。

これからのセクションでは、MotherDuckを使い始め、クラウド上でデータベースを作成する方法を紹介する。

マザーダックに登録する

MotherDuckを使い始めるには、まず、30日間の無料トライアルを開始する。トライアル期間終了後、無料アカウントを継続するか、有料プランにアップグレードするかを選択できる。始め方はこちら:

  1. https://motherduck.com。

  2. 30DAY TRIALボタンをクリックする(図9-1参照)。

MotherDuckの本番インフラはAmazon Web Servicesでホストされており、サービスは主にKubernetes制御のコンテナとして稼働している。

この試用期間中にMotherDuckの機能を試してみてから、アカウントの好みを決めることができる。

図9-1. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Rustの練習帳 ―コマンドラインツールの作成を通してRustを学ぶ

Rustの練習帳 ―コマンドラインツールの作成を通してRustを学ぶ

Ken Youens-Clark, 中山 光樹
AWSでのサーバーレス開発

AWSでのサーバーレス開発

Sheen Brisals, Luke Hedger

Publisher Resources

ISBN: 9798341633889