NoSQL Databases & DynamoDB

Amazon DynamoDB (DDB) 101

DDB Concepts
DDB Tables
DDB Backups

On-Demand Backups

Point-in-Time Recovery (PITR)

DynamoDB – Operations, Consistency & Performance

DDB Capacity and R/W Operations
DDB Common Read Operations

DDB Query Operation

DDB Scan Operation

DDB Consistency Model for Read Operations
DDB Performance Calculations (Provisioned Capacity)

DynamoDB Indexes (LSIs and GSIs)

DynamoDB Indexes
Local Secondary Index (LSI)
Global Secondary Index (GSI)

DynamoDB Streams & Triggers

DynamoDB Streams

DynamoDB Triggers

DynamoDB Global Tables

DynamoDB Global Tables

DynamoDB Accelerator (DAX)

Using a Traditional Cache with DynamoDB

DynamoDB Accelerator (DAX) – Overview

DAX Architecture

DAX Features

DynamoDB TTL

DynamoDB Time-to-Live (TTL)

Amazon Athena 101

Amazon Athena – Core Concepts

Athena Architecture

Athena Use Cases

Demo: Querying OpenStreetMap’s Planet OSM with Athena

Objective: Retrieve locations of all veterinary facilities in a specific geographic region.

  1. Determine coordinates of the area using Google Earth
  2. Source data in S3 bucket s3://osm-pds/planet/ contains Planet OSM data:
    • node – individual points with metadata
    • way – boundaries or areas
    • relationship – relationships between nodes/ways
  3. Create an S3 bucket to store query results
Querying in Athena
  1. Create a database:
CREATE DATABASE A4L;
  1. Create a planet table:
CREATE EXTERNAL TABLE planet (
id BIGINT,
type STRING,
tags MAP<STRING,STRING>,
lat DECIMAL(9,7),
lon DECIMAL(10,7),
nds ARRAY<STRUCT<ref: BIGINT>>,
members ARRAY<STRUCT<type: STRING, ref: BIGINT, role: STRING>>,
changeset BIGINT,
timestamp TIMESTAMP,
uid BIGINT,
user STRING,
version BIGINT
)
STORED AS ORCFILE
LOCATION 's3://osm-pds/planet/';
  1. Test query – retrieve 100 rows:
SELECT * FROM planet LIMIT 100;
  1. Query all veterinary amenities in a region (e.g., Brisbane, AUS):
SELECT * FROM planet
WHERE type = 'node'
AND tags['amenity'] IN ('veterinary')
AND lat BETWEEN -27.8 AND -27.3
AND lon BETWEEN 152.2 AND 153.5;

Screenshot of Demo inside Athena:

Amazon ElastiCache

ElastiCache Overview
ElastiCache Architectures

Caching Architecture

Session State Architecture

ElastiCache Engines

Redis vs Memcached Comparison

FeatureRedisMemcached
Data structuresAdvanced (lists, sets, sorted sets, hashes, bit arrays)Simple (strings only)
Multi-AZ / HASupports replication across AZs → regionally resilientNo replication; sharding possible but no regional resilience
BackupsSupportedNot supported
Multi-threadingSingle-threadedMulti-threaded → can leverage multi-core CPUs for higher performance
TransactionsSupported → multiple operations treated atomicallyNot supported

Amazon Redshift 101

Redshift Overview
Redshift Architecture
Redshift Resilience and Recovery

Snapshots can restore to any region → quick DR deployment if primary AZ/region fails

AZ-resilient by design

Writes replicated to a secondary node

Entire cluster fails if the AZ goes down

Recovery options:

Automatic backups to S3

Occur ~every 8 hours or every 5 GB written

Retention configurable: 0–35 days (default 1 day)

Manual snapshots

Customers manage retention; snapshots persist indefinitely if desired

Backup capacity equal to cluster size is included at no cost

Incremental backups only store changes since the previous backup

Backups benefit from S3 resilience and security

Regional durability by default; global durability via S3 replication