stud/misc/2019-11-08-NoSQL/README.md

201 lines
1.8 KiB
Markdown
Raw Normal View History

2019-10-31 19:58:52 +02:00
Welcome
-------
2019-11-08 14:08:28 +02:00
NoSQL for cartographers.
Motiejus Jakštys
2019-11-08
2019-10-31 19:58:52 +02:00
Why me?
-------
- 2008: first paid software job.
2019-11-08 14:08:28 +02:00
- 2009-2012: graduated Computing Science in Glasgow.
- 2014-2016: job: Amazon Web Services.
- 2016-now: job: Uber.
SQL and NoSQL are part of the job.
2019-10-31 19:58:52 +02:00
What is a server?
-----------------
2019-11-08 14:08:28 +02:00
Demonstration.
- pi
- pi-at-home.jpg
2019-10-31 19:58:52 +02:00
SQL
---
- Invented > 50 years ago.
2019-11-08 14:08:28 +02:00
- Technologies change, concepts remain.
2019-10-31 19:58:52 +02:00
Power and limitation of SQL
---------------------------
Let's model a house on a piece of land.
- There will be always a piece of land under a house.
- SQL says you can enforce this.
**They must be on the same server to enforce this constraint.**
2019-11-08 14:08:28 +02:00
What do we do?
2019-10-31 19:58:52 +02:00
Get a big database
------------------
2019-11-08 14:08:28 +02:00
$30 to about a $1M.
2019-10-31 19:58:52 +02:00
Alternatives
============
2019-11-08 14:08:28 +02:00
Split data across many servers!
Topology is not always needed:
- Pictures/videos.
- Stock prices.
- Sensor measurements.
Hey, No SQL!
2019-10-31 19:58:52 +02:00
2019-11-08 14:08:28 +02:00
Sort-of-SQL
-----------
2019-10-31 19:58:52 +02:00
2019-11-08 14:08:28 +02:00
Leave the syntax, cut out constraints.
- familiar syntax.
- more storage.
- less features.
2019-10-31 19:58:52 +02:00
Hive:
```
SELECT a.foo FROM invites a WHERE a.ds='2008-08-15';
```
2019-11-08 14:08:28 +02:00
2019-10-31 19:58:52 +02:00
Key-Value: fast & small
-----------------------
2019-11-08 14:08:28 +02:00
- Different syntax
- Different features
2019-10-31 19:58:52 +02:00
DynamoDB:
```
table = dynamodb.create_table(
TableName='users',
KeySchema=[
{ 'AttributeName': 'username', 'KeyType': 'HASH' },
{ 'AttributeName': 'last_name', 'KeyType': 'RANGE' }
],
)
```
2019-11-08 14:08:28 +02:00
Key-Value: slow & very big
2019-10-31 19:58:52 +02:00
---------------------
2019-11-08 14:08:28 +02:00
Videos or just large files? S3 is most popular.
Imaginge an infinite disk.
Cloud
-----
"The Cloud" is just someone's servers with software.
- pi-datacenter.jpg
- datacenter.jpg
- snowball-edge.jpg
Storage
-------
Storage in "the cloud" is quite cheap. People start moving.
2019-10-31 19:58:52 +02:00
https://www.youtube.com/watch?v=8vQmTZTq7nw