elephant: easy persistence no orms at all very easy to use apis: btree, persistent sets, and clos...

8
Elephant: Easy Persistence • No ORMs at all • Very easy to use APIs: btree, persistent sets, and CLOS integration • Dynamic index creation on slots • Functional indexes

Upload: reynard-bishop

Post on 13-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Elephant: Easy Persistence No ORMs at all Very easy to use APIs: btree, persistent sets, and CLOS integration Dynamic index creation on slots Functional

Elephant: Easy Persistence

• No ORMs at all

• Very easy to use APIs: btree, persistent

sets, and CLOS integration

• Dynamic index creation on slots

• Functional indexes

Page 2: Elephant: Easy Persistence No ORMs at all Very easy to use APIs: btree, persistent sets, and CLOS integration Dynamic index creation on slots Functional

(defpclass friend ()

((name :accessor name :initarg :name)

(birthday :initarg :birthday))

(:index t))

=> #<PERSISTENT-METACLASS FRIEND>

(make-instance 'friend :name "Carlos" :birthday (encode-birthday '(1 1 1972)))

(make-instance 'friend :name "Adriana" :birthday (encode-birthday '(24 4 1980)))

(make-instance 'friend :name "Zaid" :birthday (encode-birthday '(14 8 1976)))

NOW SOMEONE TRIPS OVER THE POWER CORD...

Restart your LISP and do:

(get-instances-by-class 'friends)

=> (#<Carlos> #<Adriana> #<Zaid>)

(mapclass #'(format t " name: ~A birthdate: ~A~%" (name friend) (birthday friend)) 'friend)

name: Carlos birthdate: (1 1 1972)

name: Adriana birthdate: (24 4 1980)

name: Zaid birthdate: (14 8 1976)

=> (#<Carlos> #<Adriana> #<Zaid>)

Persistent Classes

Page 3: Elephant: Easy Persistence No ORMs at all Very easy to use APIs: btree, persistent sets, and CLOS integration Dynamic index creation on slots Functional

PSETClass

Indexing

Persistent

SlotsBTree

Serializer Memutils/UFFI

MOP

User API

Data Store Interface and Utilities

db-bdb db-postmodern db-clsql db-lisp

BerkeleyDB PostgreSQL SQLite

DCM

User API

Internal

Ready to integrate

TBD

3rd party

Page 4: Elephant: Easy Persistence No ORMs at all Very easy to use APIs: btree, persistent sets, and CLOS integration Dynamic index creation on slots Functional

Multi-platfom

• Supported by LISP: SBCL, ACL,

LispWorks, OpenMCL

• Different Oses: Linux, Mac, Windows

• Works on 64 bit architectures

• Repository flexibility

Page 5: Elephant: Easy Persistence No ORMs at all Very easy to use APIs: btree, persistent sets, and CLOS integration Dynamic index creation on slots Functional

Late binding of repository

decisions• Multiple Repositories (3 tested, but more

should be possible via CL-SQL)

• Tested migration between repositories

• Repository usage and migration flexible

enough that engineering decisions about

repos are independent of Elephant

Page 6: Elephant: Easy Persistence No ORMs at all Very easy to use APIs: btree, persistent sets, and CLOS integration Dynamic index creation on slots Functional

Repositories

• BDB: fast, not free for a website unless

open-source

• Postgres: slower, liberal license, very

solid and well-supported

• SQLite3: fast, good for protyping

• Start on X, move to Y

Page 7: Elephant: Easy Persistence No ORMs at all Very easy to use APIs: btree, persistent sets, and CLOS integration Dynamic index creation on slots Functional

Indexing decisions changeable

• Don't optimize prematurely...index a slot

when you need to

• Functional indexes provide lots of power

Page 8: Elephant: Easy Persistence No ORMs at all Very easy to use APIs: btree, persistent sets, and CLOS integration Dynamic index creation on slots Functional

The Future

• Schema changes (changing a persistent classes slots)

should be improved

• Pure-lisp solution would allow prototyping (and maybe

more) with even less installation hassle

• Improving the serializer improves performance on

every repository

• Better postgres usage with postmodern

• Query languages, Prevalence, .....