You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
π DynamoDB Useful Tables β Healthcare System Analogy
π DynamoDB WCU & RCU Calculation Formulas
πΉ Read Capacity Units (RCU) Calculation
Metric
Formula
Description
RCU (Strongly Consistent Reads)
RCU = (Item size in KB / 4 KB) * 1
Each strongly consistent read requires full RCU allocation
RCU (Eventually Consistent Reads)
RCU = (Item size in KB / 4 KB) * 0.5
Eventually consistent reads consume half the RCU
RCU (Transactional Reads)
RCU = (Item size in KB / 4 KB) * 2
Transactional reads require double the RCU
πΉ Write Capacity Units (WCU) Calculation
Metric
Formula
Description
WCU (Standard Writes)
WCU = (Item size in KB / 1 KB)
Each write consumes WCU based on item size
WCU (Transactional Writes)
WCU = (Item size in KB / 1 KB) * 2
Transactional writes require double the WCU
π‘ These formulas help estimate the required WCU and RCU for efficient DynamoDB capacity planning! π
π DynamoDB Key Features & Healthcare Analogy
DynamoDB Feature
Healthcare System Equivalent
Purpose π
Primary Key (Partition Key + Sort Key)
Unique Patient ID & Medical Record Number
Ensures quick patient record retrieval
Global Secondary Index (GSI)
Searching patients by blood type or disease
Fast alternate queries
Local Secondary Index (LSI)
Organizing patient history within a department
Optimized sorting
DynamoDB DAX (Cache Layer)
Emergency Fast Track for critical patients
Reduces latency for urgent lookups and speeds up frequently accessed data
DynamoDB Streams
Real-time medical alert system
Tracks data changes & triggers workflows
Time-To-Live (TTL)
Auto-archiving old patient records
Deletes outdated or unnecessary data
DynamoDB Transactions
Coordinating multi-department patient care
Ensures atomic, consistent updates
DynamoDB PartiQL
Querying records with SQL-like syntax
Enables complex queries on NoSQL
DynamoDB CLI
Doctor's quick-access terminal
Manages records via command line
DynamoDB Conditional Writes
Preventing duplicate prescriptions
Ensures no conflicting updates
DynamoDB Session State
Keeping logged-in doctorβs session active
Stores temporary session data
βοΈ DynamoDB API Operations β CRUD for Patient Records
API Operation
Healthcare Equivalent
Function π₯
PutItem
Registering a new patient
Adds a new record to the system
GetItem
Looking up a patientβs history
Retrieves an existing record
UpdateItem
Updating patient treatment progress
Modifies an existing record
DeleteItem
Archiving old patient records
Removes outdated entries
BatchWriteItem
Processing multiple lab reports at once
Writes multiple records in one call
BatchGetItem
Retrieving multiple patient histories
Fetches multiple records at once
Query
Searching for all patients with a certain condition
Retrieves data using indexes
Scan
Checking all patients in a department
Reads entire table (less efficient)
π DynamoDB vs. Other Databases β Feature Comparison
Feature
DynamoDB (NoSQL)
RDS (SQL Databases)
MongoDB (NoSQL Document DB)
Cassandra (Wide-Column NoSQL)
Schema Type
Schema-less (Key-Value, JSON)
Structured (Relational)
Schema-flexible (JSON/BSON)
Schema-less (Column-Family)
Scalability
Auto-scales, serverless π
Vertical & manual scaling ποΈ
Horizontal scaling
Horizontally scalable
Performance
Millisecond latency β‘
Dependent on indexing
Fast for document queries
Optimized for write-heavy workloads
Indexes
GSIs, LSIs
Primary & Secondary Indexes
Indexing on document fields
Tuned for high-performance queries
ACID Compliance
Supports Transactions β
Fully ACID compliant β
Supports transactions
Limited ACID properties
Use Case
High-traffic apps, real-time data
Complex relationships, OLTP
Flexible document storage
Time-series, logging, IoT
Availability
Multi-region, highly available π
Single-region unless set up
Replication for availability
Distributed, high-availability
Pricing Model
Pay-per-use, serverless π°
Instance-based pricing
Subscription or self-hosted
Pay-per-node-based pricing
π‘ DynamoDB is ideal for high-speed, scalable applications, whereas RDS is better for structured relational data. Choose based on your specific use case! π