Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Amazon Redshift Cookbook
Amazon Redshift Cookbook

Amazon Redshift Cookbook: Recipes for building modern data warehousing solutions , Second Edition

Arrow left icon
Profile Icon Shruti Worlikar Profile Icon Patel Profile Icon Anusha Challa
Arrow right icon
Mex$737.99 Mex$820.99
eBook Apr 2025 468 pages 2nd Edition
eBook
Mex$737.99 Mex$820.99
Paperback
Mex$1025.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Shruti Worlikar Profile Icon Patel Profile Icon Anusha Challa
Arrow right icon
Mex$737.99 Mex$820.99
eBook Apr 2025 468 pages 2nd Edition
eBook
Mex$737.99 Mex$820.99
Paperback
Mex$1025.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
Mex$737.99 Mex$820.99
Paperback
Mex$1025.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Amazon Redshift Cookbook

Data Management

Amazon Redshift is a data warehousing service optimized for online analytical processing (OLAP) applications. You can start with just a few hundred gigabytes (GB) of data and scale to a petabyte (PB) or more while maintaining high performance and cost-effectiveness. Its columnar storage architecture is specifically designed for large-scale analytics workloads, storing data by column rather than row. This approach is particularly efficient for OLAP operations as it allows Redshift to read only the specific columns needed for analysis, significantly improving query performance for operations like aggregations, trend analysis, and historical data comparisons. The columnar design also enables better data compression since similar data types are stored together, reducing storage costs and enhancing input/output (I/O) performance. By designing your database to take advantage of this columnar architecture, you can maximize the efficiency of your analytical processing workloads...

Technical requirements

In order to complete all the recipes in this chapter, you will need an Amazon Redshift data warehouse (either serverless or provisioned cluster) deployed, and a SQL client of your choice to access Amazon Redshift (for example, Amazon Redshift Query Editor V2, DBeaver, SQL Workbench/J, DataGrip, etc.).

Managing a database in Amazon Redshift

Amazon Redshift consists of at least one database, and it is the highest level in the namespace hierarchy for the database objects. This recipe will guide you through the steps needed to create and manage a database in an Amazon Redshift data warehouse.

Getting ready

To complete this recipe, you will need everything mentioned in the Technical requirements section at the start of the chapter.

How to do it…

Let’s now set up and configure a database on Amazon Redshift. Use the SQL client to connect to it and execute the following commands:

  1. We will create a new database called qa in the Amazon Redshift data warehouse that has the owner awsuser and accepts a maximum of 50 connections. To do this, use the following code:
    CREATE DATABASE qa
    WITH
    OWNER awsuser
    CONNECTION LIMIT 50;
    

OWNER and CONNECTION LIMIT are optional parameters. You can find the complete list of options available for...

Managing a schema in a database

In Amazon Redshift, a schema is a namespace that groups database objects such as tables, views, stored procedures, and so on. Organizing database objects in a schema is good for security monitoring, and it also means objects are logically grouped. In this recipe, we will create a sample schema that will be used to hold all the database objects.

Getting ready

To complete this recipe, you will need the following:

  • Access to any SQL interface, such as Query Editor V2 or a local SQL client
  • An Amazon Redshift data warehouse (serverless or provisioned cluster) endpoint
  • Log in as a superuser into an Amazon Redshift cluster

How to do it…

  1. Users can create a schema using the CREATE SCHEMA (https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_SCHEMA.html) command. The following steps will enable you to set up a schema with the name finance and add the necessary access to the groups:
  2. User groups...

Managing tables in a database

In Amazon Redshift, you can create a collection of tables within a schema with related entities and attributes. Working backward from your business requirements, you can use different modeling techniques to create tables in Amazon Redshift. You can choose a star or snowflake schema by using normalized, denormalized, or data vault data modeling techniques.

In this recipe, we will create tables in the finance schema, insert data into those tables, and cover the key concepts to leverage the massively parallel processing (MPP) and columnar architecture.

Getting ready

To complete this recipe, you will need everything mentioned in the Technical requirements section at the start of the chapter.

How to do it…

Let’s explore how to create tables in Amazon Redshift:

  1. Let’s create a customer table in the finance schema with the customer_number, first_name, last_name, and date_of_birth attributes:
    CREATE TABLE...

Managing views in a database

View database objects allow the result of a query to be stored. In Amazon Redshift, views run each time the view is mentioned in a query. The advantage of using a view instead of a table is that it can allow access to only a subset of data on a table, join more than one table into a single virtual table, and act as an aggregated table, and it takes up no space on the database since only the definition is saved, hence making it convenient to abstract complicated queries. In this recipe, we will create views to store queries for the underlying tables.

Getting ready

To complete this recipe, you will need everything mentioned in the Technical requirements section at the start of the chapter.

How to do it…

Let’s create a view using the CREATE VIEW command. We will use the following steps to create a view:

  1. Create a finance.customer_vw view based on the results of the query on finance.customer:
    CREATE VIEW finance...

Managing materialized views in a database

A materialized view is a database object that persists the results of a query to disk. In Amazon Redshift, materialized views allow frequently used complex queries to be stored as separate database objects, allowing you to access these database objects directly, and enabling faster query responses.

