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

240 lines
2.3 KiB
Markdown
Raw Permalink 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?
-------
2019-11-08 14:26:09 +02:00
- 2008: first full-time 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
2019-11-08 14:26:09 +02:00
What next?
----------
- Create an account in S3.
- Upload a file there.
- Share it with everyone under your domain.
- It's free!
Want to know more?
------------------
- Stanford Computer Science 101: https://online.stanford.edu/courses/soe-ycscs101-sp-computer-science-101
- Python programming introduction for everyone: https://tutorial.djangogirls.org/en/
- Cloud services: https://aws.amazon.com/