Functional Augmented State Transfer (FAST) architecture

12
Functional Augmented State Transfer (FAST) Architecture A NOVEL ARCHITECTURE FOR NETWORK APPLICATIONS DESIGNED BY G-SQUARE SOLUTIONS PVT. LTD.

Transcript of Functional Augmented State Transfer (FAST) architecture

Page 1: Functional Augmented State Transfer (FAST) architecture

Functional Augmented State Transfer (FAST) ArchitectureA NOVEL ARCHITECTURE FOR NETWORK APPLICATIONS DESIGNED BY G-SQUARE SOLUTIONS PVT. LTD.

Page 2: Functional Augmented State Transfer (FAST) architecture

RESTful Architecture

REST architecture extends the concept of Web

Everything is represented as a resource

Each resource has a Uniform Resource Identifier (URI).

URI is similar to URL in the context of web.

There could be four functions (called Methods) performed on a URI:

PUT: Put a new resource POST: Send new data to a resource GET: Get the data in a resource DELETE: Delete the data

RESTful Server

ResourcesThe Client PUT, POST, GET, DELETE

Page 3: Functional Augmented State Transfer (FAST) architecture

Gaps in RESTful architecture

RESTful calls do not take parameters: Everything is a resource Interactions need to be through resource manipulation through HTTP

methods RESTful calls can have side effects:

Any RESTful can modify resources Same calls when made in different order can yield different results

Example calls where RESTful architecture is not ideal: Get weather of latitude 75.435 and longitude 35.275 Get a list of names and apply a filter based on a criteria and return the

names

Page 4: Functional Augmented State Transfer (FAST) architecture

Solution: FAST Architecture

In FAST architecture, the server is split into two components:

a REST server for performing regular REST functions and

functional programming server (called lambda server) for performing functional queries.

A pure functional server should satisfy the following criteria

It should return the same response for the same inputs irrespective of the state of the machine

Any two requests sent to the server can be executed in any order with the same results

All inputs and outputs are immutable

FAST Server

REST Machine: RESTful API

with Resource Access

Lambda Machine for Functional

Computation

The Client

Page 5: Functional Augmented State Transfer (FAST) architecture

ModulesRole of each piece of the FAST server REST API provides a mechanism to

post, update, delete and get resources. Some of these resources could be

generated dynamically in which case the REST API might interact with the Lambda Machine internally

The Lambda machine exposes certain functions to the client

The client can request resources or function calls. If it is a function call it is routed to Lambda Machine and if it is a resource requirement it is routed to the REST API

The key ingredients of lambda machine Any calls to lambda machine will

not have any side effects The state inside lambda machine

is immutable. Any mutable state is stores in the REST Server

User can directly call lambda machine

Page 6: Functional Augmented State Transfer (FAST) architecture

Functional API Template

Get /lambda/<module>/ returns list of sub-modules or functions in the module

Get /lambda/<module>/<name> returns: If name is a function with no parameters it gives the function type If name is a function and paramters are passed the function is

applied on the paramters and result is returned If name is a module a list of sub-modules and functions is given

Post /lambda/<module>/<function> returns: Function is applied on the data in the POST body and the result is

returned

Page 7: Functional Augmented State Transfer (FAST) architecture

Other Calls to FAST

Regular RESTful calls: Post /rest/<path> Get /rest/<path>

FAST calls (functional calls integrated with REST machine) Post /fast/module/function data={{uri}} Post /fast/module/function data={{uri}}, to_uri={{uri}}

In the FAST arcgitecture the lambda machine can take data from another uri and also post the results to another uri

An additional parameter to_do can also be passed. to_do can take the values apply, map, reduce and filter

Page 8: Functional Augmented State Transfer (FAST) architecture

FAST and REST: Differences and Similarities

FAST RESTful

Resources and functions are two different ways to access the functionality of server

Everything is a resource

Functional calls will not have side effects in FAST architecture

Any call can have side effects

A function can be accessed through “parameters”

Access is through get and post to resources. URL parameters are inline with RESTful philosophy

Both architectures allow for stateless interaction between client and server

Both architectures allow for interaction over HTTP

Page 9: Functional Augmented State Transfer (FAST) architecture

FAST vs. SOAP/RPC

SOAP/RPC FAST

A session needs to be maintained between client and server

No session needs to be maintained

Calls can have side effects / change sin state

Only RESTful calls will have side effects, pure functional calls will not have any side effects

The API needs to be known in advance

API can be discovered during interactions

Strong coupling leads to less scalable design

No coupling can be used to build scalable systems

Page 10: Functional Augmented State Transfer (FAST) architecture

Advantages of FAST

Clean design: Segregation of resource management and functional computation

allows for modular development and ease in testing. Efficiency:

Parallelization can be done automatically by the server, thus taking the burden of efficiency from the client.

Security: Both resources and functions can have authentication and rights.

Page 12: Functional Augmented State Transfer (FAST) architecture

Thank YouWWW.G-SQUARE.ING-SQUARE SOLUTIONS PVT. LTD.