Building Applications with Distributed Erlang

Building Applications with Distributed Erlang

NDC London, 2014

3e09fee7b359be847ed5fa48f524a3d3?s=128

Christopher Meiklejohn

December 04, 2014
Tweet

Transcript

  1. 8.

    what is THE AGENDA (novice) 1. what is distributed erlang?

    (erlanger) 2. where do i go from here?
  2. 13.

    what are the goals of a DISTRIBUTED SYSTEM “A distributed

    system is a software system in which components located on networked computers communicate and coordinate their actions by passing messages. The components interact with each other in order to achieve a common goal. Three significant characteristics of distributed systems are: concurrency of components, lack of a global clock, and independent failure of components.” Wikipedia, “Distributed Computing”
  3. 16.

    what are some examples of a DISTRIBUTED SYSTEM distributed databases,

    riak, cassandra, etc. master/slave in sql, multi-partition txns
  4. 17.

    what are some examples of a DISTRIBUTED SYSTEM distributed databases,

    riak, cassandra, etc. master/slave in sql, multi-partition txns web services via rest, soap, etc.
  5. 18.

    what are some examples of a DISTRIBUTED SYSTEM distributed databases,

    riak, cassandra, etc. master/slave in sql, multi-partition txns web services via rest, soap, etc. mobile clients, internet of things
  6. 20.

    why are distributed systems HARD the network is reliable L.

    Peter Deutsch, “Fallacies of Distributed Computing”
  7. 21.

    why are distributed systems HARD the network is reliable latency

    is zero L. Peter Deutsch, “Fallacies of Distributed Computing”
  8. 22.

    why are distributed systems HARD the network is reliable latency

    is zero bandwidth is infinite L. Peter Deutsch, “Fallacies of Distributed Computing”
  9. 23.

    why are distributed systems HARD the network is reliable latency

    is zero bandwidth is infinite the network is secure L. Peter Deutsch, “Fallacies of Distributed Computing”
  10. 24.

    why are distributed systems HARD the network is reliable latency

    is zero bandwidth is infinite the network is secure topology doesn’t change L. Peter Deutsch, “Fallacies of Distributed Computing”
  11. 25.

    why are distributed systems HARD the network is reliable latency

    is zero bandwidth is infinite the network is secure topology doesn’t change there is one administrator L. Peter Deutsch, “Fallacies of Distributed Computing”
  12. 26.

    why are distributed systems HARD the network is reliable latency

    is zero bandwidth is infinite the network is secure topology doesn’t change there is one administrator transport cost is zero L. Peter Deutsch, “Fallacies of Distributed Computing”
  13. 27.

    why are distributed systems HARD the network is reliable latency

    is zero bandwidth is infinite the network is secure topology doesn’t change there is one administrator transport cost is zero the network is homogeneous L. Peter Deutsch, “Fallacies of Distributed Computing”
  14. 30.

    what is DISTRIBUTED ERLANG 1 3 2 4 5 transparent

    • message passing • links • monitors transitive connections (except hidden nodes) access control via cookies
  15. 31.

    what is DISTRIBUTED ERLANG 1 3 2 4 5 transparent

    • message passing • links • monitors transitive connections (except hidden nodes) access control via cookies 6
  16. 32.

    what is DISTRIBUTED ERLANG 1 3 2 4 5 transparent

    • message passing • links • monitors transitive connections (except hidden nodes) access control via cookies 6
  17. 33.

    what is DISTRIBUTED ERLANG 1 3 2 4 5 transparent

    • message passing • links • monitors transitive connections (except hidden nodes) access control via cookies 6
  18. 37.

    what is DISTRIBUTED ERLANG 1 spawn functions on other nodes

    2 p1 p2 monitor or link on other nodes
  19. 38.

    what is DISTRIBUTED ERLANG 1 spawn functions on other nodes

    2 p1 p2 monitor or link on other nodes 1 2 p1 p2
  20. 39.

    what is DISTRIBUTED ERLANG 1 spawn functions on other nodes

    2 p1 p2 monitor or link on other nodes 1 2 p1
  21. 44.

    what libraries come with DISTRIBUTED ERLANG global - global name

    registration and locking pg2 - process group registry
  22. 45.

    what libraries come with DISTRIBUTED ERLANG global - global name

    registration and locking pg2 - process group registry mnesia - distributed transactions
  23. 46.

    what libraries come with DISTRIBUTED ERLANG global - global name

    registration and locking pg2 - process group registry mnesia - distributed transactions net_kernel - erlang distributed networking kernel
  24. 47.

    what libraries come with DISTRIBUTED ERLANG global - global name

    registration and locking pg2 - process group registry mnesia - distributed transactions net_kernel - erlang distributed networking kernel rpc - remote procedure call services
  25. 51.

    what is GLOBAL global name registration and locking service shared

    state, replicated locally races under network partitions
  26. 52.

    what is GLOBAL global name registration and locking service shared

    state, replicated locally races under network partitions provides ad-hoc resolution hook
  27. 56.

    what is PG2 distributed process group registry usually used for

    work partitioning races under network partitions
  28. 57.

    what is PG2 distributed process group registry usually used for

    work partitioning races under network partitions can lose values under network partitions
  29. 58.

    what is PG2 distributed process group registry usually used for

    work partitioning races under network partitions can lose values under network partitions originally isis inspired, pg descendent
  30. 63.

    transactional database in erlang implemented using replicated ets tables global

    transactions are *expensive* network partitions can cause values to be lost what is MNESIA
  31. 67.

    maintenance of network in distributed erlang responsible for detecting failures

    dropped tcp connections, network partitions what is NET_KERNEL
  32. 68.

    maintenance of network in distributed erlang responsible for detecting failures

    dropped tcp connections, network partitions poor mechanism for cluster management what is NET_KERNEL
  33. 73.

    remote procedure call services serialized execution of requests call to

    a single node, or multi call synchronous programming pattern what is RPC
  34. 78.

    what are the ANTI-PATTERNS* utilizing shared state reliance on physical

    time using predesignated masters treating the network as synchronous
  35. 79.

    what are the ANTI-PATTERNS* utilizing shared state reliance on physical

    time using predesignated masters treating the network as synchronous * also: distributed objects, guaranteed delivery mechanisms, distributed serializable transactions, etc.
  36. 85.

    what about CLUSTER MEMBERSHIP fixed membership, a priori don’t tie

    to net_kernel, net_ticktime store information locally, gossip 1 3 2 4
  37. 86.

    what about CLUSTER MEMBERSHIP fixed membership, a priori don’t tie

    to net_kernel, net_ticktime store information locally, gossip hyparview, plumtree, thicket 1 3 2 4
  38. 90.

    what about FAILURE DETECTION detection of delays vs. failed nodes

    net_kernel, net_ticktime the φ accrual failure detector 1 3 2 4
  39. 91.

    what about FAILURE DETECTION detection of delays vs. failed nodes

    net_kernel, net_ticktime the φ accrual failure detector swim: membership and failure detector 1 3 2 4
  40. 97.

    what about VALUE DIVERGENCE replicated data can diverge lamport clock,

    vector clocks, version vectors, wall clock identify concurrency 1 3 2 1 ?
  41. 98.

    what about VALUE DIVERGENCE replicated data can diverge lamport clock,

    vector clocks, version vectors, wall clock identify concurrency how to resolve? lww vs. siblings vs. crdt 1 3 2 1 ?
  42. 102.

    what about DISTRIBUTION BUFFERS 1 2 p1 p3 p2 large

    objects can cause head-of-line blocking
  43. 103.

    what about DISTRIBUTION BUFFERS 1 2 p1 p3 p2 large

    objects can cause head-of-line blocking move objects to tcp sockets
  44. 104.

    what about DISTRIBUTION BUFFERS 1 2 p1 p3 p2 large

    objects can cause head-of-line blocking move objects to tcp sockets increase distribution port buffer size
  45. 105.

    what about DISTRIBUTION BUFFERS 1 2 p1 p3 p2 large

    objects can cause head-of-line blocking move objects to tcp sockets increase distribution port buffer size beware unbounded queues
  46. 110.

    what about LEADER ELECTION gen_leader assumes fixed topology use paxos

    or raft gen_leader known to deadlock 1 2 3 4
  47. 114.
  48. 115.

    what about MESSAGE FORMATS mixed version clusters reality in large

    systems keep formats compatible upgrade to new format v1 v2
  49. 123.

    distributed erlang gets you part of the way but, you

    still have to understand the problems and the tradeoffs what are the LESSONS
  50. 124.

    distributed erlang gets you part of the way but, you

    still have to understand the problems and the tradeoffs what are the LESSONS http://christophermeiklejohn.com/distributed/systems/ 2013/07/12/readings-in-distributed-systems.html
  51. 127.

    what are some useful ERLANG LIBRARIES riak_core: distributed systems toolkit

    https://github.com/basho/riak_core riak_ensemble: generic multi-paxos framework https://github.com/basho/riak_ensemble
  52. 128.

    what are some useful ERLANG LIBRARIES riak_core: distributed systems toolkit

    https://github.com/basho/riak_core riak_ensemble: generic multi-paxos framework https://github.com/basho/riak_ensemble riak_dt: conflict-free replicated data types https://github.com/basho/riak_dt
  53. 129.

    what are some useful ERLANG LIBRARIES riak_core: distributed systems toolkit

    https://github.com/basho/riak_core riak_ensemble: generic multi-paxos framework https://github.com/basho/riak_ensemble riak_dt: conflict-free replicated data types https://github.com/basho/riak_dt riak_test: riak_core testing framework https://github.com/basho/riak_test
  54. 132.

    what are some useful RESEARCH PROJECTS syncfree: large-scale computation on

    erlang https://github.com/syncfree release: large-scale erlang deployments https://github.com/release-project/
  55. 133.

    what are some useful RESEARCH PROJECTS syncfree: large-scale computation on

    erlang https://github.com/syncfree release: large-scale erlang deployments https://github.com/release-project/ paraphrase: parallel computation https://github.com/paraphrase