"Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic
-
Upload
dataconomy-media -
Category
Data & Analytics
-
view
121 -
download
3
Transcript of "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic
![Page 1: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/1.jpg)
Databasesthe Choice Is Yours
Philipp Krenn @xeraa
![Page 2: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/2.jpg)
![Page 3: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/3.jpg)
![Page 4: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/4.jpg)
![Page 5: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/5.jpg)
Infrastructure | Developer Advocate
![Page 6: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/6.jpg)
![Page 7: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/7.jpg)
"relational model and normal form"
↓
"data independence"
![Page 8: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/8.jpg)
Relational AlgebraBook "Seven Databases in Seven Weeks"
![Page 9: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/9.jpg)
![Page 10: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/10.jpg)
DeclarativeImplementation detail of the RDBMS
(Query Optimizer)
![Page 11: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/11.jpg)
User InteractionAggregated reports
Concurrency, integrity, consistency, type-safety
![Page 12: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/12.jpg)
From a
Wide Variety of Databasesto
A Dark Age
![Page 13: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/13.jpg)
![Page 14: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/14.jpg)
http://blog.8thlight.com/uncle-bob/2012/05/15/NODB.html
![Page 15: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/15.jpg)
Slow &inflexible
![Page 16: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/16.jpg)
Schema Flexibilityhttp://pragprog.com/magazines/2012-05/beyond-the-bit-bucket
![Page 17: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/17.jpg)
![Page 18: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/18.jpg)
![Page 19: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/19.jpg)
![Page 20: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/20.jpg)
NoSQLNot Only SQL
![Page 21: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/21.jpg)
![Page 22: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/22.jpg)
![Page 23: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/23.jpg)
Big DataVery broad, including NoSQL
Offline data / data warehouse,Hadoop & Spark
![Page 24: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/24.jpg)
![Page 26: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/26.jpg)
![Page 27: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/27.jpg)
CouchDB, Couchbase, Elasticsearch,...
![Page 28: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/28.jpg)
Ted Neward: ORM is "The Vietnam of Computer Science"
http://blogs.tedneward.com/post/the-vietnam-of-computer-science/
![Page 29: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/29.jpg)
@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;
![Page 30: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/30.jpg)
![Page 31: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/31.jpg)
public abstract class EmployeeEntity { protected String name;}public class ManagerEntity extends EmployeeEntity { protected Boolean approveFunds;}public class WorkerEntity extends EmployeeEntity { protected Integer yearsExperience;}
![Page 32: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/32.jpg)
RDBMS1. Union table with (many) NULL
values
![Page 33: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/33.jpg)
RDBMS2. Concrete instances without common
queries
![Page 34: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/34.jpg)
RDBMS3. Base table JOINed with concrete
instances
![Page 35: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/35.jpg)
@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;}
![Page 36: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/36.jpg)
{ "_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}
![Page 37: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/37.jpg)
![Page 38: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/38.jpg)
Key-Value Storeand more
REmote DIctionary Server
![Page 39: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/39.jpg)
Statistics (Login)Bitset
HyperLogLog
![Page 40: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/40.jpg)
BitsetFirst user bit 1, second user bit 2,...
A million users ~123KB
![Page 41: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/41.jpg)
HyperLogLogUnique elements in 12KB regardless of
their numberError rate ~0,81%
http://redis.io/commands/pfcount
![Page 42: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/42.jpg)
ComparisonHyperLogLog: constant sizeBitset: exact & aggregates
![Page 43: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/43.jpg)
![Page 44: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/44.jpg)
Scalable & highly available
Consistent Hashing
![Page 45: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/45.jpg)
![Page 46: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/46.jpg)
![Page 47: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/47.jpg)
![Page 48: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/48.jpg)
![Page 49: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/49.jpg)
![Page 50: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/50.jpg)
Eventually consistent was too hard, so we went with
immediately inaccurate.— https://twitter.com/mysqlborat/status/621785755107524608
![Page 51: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/51.jpg)
![Page 52: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/52.jpg)
![Page 53: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/53.jpg)
SQL Databasesnot only RDBMS
![Page 54: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/54.jpg)
Cassandra Query Language (CQL)Google Query Language (GQL)
Couchbase N1QLRethinkDB Query Language (ReQL)
![Page 55: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/55.jpg)
RDBMS features & maturity+
NoSQL influence
![Page 56: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/56.jpg)
![Page 57: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/57.jpg)
Full-Text Search
![Page 58: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/58.jpg)
![Page 59: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/59.jpg)
![Page 60: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/60.jpg)
Document ScoreTerm Frequency (TF) / Inverse
Document Frequency (IDF)Field-length norm
https://www.elastic.co/guide/en/elasticsearch/guide/current/scoring-theory.html
![Page 61: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/61.jpg)
![Page 62: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/62.jpg)
Conclusion
![Page 63: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/63.jpg)
![Page 64: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/64.jpg)
But is it fast?
![Page 65: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/65.jpg)
![Page 66: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/66.jpg)
![Page 67: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/67.jpg)
Thanks!Questions? Swag
@xeraa
![Page 68: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/68.jpg)
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/
![Page 69: "Databases - The Choice is Yours", Philipp Krenn, Developer Advocate at Elastic](https://reader031.fdocuments.in/reader031/viewer/2022022414/58713ad51a28abf0568b6c3d/html5/thumbnails/69.jpg)
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