Upload
dataconomy-media
View
120
Download
3
Embed Size (px)
Citation preview
Databasesthe Choice Is Yours
Philipp Krenn @xeraa
Infrastructure | Developer Advocate
"relational model and normal form"
↓
"data independence"
Relational AlgebraBook "Seven Databases in Seven Weeks"
DeclarativeImplementation detail of the RDBMS
(Query Optimizer)
User InteractionAggregated reports
Concurrency, integrity, consistency, type-safety
From a
Wide Variety of Databasesto
A Dark Age
http://blog.8thlight.com/uncle-bob/2012/05/15/NODB.html
Slow &inflexible
Schema Flexibilityhttp://pragprog.com/magazines/2012-05/beyond-the-bit-bucket
NoSQLNot Only SQL
Big DataVery broad, including NoSQL
Offline data / data warehouse,Hadoop & Spark
http://db-engines.com/en/ranking
CouchDB, Couchbase, Elasticsearch,...
Ted Neward: ORM is "The Vietnam of Computer Science"
http://blogs.tedneward.com/post/the-vietnam-of-computer-science/
@OneToMany(mappedBy = "destCustomerId")@ManyToMany@Fetch(FetchMode.SUBSELECT)@JoinTable(name = "customer_dealer_map", joinColumns = { @JoinColumn(name = "customer_id", referencedColumnName = "id")}, inverseJoinColumns = { @JoinColumn(name = "dealer_id", referencedColumnName = "id")})private Collection<Client> dealers;
public abstract class EmployeeEntity { protected String name;}public class ManagerEntity extends EmployeeEntity { protected Boolean approveFunds;}public class WorkerEntity extends EmployeeEntity { protected Integer yearsExperience;}
RDBMS1. Union table with (many) NULL
values
RDBMS2. Concrete instances without common
queries
RDBMS3. Base table JOINed with concrete
instances
@Entity(value = "employee")public abstract class EmployeeEntity { @Id protected ObjectId id; protected String name;}public class ManagerEntity extends EmployeeEntity { protected Boolean approveFunds;}public class WorkerEntity extends EmployeeEntity { protected Integer yearsExperience;}
{ "_id": ObjectId("5461c8bf9e2acf32ed50c079"), "className": "net.xeraa.morphia_demo.entities.ManagerEntity", "name": "Peter", "approveFunds": true}{ "_id": ObjectId("524d9fe7e4b0f8bd3031f84e"), "className": "net.xeraa.morphia_demo.entities.WorkerEntity", "name": "Philipp", "yearsExperience": 10}
Key-Value Storeand more
REmote DIctionary Server
Statistics (Login)Bitset
HyperLogLog
BitsetFirst user bit 1, second user bit 2,...
A million users ~123KB
HyperLogLogUnique elements in 12KB regardless of
their numberError rate ~0,81%
http://redis.io/commands/pfcount
ComparisonHyperLogLog: constant sizeBitset: exact & aggregates
Scalable & highly available
Consistent Hashing
Eventually consistent was too hard, so we went with
immediately inaccurate.— https://twitter.com/mysqlborat/status/621785755107524608
SQL Databasesnot only RDBMS
Cassandra Query Language (CQL)Google Query Language (GQL)
Couchbase N1QLRethinkDB Query Language (ReQL)
RDBMS features & maturity+
NoSQL influence
Full-Text Search
Document ScoreTerm Frequency (TF) / Inverse
Document Frequency (IDF)Field-length norm
https://www.elastic.co/guide/en/elasticsearch/guide/current/scoring-theory.html
Conclusion
But is it fast?
Thanks!Questions? Swag
@xeraa
CreditsSchnitzel https://flic.kr/p/9m27wm
Architecture https://flic.kr/p/6dwCAeConchita https://flic.kr/p/nBqSHT
Twelve: https://flic.kr/p/3iRDd9Consistent hashing https://
highlyscalable.wordpress.com/2012/09/18/
CreditsFull-text search https://developer.apple.com/library/mac/documentation/UserExperience/
Conceptual/SearchKitConcepts/searchKit_basics/searchKit_basics.htmlNo, SQL https://twitter.com/edd/status/
400190499585544192