23
First Indico Workshop Database Technology Pedro Ferreira 27-29 May 2013 CERN

First Indico Workshop

  • Upload
    talen

  • View
    28

  • Download
    0

Embed Size (px)

DESCRIPTION

First Indico Workshop. Database Technology. 27-29 May 2013 CERN. Pedro Ferreira. The Future. Let’s start from the end. A more «social» Indico User-oriented approach Personal home page, user-tailored information More data in less time Need for an adequate DB . - PowerPoint PPT Presentation

Citation preview

Page 1: First  Indico  Workshop

First Indico Workshop

Database TechnologyPedro

Ferreira

27-29 May 2013 CERN

Page 2: First  Indico  Workshop

The FutureLet’s start from the end

A more «social» IndicoUser-oriented approachPersonal home page, user-tailored informationMore data in less time

Need for an adequate DB

Page 3: First  Indico  Workshop

Avoiding disaster

Page 4: First  Indico  Workshop

ZODBWhy not?

It’s object-orientedIt’s been around for a long timeWe know how to use itWe are already using it for some of these things

Page 5: First  Indico  Workshop

ZODBAn object-oriented database

Index Transactions

O1

O2

O1 O4

O2

O3

O4

O3

O1time

Page 6: First  Indico  Workshop

ZODBThe good parts

It’s simpleNo need for ORM or mapping layersTightly integrated with PythonIt is ACID – things work as expected

Page 7: First  Indico  Workshop

ZODBThe bad parts

No server-side queriesNo built-in indexing – application levelData recovery is slow (latency, unpickling, setting object state)No way to fetch more than an object at once (pre-load)

Page 8: First  Indico  Workshop

ZODBYes, there’s more…

Has to be packed regularlyNo caching on the server side (besides OS cache)FileStorage Replication is not Open Source - moneyRelStorage could work, but requires migrationIt’s a niche product

Page 9: First  Indico  Workshop

Don’t Panic!We’re working on it!

Page 10: First  Indico  Workshop

NG DB ProjectThe Next Generation DB for Indicohttp://indico-software.org/wiki/Dev/FutureDB

Aims to find DB infrastructure that can support growth6 month initial phase (tech preview/boilerplate – end 2013)Tech Survey, Evaluation, Prototyping…

Page 11: First  Indico  Workshop

NG DB ProjectThe criteria

Availability (OSS)Scalability/ReplicationEase of use/developmentTransactions/ConsistencyCommunity/MomentumCosts

Page 12: First  Indico  Workshop

The ContestantsThe NoSQL crowd

Key-value storesRiak, Redis, Voldemort

Document-orientedMongoDB, CouchDB

Column-orientedCassandra, Hbase

Neo4J

Page 13: First  Indico  Workshop

Key-ValueJust a mapping structure

user1 Pedro Ferreira

user2 Alberto Resco

user3 {name: {first:“Jose Benito”, last: “Gonzalez”}

Page 14: First  Indico  Workshop

Column-oriented

Page 15: First  Indico  Workshop

Document-orientedCloser to the OO philosophy

user1 Pedro Ferreira

user2

name

Genevacity

Alberto Resconame

Runninghobbies

Cycling

Page 16: First  Indico  Workshop

The ContestantsThe usual (relational) suspects

MySQLMariaDBDrizzlePercona

PostgreSQL

Page 17: First  Indico  Workshop

Relational vs. NoSQLA very coarse comparison

Relational NoSQLACID Yes Not usuallyPhilosophy General-

purposeTable-oriented

Problem-specificNormally closer to OO

Maturity Decades Pretty recentConsistency Normally

strongNormally eventual

Page 18: First  Indico  Workshop

Relational vs. NoSQLThe problems

Relational NoSQLRequires ORMDifferent philosophy

Lack of transactionsEventual consistencyToo simplistic

Page 19: First  Indico  Workshop

Typical query«All events in a user’s favourite categories»RelationalSimple join between two tables

MongoDBEither replicate data or use DB refs (slow!)

Page 20: First  Indico  Workshop

Hybrid ApproachThe best of two worlds?

ZODB - excellent storage for business objectsSELECT style queries…ZODB as primary storage?Already kind of doing that (Redis)Need for transition period

Page 21: First  Indico  Workshop

Hybrid ApproachNo such thing as a free lunch…

Keeping data consistentMultiple DB calls per requestYet another thing to install

Page 22: First  Indico  Workshop

Conclusion

Research projectStill a lot of ground to coverHard to evaluate the hypeHybrid could be a good option

Page 23: First  Indico  Workshop

Pedro Ferreirahttp://github.com/pferreir@pferreir