Slides

rangesatanskingdomSoftware and s/w Development

Dec 2, 2013 (3 years and 6 months ago)

109 views

Microsoft Confidential.

An incubation effort to
:

Support client
-
> server communication in native code with a modern C++ API design

Support writing Azure
-
based and on
-
premise REST services in modern C++

Let developers fall into a “pit of scalability success” by designing the I/O libraries to primarily provide
asynchronous APIs

Experiment
with actor
-
based programming model(s) in C
++

Casablanca

What is it?

Accomplished by set of libraries, tooling, and hosting services

Cross platform


public API is only C++11 (Win32,
WinRT
, Linux)

Open source (fall 2012)

Eventual supported release as the Azure SDK for C++

Microsoft Confidential.


Inspirations and basic principles



Highlight some of the major features


HTTP, JSON, Azure Storage,
Async

I/O, Tooling and Deployment


Demos and code walkthroughs

Casablanca

Overview

Microsoft Confidential.

.NET

Client APIs, asynchronous libraries


Node.js

Simplicity, asynchronous
-
only I/O libraries


Erlang

Actor model: scalable, safe, robust server
-
side code

Casablanca

Inspiration

Microsoft Confidential.

Casablanca

Architecture

Async

File I/O

Timers

Binary
Serializers

JSON

Parser & Writer

Azure / IIS Host

Windows Executable Host

Windows 7 / 8

IOCP

PPL

WinHTTP
/HTTP.sys

HTTP

Client & Listener

TCP

Client & Listener

Web Sockets

Client & Listener

UDP

Client & Listener

Apps & Libraries

Azure
Services

Windows
Live

Xbox

Live

C++

Actors

Bing

Maps

Microsoft Confidential.

Service scalability is often bounded by I/O efficiency and per
-
connection resource
consumption

Casablanca

Asynchrony

Essential for responsive GUI

Asynchrony is hard, requiring code to be rewritten with inverted control flow
(callbacks)

Composition of asynchronous operations is even harder without library or
language support

Microsoft Confidential.

REST is the main pattern in use for web services

Mostly for stateless services, but can be used for
stateful

services, too (although
that violates its core principles).

Much less complex than
SOAP


Supported
in Java, .NET, JavaScript, Ruby, Python, etc.


Native
code developers on Windows can use OSS libraries or complex
Win32 C
APIs

Casablanca

REST

Demo

Hello World

http_client

client(
L"http
://
localhost/helloworld");

http_response

response =
client.request
(methods::GET).get();

std
::
wstring

response_string

=
response.extract_string
().get();

Microsoft Confidential.

Text
-
based serialization format

Based on JavaScript


Casablanca

JSON

JSON has become the de facto standard for serializing data for REST
services

Much less complex than XML

Supported by most language environments on the Web

Microsoft Confidential.

Blobs

Simple, file
-
like, storage

Azure Storage

Blobs, Tables, Queues

Tables

Non
-
relational table storage

Queues

Small (64KB) messages queued persistently in the cloud

Cloud
-
based storage

Persistent, redundant, available everywhere (client, on
-
premise server, cloud)

Demo

Guest Book

Demo

Video Streaming

Demo

Image
Stitcher

Microsoft Confidential.

Casablanca

Azure Integration

Casablanca is focusing on providing the following native
-
code integration points out
-
of
-
the box:


VS
template(s) for building Azure projects in C++



Library
bindings for Azure storage, service bus, and service runtime



Azure hosting in both web roles and worker roles


Microsoft Confidential.

We’re also providing capabilities for building on
-
premise
services in C
++:

Casablanca

On
-
premise



Integration
with IIS



A
stand
-
alone host (console executable, not NT service)


Microsoft Confidential.

Download binaries, samples, and documentation at


http://msdn.microsoft.com/en
-
us/devlabs/casablanca.aspx

Casablanca

More Information

Forum


http://
social.msdn.microsoft.com/Forums/en
-
US/casablanca/threads

Questions


stgates@microsoft.com

Release Timeframe


Open source this fall, client side supported release end 2012/early 2013

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be re
gis
tered trademarks and/or trademarks in the U.S. and/or
other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corpo
rat
ion as of the date of this presentation.

Because Microsoft
must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Mic
ros
oft cannot guarantee the accuracy of any information
provided after the date of this presentation.

MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATI
ON IN THIS PRESENTATION.

Microsoft Confidential.


Requires C++11 support for lambdas and move semantics


Casablanca

C++ Actors

C++ library based on
Erlang

concepts

Actors

Message
-
passing

Failure
-
resistant pattern support