Employing materialized views is a common approach to powering repeatable queries in a business intelligence (BI) dashboard, and avoids expensive computation each time. Furthermore, materialized views allow an incremental refresh of the results, using the underlying table data. In this recipe, we will create a materialized view to query the tables and also to persist the results for a faster fetch.

Getting ready

To complete this recipe, you will need everything mentioned in the Technical requirements section at the start of the chapter.

How to do it…

Let’s create a materialized view using the CREATE MATERIALIZED...

Managing stored procedures in a database

Stored procedures in Amazon Redshift are user-created objects using the Procedural Language/PostgreSQL (PL/pgSQL) procedural programming language. Stored procedures support both data definition language (DDL) and data manipulation language (DML). Stored procedures can take in input arguments but do not necessarily need to return results. PL/pgSQL also supports conditional logic, loops, and case statements. Stored procedures are commonly used to build reusable extract, transform, load (ETL) data pipelines and serve the database administrator (DBA) to automate routine administrative activities—for example, periodically dropping unused tables.

The SECURITY attribute controls who has privileges to access certain database objects.

Stored procedures can be created with security definer controls to allow the execution of a procedure without giving access to underlying tables—for example, they can drop a table created by another...

Managing UDFs in a database

Scalar UDF functions in Amazon Redshift are routines that are able to take parameters, perform calculations, and return the results. UDFs are handy when performing complex calculations that can be stored and reused in a SQL statement. Amazon Redshift supports UDFs that can be authored using either Python or SQL. In addition, Amazon Redshift also supports AWS Lambda UDFs, which opens up further possibilities to invoke other AWS services.

For example, let’s say the latest customer address information is stored in AWS DynamoDB—you can invoke an AWS Lambda UDF to retrieve this using a SQL statement in Amazon Redshift.

Getting ready

To complete this recipe, you will need the following:

  • Everything mentioned in the Technical requirements section
  • Access to create an Identity and Access Management (IAM) role that can invoke AWS Lambda and attach it to Amazon Redshift
  • Access to create an AWS Lambda function
...
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn how to translate familiar data warehousing concepts into Redshift implementation
  • Use impressive Redshift features to optimize development, productionizing, and operation processes
  • Find out how to use advanced features such as concurrency scaling, Redshift Spectrum, and federated queries
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

Amazon Redshift Cookbook offers comprehensive guidance for leveraging AWS's fully managed cloud data warehousing service. Whether you're building new data warehouse workloads or migrating traditional on-premises platforms to the cloud, this essential resource delivers proven implementation strategies. Written by AWS specialists, these easy-to-follow recipes will equip you with the knowledge to successfully implement Amazon Redshift-based data analytics solutions using established best practices. The book focuses on Redshift architecture, showing you how to perform database administration tasks on Redshift. You'll learn how to optimize your data warehouse to quickly execute complex analytic queries against very large datasets. The book covers recipes to help you take full advantage of Redshift's columnar architecture and managed services. You'll discover how to deploy fully automated and highly scalable extract, transform, and load (ETL) processes, helping you minimize the operational effort that you invest in managing regular ETL pipelines and ensuring the timely and accurate refreshing of your data warehouse. By the end of this Redshift book, you'll be able to implement a Redshift-based data analytics solution by adopting best-practice approaches for solving commonly faced problems.

Who is this book for?

This book is for anyone involved in architecting, implementing, and optimizing an Amazon Redshift data warehouse, including data warehouse developers, data analysts, database administrators, data engineers, and data scientists. Basic knowledge of data warehousing, database systems, as well as cloud concepts and familiarity with Redshift is beneficial.

What you will learn

  • Integrate data warehouses with data lakes using AWS features
  • Create end-to-end analytical solutions from sourcing to consumption
  • Utilize Redshift's security for strict business requirements
  • Apply architectural insights with analytical recipes
  • Discover big data best practices for managed solutions
  • Enable data sharing for data mesh and hub-and-spoke architectures
  • Explore Redshift ML and generative AI with Amazon Q

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 25, 2025
Length: 468 pages
Edition : 2nd
Language : English
ISBN-13 : 9781836206903
Category :
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 25, 2025
Length: 468 pages
Edition : 2nd
Language : English
ISBN-13 : 9781836206903
Category :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Table of Contents

14 Chapters
Getting Started with Amazon Redshift Chevron down icon Chevron up icon
Data Management Chevron down icon Chevron up icon
Loading and Unloading Data Chevron down icon Chevron up icon
Zero-ETL Ingestions Chevron down icon Chevron up icon
Scalable Data Orchestration for Automation Chevron down icon Chevron up icon
Platform Authorization and Security Chevron down icon Chevron up icon
Data Authorization and Security Chevron down icon Chevron up icon
Performance Optimization Chevron down icon Chevron up icon
Cost Optimization Chevron down icon Chevron up icon
Lakehouse Architecture Chevron down icon Chevron up icon
Data Sharing with Amazon Redshift Chevron down icon Chevron up icon
Generative AI and ML with Amazon Redshift Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Modal Close icon
Modal Close icon