The model provides a structure and language consistent with first-order predicate logic
All data is represented in terms of tuples, grouped into relations
https://docs.oracle.com/cd/B14099_19/bi.1012/b13915/i_rel_chapter.htm
Product: (Product Code, Product Description)
The “primary keys” are in bold and “foreign keys” in italic
https://en.wikipedia.org/wiki/Relational_model
City,Edition,Sport,Discipline,Athlete,NOC,Gender,Event,Event_gender,MedalAthens,1896,Aquatics,Swimming,"HAJOS, Alfred",HUN,Men,100m freestyle,M,GoldAthens,1896,Aquatics,Swimming,"HERSCHMANN, Otto",AUT,Men,100m freestyle,M,SilverAthens,1896,Aquatics,Swimming,"DRIVAS, Dimitrios",GRE,Men,100m freestyle for sailors,M,BronzeAthens,1896,Aquatics,Swimming,"MALOKINIS, Ioannis",GRE,Men,100m freestyle for sailors,M,Gold
Athletes
id,name,gender,nationality1,"ÖRSTED, Hans-Henrik",M,DEN2,"ÖRTEGREN, Ruben",M,SWE3,"ÖRVIG, Erik",M,NOR
Countries
id,countryAFG,AfghanistanALB,AlbaniaALG,Algeria
Events
id,name,sport,discipline1,- 47.63kg (flyweight),Boxing,Boxing2,- 47.6kg (light-flyweight),Wrestling,Wrestling Free.3,- 48 kg,Judo,Judo
Editions
id,year,city1,1896,Athens2,1900,Paris3,1904,St Louis
The relational algebra might suggest these steps to retrieve the phone numbers and names of book stores that supply Some Sample Book:
The relational calculus would formulate a descriptive, declarative way:
Three parts to a Query (only first two are required)
OrderID | CustomerID | OrderDate |
---|---|---|
10308 | 2 | 1996-09-18 |
10309 | 37 | 1996-09-19 |
10310 | 77 | 1996-09-20 |
CustomerID | CustomerName | ContactName | Country |
---|---|---|---|
1 | Alfreds Futterkiste | Maria Anders | Germany |
2 | Ana Trujillo Emparedados y helados | Ana Trujillo | Mexico |
3 | Antonio Moreno Taquería | Antonio Moreno | Mexico |
SELECT Orders.OrderID, Customers. CustomerName, Orders.OrderDateFROM OrdersINNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID;
OrderID | CustomerName | OrderDate |
---|---|---|
10308 | Ana Trujillo Emparedados y helados | 9/18/1996 |
(https://www.w3schools.com/sql/sql_ref_join.asp)
These properties are expensive to satisfy – especially in a distributed system with high update rate.
Scale to clusters of machines
Examples
https://dzone.com/articles/time-series-database-vs-common-database-technologi
https://www.influxdata.com/time-series-database/ https://en.wikipedia.org/wiki/Time_series_database
InfluxDB has a line protocol for sending time series data
<measurement name>,<tag set> <field set> <timestamp>
For example CPU metrics
cpu,host=serverA,region=uswest idle=23,user=42,system=12 1549063516
https://play.grafana.org/d/000000012/grafana-play-home?from=1581975730832&to=1581976882123
Device shadows – For low frequency events such as configuration or status
At the implementation level, a shadow service uses a JSON document to hold data and metadata associated with each device
Uses MQTT topics to facilitate communication between applications and devices
{ "state": { "desired": { "color": "RED", "state": "STOP" }, "reported": { "color": "GREEN", "engine": "ON" }, "delta": { "color": "RED", "state": "STOP" } }, "metadata": { "desired": { "color": { "timestamp": 12345 }, "state": { "timestamp": 12345 }, "reported": { "color": { "timestamp": 12345 }, "engine": { "timestamp": 12345 } }, "delta": { "color": { "timestamp": 12345 }, "state": { "timestamp": 12345 } } }, "version": 17, "timestamp": 123456789 }}
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |