48
SQL oder NoSQL die Auswahl der richtigen Datenbankplattform für die Cloud Steffen Krause Technical Evangelist @AWS_Aktuell [email protected]

SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Embed Size (px)

Citation preview

Page 1: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

SQL oder NoSQLdie Auswahl der richtigen Datenbankplattform für die

Cloud

Steffen KrauseTechnical Evangelist

@[email protected]

Page 2: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Das richtige Werkzeug

Wenn man nur einen Hammer hat sieht jedes Problem wie ein Nagel aus

Page 3: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Fokus auf Ihre Anwendung

Page 4: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud
Page 5: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Das universelle Systemdiagramm

Page 6: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Application Tier

Load Balancer

Database tier

Ihr Stack

Page 7: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Application tier

Load balancer

Database tier

Sicherheit, Innovation, Skalierung, Transaktionen, Performance, Persistenz,Verfügbarkeit, Kenntnisse..

Sicherheit, Innovation, Skalierung, Performance, Verfügbarkeit…

Sicherheit, Skalierung, Verfügbarkeit…

Ihr Stack der Sorgen

Page 8: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Auf AWS nicht verfügbar

Spektrum der Optionen

SQL NoSQL

Geringe Kosten Hohe Kosten

Do-it yourself Vollständig verwaltet

Page 9: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

OL(T?)P

Page 10: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Anwendungsfall: Relational

Page 11: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud
Page 12: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

ACID

•AtomicityA•ConsistencyC• IsolationI•DurabilityD

Page 13: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Vertikale Skalierung – RAM, CPU usw.

Skalierung

Page 14: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Komplexes Schema

Page 15: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Optionen - Relational

Do-it YourselfVollständig

verwaltet

Relational Database Service (RDS)Jede relationale x64/x86 Datenbank die Sie wollen

OracleSQL ServerMySQLPostgresMariaDBDB2Sybase…

Page 16: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Kernkomponenten

• Amazon Virtual Private Cloud (Amazon VPC)• Elastic Block Store (EBS) provisioned IOPS Volumes– Bis zu 4000 IOPS pro Volume (bis 30000 mit RDS)– Striping über mehrere Volumes möglich

• EBS-optimized Instanzen• Oracle Automatic Storage Management (ASM)• Oracle Data Guard und Active Data Guard• Oracle Secure Backup Cloud Module• Oracle Transparent Data Encryption (TDE)

Page 17: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Primary Region

Primary Availability Zone

AMI(Ready to launch)

Oracle DB Server

Public Subnet

AppServers

Private Subnet

Mirrored Redo Log Volumes

Root Volume

Backup Volume

Data Volume

RMANEBS Snapshot

S3 Bucket

DR Region

EBS Snapshot Copy

PIOPS

Standard Oracle Architektur auf EC2

Page 18: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Primary Region

Primary Availability Zone

CloudFormationTemplate

(Ready to launch)

Oracle DB Server

Public Subnet Private Subnet

Root Volume

Mirrored Redo log Volumes

Root Volume

DR Region

PIOPS

Secondary Availability Zone

Oracle DB Server

Private Subnet

Root Volume

ASM Striped Data Volumes

PIOPS PIOPS

RMAN Backup inS3 Bucket

AMI Used by CFN Template

OSB + RMAN

OSB + RMAN

Public Subnet

Root Volume

AppWeb

Servers

AppWeb

Servers

ASM Striped Data Volumes

Oracle Data Guard

Enterprise Architektur auf EC2

Page 19: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Primary Region

Primary Availability Zone

Oracle DB Server

Public Subnet Private Subnet

Secondary Availability Zone

Oracle DB Server

Private Subnet

RDS Synchronous Replication

Public SubnetApp

Web Servers

AppWeb

Servers

Automated Backups

Vereinfachung: Amazon RDS for Oracle

Page 20: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

SQL Server 2012 AlwaysOn Availability Groups in AWSRemote

Admin & MgmtUsers

AWS Region

Availability Zone 1 Availability Zone 2

PrimaryDC/DNS

RerplicaDC/DNS

Windows Server Failover Clustering (WSFC) Cluster

NodeWSFC Configuration

Storage

SQL Server Instance

Instance Network Name

NodeWSFC Configuration

Storage

SQL Server Instance

Instance Network Name

AlwaysOn Availability GroupPrimary Replica Secondary Replica

Availability Group Listener Virtual Network Name

NATInstance

RDGWInstance

NATInstance

RDGWInstance

Elastic IP’s (Public Route) Elastic IP’s (Public Route)

Private IP’s (Private Route)

Private IP’s (Private Route)

Page 21: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Compute Storage

AWS Global Infrastructure

Database

App Services

Deployment & Administration

Networking

Relational Database ServiceDatabase-as-a-Service

