1 of 16

A Whistlestop Tour

Of Databases

Jonny Arnold -- @JonnyArnold89

2 of 16

What is a database?

3 of 16

A database is...

A set of data structures optimised for getting and setting data

with

A piece of software that understands how to get and set data.

4 of 16

Let’s build our own!

5 of 16

[write.program]

print(“Speaker Name:”)�speaker_name = read()��print(“Talk Title:”)�talk_title = read()

writeFile(

“Names.txt”,

“#{speaker_name},#{talk_title}”

)

6 of 16

[names.txt]

Danielle,All You Need Are Squares and Circles

Kadi,Once you React You Can't Go Back

Georgia,Breaking through the beginner bottleneck

Jonny,A Whistlestop Tour of Databases

Tatiana,Keeping a clean commit history

7 of 16

[read.program]

fileText = openFile(“names.txt”)

names_and_talks = fileText

.split(“\n”)

.split(“,”)

for(name, talk in names_and_talks) {

print(“#{name}: #{talk}”)

}

8 of 16

A database is...

A set of data structures optimised for getting and setting data

with

A piece of software that understands how to get and set data.

9 of 16

It’s a bit more complicated than that.

10 of 16

Databases use different data structures�when storing and retrieving data:

Relational (MySQL, PostgreSQL)

Document Store (MongoDB, CouchDB)

Graph (Neo4J)

Key-Value (Riak, Memcache)

Tuple (Apache River/Jini)

11 of 16

Relational Databases

Good for storing things that are related to other things, and have the same structure.

Currently the most popular type of database.

12 of 16

Relational Database Concepts

Tables of data (like Excel Spreadsheets)

Joins

SQL

13 of 16

SELECT

speakers.name,

talks.title

FROM

talks

JOIN speakers

ON talks.speaker_id = speakers.id

WHERE

talk.date_presented = DATENOW()

14 of 16

Databases use different data structures�when storing and retrieving data:

Relational (MySQL, PostgreSQL)

Document Store (MongoDB, CouchDB)

Graph (Neo4J)

Key-Value (Riak, Memcache)

Tuple (Apache River/Jini)

15 of 16

Databases store data for �fast storage and retrieval.

Databases use different data structures�when storing and retrieving data.�

16 of 16

A Whistlestop Tour

Of Databases

Jonny Arnold -- @JonnyArnold89

Thanks!