Technology Overview
Agenda
Overview
Back End
Function Designer
Front End
UI Designer
Getting Started
Sushy.io
Overview
Modularity
Sushy.io
One of Sushy.io's main goals is to make a standard modular form for application components
We want one unified format that supports front-end web components, front-end mobile components, back-end Amazon Web Services components, and back-end Spark components
Modularity
Front End Web Components
Sushy.io
Google Polymer has created a great standard for front-end web components with many components already made
The web applications that are built with Sushy.io will be a collection of Polymer components resulting in one large specialized code-generated Polymer component
Modularity
Front End Mobile Components
Sushy.io
Xamarin Forms is a nice Mono wrapper over Android, iOS, and Windows Mobile platform views
This is not as complete as Polymer so work would need to be done to allow for more customized elements to be easily generated that can match the Polymer standard
Modularity
Back End AWS Components
Sushy.io
AWSM sets a standard for AWS modules that can be reused and easily maintained and deployed over many locations
AWSM modules consist of Lambda functions, and configuration details for IAM, API Gateway, S3, DynamoDB and any other resources your module needs to be deployed
Modularity
Back End Spark Components
Sushy.io
Spark is the leading Big Data processing system with support for streaming data but currently spark development is difficult and code reuse is complicated
Creating a standard similar to the AWSM standard for Spark would allow for complex applications to be built quickly
These modules would include Spark functions, EC2 cluster, Kinesis, and other AWS services configurations
Overview
Collaboration
Sushy.io
Large projects require teams. Sushy.io needs to have good tools for team collaboration
This includes communication tools like a messager and organization tools like a calendar and a task list
It also includes multiple users editing the same code or designer documents
Collaboration
Simultaneous Editing
Sushy.io
Together.js is a library that supports multiple users interacting with each other all of our polymer components for Sushy.io should work with Together.js so that they can be collaboratively edited
These components also need to keep track of who edited what, permissions, and autosaving
Overview
Synthesizability
Sushy.io
Sushy.io needs to offer tools for helping users take modules and easily synthesize more complex modules from simple customizable building blocks
Theses tools also need to help deal with complexity with many views for looking at the new module abstractly but also being able to dive into the details
Overview
Marketplace
Sushy.io
Sushy.io will have a marketplace to buy and sell or freely share complex components
Components need to be easily packaged into a purchasable part
Design viewers need to prevent users from viewing the inside parts of purchased modules
Views also need to have an easy button to post their module or request a module with a specific functionality
Back End
Intro to AWS
Sushy.io
In order to really understand anything about the back-end of Sushy.io you need to understand the basics of AWS
S3
Lambda
IAM
DynamoDB
Cognito
API Gateway
CloudFront
EC2
CloudWatch
SES
Kinesis
Intro to AWS
Simple Storage Service
Sushy.io
S3 is like a Dropbox account. (actually Dropbox run entire on S3)
You can put files which are called Object on S3 in what are called Buckets
S3
Buckets can have folder and can also be used for web hosting
S3 Bucket
Buckets, Objects, and folders can all have permissions associated to specific IAM roles
S3 Object
Intro to AWS
Lambda
Sushy.io
Lambda is the new work horse of AWS. The idea is you write a function and you can call this function from an API and you are only charge for the amount of time it takes to run
There is no provisioning required you can have 1 billion lambdas running at once or none depending on your current use
Lambda currently supports JavaScript, Python, and Java. However, there are ways to run other languages like C++
Lambda
Lambda
Creating a Lambda Function
Sushy.io
Lambda
console.log('Loading function');
var AWS = require('aws-sdk');
AWS.config.apiVersions = {
dynamodb: '2012-08-10'
};
var dynamodb = new AWS.DynamoDB();
exports.handler = function(event, context) {
console.log('value1 =', new Date().getTime().toString());
console.log('value2 =', event.ip);
console.log('value3 =', event.useragent);
var datetime = new Date().getTime().toString();
var get_params = {
Key: {
id: {
S: event.id
}
},
TableName: 'sushyemail'
};
dynamodb.getItem(get_params, function(err, data) {
if (err) { // an error occurred
console.log(err, err.stack);
context.fail('DynamoDB Failed to Get!');
} else { // successful response
var id_db_set = [];
var tmp = {
M:{
timestamp: {
N: datetime
},
ipaddress: {
S: event.ip
},
useragent: {
S: event.useragent
}
}
};
id_db_set.push(tmp);
if('Item' in data) {
var reallink = data['Item']['link']['S'];
if('clickEvent' in data['Item']) {
var clickEvent = data['Item']['clickEvent']['L'];
for(var i=0; i<clickEvent.length; i++) {
var tmp2 = {
M:{
timestamp: {
N: clickEvent[i]['M']['timestamp']['N']
},
ipaddress: {
S: clickEvent[i]['M']['ipaddress']['S']
},
useragent: {
S: clickEvent[i]['M']['useragent']['S']
}
}
};
id_db_set.push(tmp2);
}
}
var put_params = {
TableName: 'sushyemail',
Item: {
id: {
S: event.id
},
link: {
S: reallink
},
clickEvent: {
L: id_db_set
}
}
};
dynamodb.putItem(put_params, function(err, data) {
if (err) {
console.log(err, err.stack);
context.fail('DynamoDB Failed to Insert!');
} else {
context.succeed(reallink);
}
});
} else {
context.fail();
}
}
});
};
This is a real function used for Sushy.io's join emails, to detect when users opened the emails
Lambda
Creating a Lambda Function
Sushy.io
Lambda
console.log('Loading function');
var AWS = require('aws-sdk');
exports.handler = function(event, context) {
if(event.check) {
context.succeed({
functionCheck: true
});
} else {
context.fail();
}
};
This is a simplified example to see the basics
The event input is the JSON that the API was given to call Lambda
To return from Lambda you either use context.succeed() or context.fail()
Lambda
Creating a Lambda Function
Sushy.io
Lambda
For non-trivial Lambda functions you may have to require many node.js modules and use AWS's JavaScript SDK to interact with other AWS resources
AWS JavaScript SDK
Agenda
Sushy.io