Datenbank-Instanzen ohne Installation und Administration

Skalierbare und fehlertolerante Konfigurationen

Feature Details

Multi-Plattform MySQL, Microsoft SQL Server und Oracle RDBMS

Vorkonfiguriert Sofort nutzbare Instanzen mit sinnvollen Standardeinstellungen

Automatisches Patching

Datenbankplattform wird optional automatisch aktuell gehalten

Backups Automatische Backups, Point in Time Recovery möglich

Provisioned IOPS Definierter IO-Durchsatz entsprechend der Anforderungen (bis 30000)

Failover Automatischer Failover auf zweiten Host bei Ausfall des primären

Replikation Einfache Erstellung von Lese-Replikas, einfache Replikation in andere Availability Zone

Relationale Datenbank

Page 22: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Fallst

udie

Amazon Relational Database Service (Amazon RDS) databases stores forum threads, site content, and project configuration data.

High availability Multi-AZ database deployment to handle live game metadata and user-generated content.

Enterprise-grade fault tolerance for protecting customer data.

By managing time-consuming database administration tasks, Amazon RDS allows SEGA to focus on business critical applications.

Relationale Datenbank

Compute Storage

AWS Global Infrastructure

Database

App Services

Deployment & Administration

Networking

Page 23: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Demo: RDShttp://bit.ly/RDSDemoDE

Page 24: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

• Verwenden Sie mehrere Availability Zones– RDS bietet MultiAZ für Oracle und MySQL

• Verwenden Sie Provisioned IOPs– Bis zu 30000 für RDS– Bis zu 4000 für EBS Volumes

• Striping (RAID 0) möglich für mehr

• Backup nach S3– Verwendung von DB Snapshots oder EBS Snapshots oder direktes S3 Backup wenn

unterstützt (z.B. Oracle RMAN)• Verwenden Sie geeignete Instanztypen• Skalierung hoch/runter innerhalb von 5-20 Minuten durch Änderung des

Instanztyps

Best Practices: RDBMS auf AWS

Page 25: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Anwendungsfall: NoSQL

Page 26: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Massives Scale Out

Page 27: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Flexibles Schema

2 Wochen später

Page 28: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Niedrige Latenz

Page 29: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

•Basically AvailableB A

•Soft stateS

•Eventually consistentE

NoSQL

* Aber einige NoSQL Datenbanken bieten voll transaktionale Schreiboperationen

Page 30: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Horizontales Scaling – RAM, CPU usw.

Scaling

Page 31: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Optionen - NoSQL

Do-it YourselfVollständig

verwaltet

DynamoDBJede x64/x86 NoSQL Datenbank die Sie wollen

MongoDBCassandraRiakRedisCouchDBMemcache…

SimpleDB

(ElastiCache: Memcache, Redis))

Page 32: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

• Whitepaper dokumentieren NoSQL Datenbanken auf AWS– http://aws.amazon.com/whitepapers– Couchbase on AWS– Riak on AWS– MongoDB on AWS

NoSQL Datenbanken auf AWS

Page 33: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Compute Storage

AWS Global Infrastructure

Database

App Services

Deployment & Administration

Networking

DynamoDBNoSQL Datenbank mit provisioniertem Durchsatz

Hohe, vorhersagbare Performance

Vollständig verteilte, fehlertolerante Architektur

Feature Details

Provisionierter Durchsatz

Lese/Schreibdurchsatz einfach nach Bedarf erhöhen und vermindern

Vorhersagbare Performance

Durchschnittliche Latenz im einstelligen Millisekunden-Bereich durch SSDs

Starke Konsistenz Sicheres Lesen der aktuellsten Werte

Fehlertolerant Daten repliziert über mehrere Availability Zones

Monitoring Integration mit CloudWatch

Sicher Integration mit AWS Identity and Access Management (IAM)

Elastic MapReduce

Integration mit Elastic MapReduce (Hadoop) für komplexe Analysen oder große Datenmengen

NoSQL Datenbank

Page 34: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Fallst

udie

"When IMDb launches features to our over 110MM monthly unique users worldwide, we want to be prepared for rapid growth (1000x

scale), and for customers to use our software in exciting and different ways…

…To ensure we could scale quickly, we migrated IMDb’s popular 10 star rating system to

DynamoDB. We evaluated several technologies and chose DynamoDB because it is a high-performance database system that scales

seamlessly and is fully managed. This saves us a ton of development time and allows us to focus

our resources on building better products for our customers, while still feeling confident in our

ability to handle growth.”

H.B. Siegel, CTO, IMDb.

NoSQL Datenbank

Compute Storage

AWS Global Infrastructure

Database

App Services

Deployment & Administration

Networking

Page 35: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Demo: DynamoDBhttp://bit.ly/SQLNoSQLDE ab 23:57

