This comprehensive exploration focuses on optimizing developer productivity in distributed computing. We address core challenges such as data prefetching, optimization, and debugging within distributed systems. By introducing concepts like global coordination, caching, and replication, we highlight the significance of ensuring correctness across network orders. Various design principles, including ACID properties and disorderly programming, are examined. The discussion emphasizes the need for more effective abstractions and the potential of declarative programming to enhance system performance and reliability.
01 / 71Enhancing Developer Productivity in Distributed Computing Through Advanced Programming Techniques
1 / 17
Télécharger la présentation
Enhancing Developer Productivity in Distributed Computing Through Advanced Programming Techniques
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Data prefetching Register allocation Loop unrolling Function inlining Optimization Global coordination, waiting Caching, indexing Replication, data locality Partitioning, load balancing
Undeclared variables Type mismatches Sign conversion mistakes Warnings Replica divergence Inconsistent state Deadlocks Race conditions
Stack traces gdb Log files, printf Debugging Full stack visualization, analytics Consistent global snapshots Provenance analysis
Distributed Computing • Unpredictable latency • Partial failures • No global event order
Alternative #1: Enforce global event order at all nodes (“Strong Consistency”)
Alternative #1: • Enforce global event order at all nodes • (“Strong Consistency”) • Problems: • Availability (CAP) • Latency
Alternative #2: Ensure correct behaviorfor anynetwork order(“Weak Consistency”)
Alternative #2: Ensure correct behaviorfor anynetwork order(“Weak Consistency”) Problem: With traditional languages, this is very difficult.
The “ACID 2.0” Pattern Associativity: X ○ (Y ○ Z) = (X ○ Y) ○ Z “batch tolerance” Commutativity: X ○ Y = Y ○ X “reordering tolerance” Idempotence: X ○ X = X “retry tolerance”
Bounded Join Semilattices A triple hS,t,?isuch that: • S is a set • t is a binary operator (“least upper bound”) • Induces a partial order on S: x·Sy if xty = y • Associative, Commutative, and Idempotent • 8x2S: ?t x= x
Bounded Join Semilattices Lattices are objects that grow over time. An interfacewith anACID 2.0 merge() method • Associative • Commutative • Idempotent
Questions • Will cart replicas eventually converge? • “Eventual Consistency” • What will client observe on checkout? • Goal: checkout reflects all session activity • To achieve #1 and #2, how much ordering is required?
Design #1: Mutable State Add(item x, count c): if kvs[x] exists: old = kvs[x] kvs.delete(x) if old > c kvs[x] = old – c Remove(item x, count c): if kvs[x] exists: old = kvs[x] kvs.delete(x) else old = 0 kvs[x] = old + c Non-monotonic!
Non-monotonic! Conclusion: Every operation might require coordination!
Design #2: “Disorderly” Add(item x, count c): Remove(item x, count c): Add x,c to del_log Checkout(): Add x,c to add_log Group add_log byitem ID; sum counts. Group del_log byitem ID; sum counts. For each item, subtract deletes from adds. Non-monotonic!
Monotonic Conclusion: Replication is safe; might need tocoordinate on checkout
Takeaways • Avoid: mutable state updatePrefer: immutable data, monotone growth • Major difference in coordination cost! • Coordinate once per operation vs.Coordinate once per checkout • We’d like a type system for monotonicity
Disorderly Programming • Order-independent: default • Order dependencies: explicit • Order as part of the design process • Tool support • Where is order needed? Why?
The Disorderly Spectrum ASM Java Haskell Bloom C Lisp, ML SQL,LINQ,Datalog High-level “Declarative” Powerful optimizers
Processes that communicate viaasynchronousmessagepassing Bloom ≈ declarative agents Each process has a local database Logical rulesdescribecomputationandcommunication(“SQL++”)
If RHS is true (SELECT …) ThenLHS is true (INTO lhs) left-hand-side <= right-hand-side Whenand whereis the LHS true?
Temporal Operators • Same location,same timestamp • Same location,next timestamp • Different location,non-deterministic timestamp <= Computation <+<- PersistenceDeletion <~ Communication