CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like...

41
CouchDB Apache

Transcript of CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like...

Page 1: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

CouchDBApache

Page 2: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Jan Lehnardt

CouchDB Developer

http://twitter.com/janl

[email protected]

Director at couch.io

Page 3: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

CouchDB forErlang Developers

Page 4: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

CouchDB forErlang Developers

Ha-ha!

Page 5: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Relax

Page 6: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Features• Relax

• Schema Free (JSON)

• N-Master Replication

• Web-scale (not Facebook-scale)

• Erlang!

Page 7: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Multi Language through !""#

curl, Python, PHP, Java, Perl, Ruby, Lisp (Emacs!), Ruby, C, Obj-C, Scala

Page 8: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Why Bother?• Open Source is good for your résumé

• Public code > interview code

• (Hidden) project management

• Meet great, smart people

Page 9: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Why Bother?• Get the Erlang out there

• Like ejabberd, CouchDB raises Erlang awareness

• Growing the Erlang community should be on your agenda

Page 10: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Why Bother?

Page 11: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Why Bother?

Page 12: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Industry Interestand many more…

Page 13: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

What For?• Distributed logging & archiving

• Message persistence with RabbitMQ

• Aggregation

• Web-endpoints for Erlang systems

• non-tiny Mnesia

Page 14: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

$%&"ful !""# '#(• Create

HTTP PUT /db/mydocid

• ReadHTTP GET /db/mydocid

• UpdateHTTP PUT /db/mydocid

• DeleteHTTP DELETE /db/mydocid

CRUD

Page 15: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Formats

• { "name": "Joe", "job": "hacker", "grades: [3, 5, 8]}

• {[ {<<"name">>, <<"joe">>} {<<"job">>, <<"hacker">>}, {<<"grades">>, [3 ,5 8]}]}

Page 16: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Erlang Libraries• erlang_couchdb

• Used in production

• Well tested

• Used as an example in a book

Page 17: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

• erlang_couchdb:create_database( {"localhost", 5984}, "factory").

• erlang_couchdb:database_info( {"localhost", 5984}, "factory").

• erlang_couchdb:server_info( {"localhost", 5984}).

Page 18: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

• erlang_couchdb:create_document( {"localhost", 5984}, "factory", [{<<"name">>, <<"joe">>}, {<<"job">>}, <<"hacker">>}]).

Page 19: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

• erlang_couchdb:retrieve_document( {"localhost", 5984}, "factory", DocId).

Page 20: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

• erlang_couchdb:update_document( {"localhost", 5984}, "factory", DocId, [{<<"_rev">>, RevId}, {<<"name">>, <<"joe">>}, {<<"job">>, <<"hacker">>}, {<<"grades">>},[3, 5 8]}]).

Page 21: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

• erlang_couchdb:delete_document( {"localhost", 5984}, "factory", DocId, RevId).

Page 22: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

• erlang_couchdb:create_view( {"localhost", 5984}, "factory", "people", <<"javascript">>, [{<<"hackers">>, <<" function(doc) { if (doc.job == 'hacker') { emit(doc.name, null); }} ">>}]).

Page 23: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

• erlang_couchdb:invoke_view( {"localhost", 5984}, "factory", "people", "hackers", [{"key", "\"joe""}]).

Page 24: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

• erl-couch & ecouch

• both used in production, both actively maintained

• similar APIs

See Also

Page 26: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Hovercraft• Everybody loves hovercrafts

• Fast, bypasses HTTP & JSON

• Premature optimization

• Does not scale

• Use with care

Page 27: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda
Page 28: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Hovercraft• Everybody loves hovercrafts

• Fast, bypasses HTTP & JSON

• Premature optimization

• Does not scale

• Use with care

Page 29: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

We Need You!

Page 30: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

eep0018

Page 31: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

erlview

Page 32: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

OTPi)cation

Page 33: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

couchdb-loungerl

Page 34: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Windows

Page 35: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda
Page 36: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda
Page 37: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Compaction blows the )lesystem cache

Page 38: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Politics• Apache CouchDB

• Apache Software Foundation

• Meritocracy

• Project Stability

• CLAs for legal protection

• Patent shield

Page 39: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Fun

Page 40: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda

Relax*ank You!

Page 41: CouchDB Apache - erlang- · PDF fileWhy Bother? • Get the Erlang out there • Like ejabberd, CouchDB raises Erlang awareness • Growing the Erlang community should be on your agenda