Page 36: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Data WarehousingReporting & Analytics

Page 37: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Komplexes Schema

Page 38: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Komplexes Schema

OK, hatten wir schon: Relational (RDS oder EC2)Wenn die Datenmenge nicht zu groß ist

Page 39: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Aber was ist mit:• Richtig großen

Datenmengen• Niedrigen Kosten?

Data Warehousing

Page 40: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Compute Storage

AWS Global Infrastructure

Database

App Services

Deployment & Administration

Networking

Data Warehouse

RedshiftSchnelle und performante Analyse großer Datenmengen

1/10 der Kosten eines traditionellen Data Warehouse

Automatisches Deployment & Administration

Feature Details

Skalierung Skaliert von Terabytes bis Petabytes

Niedrige Kosten Preise ab US$999/TB/Jahr

Columnstore Spaltenweise Speicherung optimiert für DWH Workloads

Fehlertolerant Automatische Ersetzung von Nodes & Disks, Automatisches Backup nach S3

Vollständig verwaltet

Automatisches OS & Software Patching

Sicher Redshift Daten können verschlüsselt werden

Kompatibel Kompatibel mit populären BI Tools über ODBC und JDBC Treiber

Page 41: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Demo: Redshifthttp://bit.ly/RedshiftDE

Page 42: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

cr1.8xlarge hat 244 GB RAM!

Image Copyright by StuSeeger http://www.flickr.com/photos/stuseeger/

Direkt aus dem AWS Marketplace

Page 43: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

SAP HANA on AWS

Premium Business DeveloperOverview SAP HANA One, plus SAP Cloud Integration (HCI)

and approval to load SAP source dataFully featured SAP HANA virtual appliance on AWS Fully featured SAP HANA virtual appliance

on AWS for individual developers

Use Cases Production and non-production All SAP HANA use cases supported including SAP

Business Suite and SAP NetWeaver Business Warehouse on HANA

Production and non-production Analytics acceleration Data merging Temporary event-based analytics Self-service BI Prototypes and proofs-of-concept

Non-production only Develop, test and demo applications on

top of the HANA platform Learning environment

Key Benefits Instant provisioning Enterprise Support included Annual subscription pricing – economical for

24x7 customers Data Services included

Instant, self-serve access – up and running in 10 minutes

Start and stop when needed – reduce license and infrastructure cost

Community support

Free developer license Easily accessible and rapidly deployable Pay-per-use infrastructure

License Annual subscription On-demand - $0.99 per hour Free Developer License

Available fromSAP HANA Marketplace AWS Marketplace SAP SCN

SAP HANA One

Demo: http://aws.typepad.com/aws/2013/05/demo-sap-hana-one-on-aws.html

Page 44: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Demo: SAP HANAhttp://bit.ly/HanaDemoDE

Page 45: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

Halt, was ist mit Hadoop?• Vollständig verwalteter Hadoop Service: EMR (Elastic MapReduce)– Einfaches Erstellen von Clustern in Minuten– Verwendung von S3 als skalierbarer Speicher ohne Kopieren von Daten

• Viele Kunden verwendne Hadoop für DWH-artige Workloads– Weil das lange zeit die einzige skalierbare, kostengünstige Möglichkeit war– In vielen Fällen ist Redshift für DWH Workloads schneller und preiswerter

• Hadoop/EMR ist erste Wahl für komplexe Berechnungen auf großen Datenmengen– Auch für explorative oder ETL-artige Jobs

Elastic MapReduce

Page 46: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

DWH Workflow Beispiel

S3 S3

EMRRedshift

Logs / Dateien

DataPipeline

Reporting und BI

explorativeAnalytik

Page 47: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

• Wählen Sie das richtige Werkzeug für die Aufgabe• Ihre Wahl: Relational oder NoSQL– Verwenden Sie RDS für Prototyping und hochwertige Daten– Verwenden Sie Amazon DynamoDB für hochperformante,

persistente, kostengünstige Speicherung– Verwenden Sie Redshift für skalierbares, kostengünstiges Data

Warehousing• Ihre Wahl: Do-it-yourself oder voll verwaltet– Verwaltete Dienste ermöglichen Ihnen den Fokus auf die eigentliche

Aufgabe

Zusammenfassung

Page 48: SQL oder NoSQL - Die Auswahl der richtigen Datenbankplattform für die Cloud

• http://aws.amazon.com/de • Getting started with Free Tier:

http://aws.amazon.com/de/free/• 25 US$ credits für neue Kunden:

http://aws.amazon.com/de/campaigns/account/• Twitter: @AWS_Aktuell• Facebook:

http://www.facebook.com/awsaktuell • Webinare: http://aws.amazon.com/de/about-aws/events/• Slides: http://de.slideshare.net/AWSAktuell

Ressourcen