Difference between revisions of "VT2016 DDP"

From air
Jump to navigation Jump to search
Line 21: Line 21:
   
 
==DDP==
 
==DDP==
 
   
 
===What is DDP?===
 
===What is DDP?===
  +
DDP is the heart of MeteorJS and it’s the protocol Meteor uses to communicate between the client and the server. DDP is an acronym for Distributed Data Protocol. Meteor has implemented both client and server implementations for DDP.
What does DDP do?
 
   
===What is DDP?===
+
===What does DDP do?===
  +
DDP mainly does two things:
  +
*It handles Remote Procedure Calls (RPC).
  +
*It manages data.
  +
  +
===Handling Remote Procedure Calls===
  +
With RPC, you can invoke a method on the server and get something back in return. Besides that, DDP has a nice feature: it notifies the caller after all the write operations in the method have been reflected to all the other connected clients.
  +
*The DDP client (arunoda) invokes the method transferMoney with three parameters: 1000USD, arunoda and sacha.
  +
*Then after the transfer has been accepted, the DDP server (bank) sends a message with an updated balance to arunoda’s account. The balance is in the result field. If there was an error, there will be an error field instead of the result.
  +
*Some time later, the DDP server sends another message called updated with the method id, notifying me that my transfer has been sent to sacha successfully and he has accepted it. Sometime, updated message comes before the result. (It’s also possible to receive updated message even before the result message)
   
 
=Bibliographie=
 
=Bibliographie=

Revision as of 22:36, 27 November 2016

Presentation

  • Sujet : DDP
  • Auteur : Xueyong QIAN
  • Enseignants : Didier Donsez, Georges-Pierre Bonneau
  • Date : 27/11/2016

Résumé

DDP est un acronyme pour Distributed Data Protocol. C'est le protocole que Meteor(A full-stack JavaScript framework) utilise pour communiquer entre le client et le serveur. Techniquement, DDP peut être implémenté sur tout transport en duplex. L'implementation actuelle de Meteor est sur WebSockets et SockJS. SockJS est un transport d'émulation de WebSockets, qui peut être utilisé lorsque WebSockets n'est pas disponible.

  • Mots-clés : Meteor, DDP, JavaScript, WebSockets


Abstract

DDP is an acronym for Distributed Data Protocol. It’s the protocol Meteor(A full-stack JavaScript framework) uses to communicate between the client and the server. Technically, DDP can be implemented on top of any duplex transport. Meteor’s current implementation is based on WebSockets and SockJS. SockJS is a WebSockets emulation transport, which can be used when WebSockets is not available.

  • Keywords : Meteor, DDP, JavaScript, WebSockets

Synthèse

Meteor

Meteor is a full-stack Javascript Framework

DDP

What is DDP?

DDP is the heart of MeteorJS and it’s the protocol Meteor uses to communicate between the client and the server. DDP is an acronym for Distributed Data Protocol. Meteor has implemented both client and server implementations for DDP.

What does DDP do?

DDP mainly does two things:

  • It handles Remote Procedure Calls (RPC).
  • It manages data.

Handling Remote Procedure Calls

With RPC, you can invoke a method on the server and get something back in return. Besides that, DDP has a nice feature: it notifies the caller after all the write operations in the method have been reflected to all the other connected clients.

  • The DDP client (arunoda) invokes the method transferMoney with three parameters: 1000USD, arunoda and sacha.
  • Then after the transfer has been accepted, the DDP server (bank) sends a message with an updated balance to arunoda’s account. The balance is in the result field. If there was an error, there will be an error field instead of the result.
  • Some time later, the DDP server sends another message called updated with the method id, notifying me that my transfer has been sent to sacha successfully and he has accepted it. Sometime, updated message comes before the result. (It’s also possible to receive updated message even before the result message)

Bibliographie