2. Agenda
1. Datenbank-Umfeld
2. Was ist Amazon SimpleDB?
3. Features
4. Deep Dive
5. Einschränkungen und Grenzen
6. Use Cases
7. Kosten
8. Getting started
2
3. Amazon SimpleDB
‣ Einfach
‣ Skalierbar
‣ Günstig
‣ Migrationspfad für SQL-Fans
„Simplicity is the ultimate sophistication.“
(Leonardo da Vinci)
3
5. SQL NoSQL
DBs DBs
MySQL MongoDB
AWS SimpleDB
PostgreSQL CouchDB
Google BigTable
Cassandra
SQL Server
Oracle
5
6. Relationale Key/Value
Object DB
DB Store
MySQL AWS SimpleDB CouchDB
PostgreSQL Google BigTable MongoDB
SQLite
AWS DynamoDB
SQL Server Cassandra
Oracle
Neo4j
Graph
6
7. ‣ Eigene Infrastruktur ‣ Virtualisierte ‣ Keine Infrastruktur
Infrastruktur
‣ Datenhoheit ‣ Datenhoheit (?)
‣ Datenhoheit SLA!
‣ Volle Kontrolle
Local/ Cloud Cloud
Hosted Hosted DB
DB DB
‣ Hohe Investitionen ‣ Niedrige Startup-Kosten ‣ Keine Startup-Kosten
‣ Hohe Betriebskosten ‣ Höhere Betriebskosten ‣ Rein Nutzungsbasierte
Kosten
‣ Schlecht skalierbar ‣ Schneller Skalierbar
‣ Automatische Skalierung
‣ Wartungsaufwändig ‣ Weniger Wartung
‣ Keine Wartung
7
9. Relationale
SimpleDB Object DB
DB
Einfache Datentypen Nur Strings Komplexe Datentypen
Fixes Schema Schema-frei Schlüssel-Schema
JOINs Keine Relationen Keine Relationen
Aggregationen Keine Aggregationen Aggregation via Map/Reduce
Extrem ausgereift Sehr solide und simpel Grössere Komplexität
SQL-Syntax API & SQL-Like-Syntax Nur via API
OO-Entwicklung via ORM Nutzung via HTTP o. SDK Nutzung via SDK
Umfangreiches Ökosystem Wenig Tools Wenig Tools
9
11. Konzept
‣ Domains
• Daten-Container ähnlich einer Tabelle
aber ohne fixes Schema
‣ Items
• Ein Datensatz mit ein- oder mehreren Key/Value-Paaren
‣ Attributes
• „Spalten“
‣ Values
• „Zellen“
11
21. Betrieb
‣ Keine eigene Infrastuktur
• Keine Hardware, keine Software
• Keine Installation
‣ Hochverfügbar
• Geo-redundante Replikation
• Automatisches Failover
• Unlimitierte* Ressourcen
‣ Administrationsfrei
• Keine Konfiguration
• Automatische Leistungsoptimierung
‣ Sicher
• Verschlüsselte Kommunikation via HTTPS
• Ausgereiftes Rechtssystem
21
22. Entwicklung
‣ Speichern & Abfragen via HTTPS-Requests
• Selbst via HTTPS (REST, SOAP) ansprechen
• SDKs für alle gängigen Entwicklungsumgebungen
‣ Flexibel
• Kein fixes Schema
• Konsistente oder Nicht-konsistente Abfragen (schneller)
‣ Full Auto-Index
• Jedes Attribut wird vollständig indexiert
22
23. Entwicklung
‣ Mehrere „Endpunkte“ verfügbar
• Dublin
• USA Ost- und 2xWestküste
• Tokio
• Sao Paulo
23
24. Performance
‣ Ausführungsdauer der Abfrage
• Üblicherweise weit unter 20ms
‣ Netzwerk-Latenz
• „Durchschnittliche“ WLAN-Verbindung: 60-80ms
• Kann durch EC2 Server auf bis zu 2ms reduziert werden
• Sonst Daten Applikations-seitig cachen, wenn Performance-kritisch ist
‣ Mehr Performance durch Parallelisierung
‣ Fazit
• Mindest-Latenz etwas höher, dafür gleichbleibend auch bei ultimativen
Lastspitzen
24
27. SQL-Syntax
‣ select output_list
from domain
where expression
order by sort_instruction
limit 100
‣ sdb.select(„select * from bestellungen“);
27
28. SQL-Syntax
‣ select count(*) from domain
‣ select * from domain
‣ select itemName() from domain
‣ select name,city,article from domain
28
29. select * from domain
‣ where article [=,!=,<,<=,=>,>] `a-1000`
‣ where article [not] like `a-%`
‣ where article between ´a-1000´ and ´a-9999´
‣ where article in (´a-1000´, ´b-2000´)
‣ where article is [not] null
‣ where every(article) like ´a-%´
29
50. Tools
‣ Migration von MySQL auf SimpleDB
• http://learnaws.s3.amazonaws.com/Migrating_MySQL_to_SimpleDB.pdf
50
51. Getting started
‣ AWS Account eröffnen
• http://aws.amazon.com
‣ SDKs und Tools herunterladen
‣ Loslegen :-)
51
52. Getting started
‣ „With SimpleDB you get a rock-solid, globally available database
which can be scaled infinitely. But I don't say that it is the best
NoSQL-database, but maybe a good start for people coming from
the SQL-world and want to jumpstart into NoSQL.“
52