YA-RPC What is YA-RPC ? | Download | Authors | Licence | Features | FAQ

What is YA-RPC ?

YA-RPC stands for Yet Another Remote Procedure Call, a next generation open source framework for building high performance distributed applications. YA-RPC provides similar features like CORBA or SOAP web services, however it is much simpler to use, deploy and customize, while offering better performance.

The framework is still under development, however stable technical preview version is already available. See the download section.

Authors

The initial prototype for .NET framework was developed by Jan Čurn (see http://www.curn.info). Currently, both .NET framework and Java version are being developed by František Kovařík.

If you have any questions, please write to:

Licence

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

YA-RPC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or look at URL www.gnu.org/licenses/lgpl.html

Download

Using the link below you can download a preview versions of YA-RPC framework for .NET, including the source code and documentation.

yarpc-0.5.zip [stable]
yarpc-0.6.zip [development]

Please note that these versions does not incorporate all the features (e.g. encryption, compression), and the interfaces may change in future releases.

Features

This section briefly describes the features which make YA-RPC middleware so comprehensive.

Simplicity

YA-RPC is very simple to use and may be used even by programmers without any prior knowledge in networking, protocols ...etc. Here is an example of a server and client:

First, let's define the communication interface

public interface IHelloWorld
{
  [YaRpcMethod(123)]
  string GetMessage();
}

...then implement the server stub...

public class HelloWorldStub: YaRpcStub<IHelloWorld>, IHelloWorld
{
  public HelloWorldStub( Guid objGuid )
    : base( objGuid )
  {
  }
  
  public string GetMessage()
  {
    return( "Hello world" );
  }
}

...and start the server.

YaRpcManager.StartListening( IPAddress.Any, 5555, 0, 0 );

HelloWorldStub stub =
    new HelloWorldStub( new Guid("{707DAB59-FD6E-4bea-1535-3241472ECC3D}") );
stub.YaRpcRegister();

After that, a client may use following simple code to access the remote object on the server:

YaRpcConnection conn = YaRpcManager.ConnectTo( "myserver.com", 5555, true );

IHelloWorld proxy = YaRpcProxy<HelloWorld>.GenerateProxy( conn, 
    new Guid("{707DAB59-FD6E-4bea-1535-3241472ECC3D}") );
  
string message = proxy.GetMessage();

Of course, experienced programmers may use lower level of abstraction, enabling them to use advanced features of the framework and customize its very generic behavior. More details may be found in the documentation.

High performance

YA-RPC performs much better than traditional distribution frameworks (like CORBA, web services, XML-RPC, Java RMI...). This fact is achieved thanks to several aspects:

  • Low level protocol - the communication runs directly over TCP protocol.
  • Binary serialization - the data are transmitted in their native form, not in text or XML.
  • Compression - the data stream may optionally be compressed, bringing high throughput for most kinds of communication.
  • Efficient threading model - the .NET version of YA-RPC uses I/O completion ports socket model (on Microsoft Windows), Java version takes advantage of Apache MINA library. These technologies enable YA-RPC to serve tenths of thousands parallel connections, something unimaginable for traditional RPCs. For comparison, typical CORBA implementations use thread-per-object dispatch model, which collapses when large number of objects is used.
  • Smart buffers - for the serialization and send/receive operations YA-RPC uses smart incremental buffers in combination with scather/gather socket API (in C# version only). This concludes that YA-RPC saves a lot of buffer re-allocations and copying.

Bi-directional communication

After clients estabilishes a communcation channel with the server, the remote method calls may be invoked in both client-to-server and server-to-client directions. This feature enables users to implement various callbacks, without the need of creating a hole in the firewall on the client side. One could consider this is a self-evident feature, but the reality is different - systems like .NET remoting, Web-services, Java RMI do not allow this...

Asynchronous remote calls

In YA-RPC middleware, the remote method calls may be issued asynchronously - i.e. without blocking the current thread. Similarly, the remotable object on a server may execute a dispatched remote call asynchronosuly. Using both these features one can implement call-forwarding component, so useful in distributed systems with integrating server.

Encryption

The secure socket layer (SSL) may optionally be used to encrypt the communication between client and server. This makes YA-RPC applicable over insecure networks.

Customizable serialization

By default, YA-RPC supports serialization of all common types (e.g. int, string, ...), several specialized types (e.g. Guid, DateTime, ...) and single- or multi-dimensional arrays of them. To override the default serialization process, or implement serialization of complex data types, the programmer may provide own implementation.

Besides that, YA-RPC has a feature which we call asymmetrical serialization. It means that client and server may use slightly different communication interfaces, saving later data coversion.

For example, imagine that server uses the interface:

public interface IHelloWorld
{
  [YaRpcMethod(123)]
  string GetMessage( int number );
}

But on the client, the interface will look like:

public interface IHelloWorld
{
  [YaRpcMethod(123)]
  char[] GetMessage( uint number );
}

In YA-RPC the communication between such client and server works. One can imagine that this feature may also bring performance benefits. Please note that YA-RPC checks the compatibility of data-types to prevent bugs and incorrect behavior.

Intelligent threading

The programmer may supply a worker (an implementation of IYaRpcWorker interface) on which remote method calls are executed. This is useful for example to serve remote requests on a single thread queue. Moreover, the subsequent remote calls are executed on a blocked causal thread, which still waits for a result of the pending operation and has nothing to do.

For example, if client A calls method funcB() on server B, and during the dispatch of funcB() another method funcA() is called back on client A, the funcA() is executed on A's thread that blocked while waiting for results from funcB().

Note that this feature not only improves the performance, but makes it possible to implement far more complex communication schemes than simple request/response model, because deep recursion brings no performance drawbacks. Of course, the threading is completely customizable.

No interface definition language (IDL)

In classical RPC systems (CORBA, ONC RPC, DCE/RPC, ...) the communication interface must be defined using IDL meta-language. After that, the client stubs and server skeletons are built from the IDL. YA-RPC takes the advantage of code reflection, available in modern languages like C# and Java, to build stubs and skeletons around your existing classes. This makes it unnecessary to include additional layer of abstraction between your bussines code and communication protocol.

Frequently asked questions

On which platforms may YA-RPC be used?

Currently supported platforms are Microsoft .NET Framework and MONO 1.2. Java version is under development.

What is the difference between YA-RPC and SOAP web services ?

YA-RPC is suited for the environment, where communication protocol is well known. It does not need any web server, or complicated deployment procedure. YA-RPC may be made working in few minutes.

Last update 20th January 2008
Copyright© 2007 yarpc.org