pharodays 2015: connecting to databases by norbert hartl

16
Connecting to Databases Norbert Hartl 2denker

Upload: pharo

Post on 18-Jul-2015

233 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Connecting to Databases

Norbert Hartl 2denker

Page 2: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Not so fast!

Page 3: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Mostly Immense Schema Migrations And Terrible Coding Habits

Page 4: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Good Object Oriented Design and Fine Iterative Techniques

Page 5: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Why a database? Everything that can store data is a database

Page 6: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Why a database? Everything that can store data is a database

persist

Page 7: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Why a database? Everything that can store data is a database

persist

share

Page 8: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Why a database? Everything that can store data is a database

persist

share

data does not fit in memory

Page 9: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Why a database? Everything that can store data is a database

persist

share

data does not fit in memory

concurrent access

Page 10: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Pharo database if you just need it persisted

Smalltalk image snapshot: true andQuit: false

Page 11: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Persist outside of image

image might break

move data between images

share data

Page 12: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Fuel if you want to store data outside the image

FLSerializer serialize: myModel toFileNamed: ‚model.fl‘

persists whole graph

is quite fast

Page 13: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

PUnQlite if there is more data than memory

just a library, no server

is a key-value store

supports transactions

(PqDatabase open: ‚model.db‘) at: ‚foo‘ put: ‚bar‘; close

Page 14: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Voyage/MongoSerializes objects to JSON

can be tuned using magritte descriptions

(VOMongoRepository database: 'foo') enableSingleton

MyClass new property: ‚value’; save.

MyClass selectMany: [ :each | each property = ‚value‘ ]

Page 15: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

Plenty of options

Phriak

Voyage2 with new backends (Riak, anyone? )

SQLite, SandstoneDB, ….

Page 16: PharoDAYS 2015: Connecting to Databases by Norbert Hartl

RDBMS

Guille?