gids.2019 serverless architectures and - developermarch€¦ · event-driven systems integration...

35

Upload: others

Post on 22-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache
Page 2: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2018,Oracleand/oritsaffiliates.Allrightsreserved.|

GIDS.2019

ServerlessArchitecturesandPatternsinAction

AbhishekGuptaPrincipalProductManagerOracleCloudInfrastructure– Serverless

@abhi_tweeter

April25,2019

Page 3: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

AgendaIntrotoServerless

OpensourceFn ProjectandOracleFunctions

“inaction…”– usecases&demos

QnA

1

2

3

2

4

Page 4: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

SafeHarborStatementThefollowingisintendedtooutlineourgeneralproductdirection.Itisintendedforinformationpurposesonly,andmaynotbeincorporatedintoanycontract.Itisnotacommitmenttodeliveranymaterial,code,orfunctionality,andshouldnotberelieduponinmakingpurchasingdecisions.Thedevelopment,release,timing,andpricingof anyfeaturesorfunctionalitydescribedforOracle’sproductsmaychangeandremainsatthesolediscretionofOracleCorporation.

Page 5: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Forslidesandcode…

https://github.com/abhirockzz/gids2019

Page 6: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

HelloServerless

Page 7: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Page 8: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Serverlesscharacteristics

Thereareservers,butdon’tworry aboutthem(provisioning,patching

etc.)

Scale (inandout)automatically

Costeffective– payonlyforuse

Page 9: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

FaaS-inating options

OracleFunctions

Opensource

Cloudofferings

andlotsmore….

Page 10: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

• OpenSource—novendorlock-in

• DockerBased—leverageDockerecosystem

• PlatformIndependent—laptop,server,cloud

• SchedulerIndependent—deploytoKubernetes,Swarm,Mesos,etc.

• Approachable—easyfornewusers,lowlevelcontrolsforadvancedusers

www.fnproject.ioOracleFunctions

CurrentlyinLimitedAvailability

Page 11: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

BasicConcepts

Page 12: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

A Function

Page 13: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.| 12

CLI

https://github.com/fnproject/cli/releases

Page 14: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

DeployandInvoke

- function- func.yaml- Dockerfile

fn deploy

fn invoke

Pullimage,runcontainer

Dockerregistry

Server(fn orOracleFunctions)

Page 15: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Developerexperience

1. fn start2. fn init --runtimego--namehellofunc3. fn usecontextdefault4. fn createapporacodemo5. fn –vdeploy--apporacodemo --local6. fn invoke oracodemo hellofunc

1. fn start2. fn init --runtimego--namehellofunc3. fn usecontext<functions-ctx-name>4. fn createapp<additionalinfo> oracodemo5. fn –vdeploy--apporacodemo --local6. fn invoke oracodemo hellofunc

Localdevelopment OracleFunctions(Cloud)

Page 16: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

UseCases&Patterns

Page 17: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Backendsystems

Event-Drivensystems

Integration Automation

• APIs• Webapps

• Eventdrivenapps• StreamProcessing

• Webhooks• Workflows

• IaaSmonitoring• Scheduled/Batchjobs

Page 18: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Backendsystems

Page 19: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

APIs(dataservices)

APIG

atew

ayMobile

Web OracleFunctions

Legacysystem

Otherbackend(s)

Page 20: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

FaaSAPIs+‘friends’=ServerlessWebapps

APIG

atew

ay

ObjectStorage

Frontendassets(HTML,JSetc.)

User

Page 21: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Event-DrivenSystems

Page 22: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Asynchronousprocessing

OCIObjectStorage

ObjectStorageevents–created,deleted,updated

etc.

OracleFunctions

Dropstextfiletoinputbucket

1

2

3 ConvertstoPDFandstoresinoutput bucket

TexttoPDFconversion

Page 23: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

StreamProcessing• Builttohandlecontinuous(streamsof)data– Durable/persistent• Possibletoreplayandreprocessdata(akatimetravel)

–MessageOrdering,lowlatency,differentguarantees

• AmazonKinesis,ApacheKafkaetc.• Streaming-FaaS integration– Native– tightcouplingb/wstreamingandFaaS platforms• vendorspecifice.g.Kinesis->Lambda

– Custom– rollyourown• vendoragnostic,flexiblee.g.Kafka->FaaS• Needaserver component

Page 24: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Kafka->KafkaConnect->FaaS

KafkaCo

nnect

(sinkconn

ectors)

KafkaCo

nnect

(sou

rceconn

ectors)

Producers Consumers

Sources

OracleFunctions

StreamProcessors

Page 25: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Integration

Page 26: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Webhooks

• Wikipedia– “user-definedHTTPcallbacks”– “usuallytriggeredbysomeevent”

• Eventdrivenonsteroids – triggerfunctionsusing(almost)any eventsource

• EasilyintegratewiththirdpartysystemslikeGitHub,Slack,Twilio etc.

Slackservice(withconfiguredwebhook)

Random API

Slackworkspace(user)

1

2

3

4

funcy – trimmeddownversionoftheGiphySlackapp

Page 27: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

https://blog.csanchez.org/2019/02/19/serverless-jenkins-pipelines-with-project-fn/

Page 28: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

FunctionOrchestration

• Problem(s)– HowdoIintegratefunctionstobuildcomplexapps?– Orchestratetheirbehavior– Manageintermediatestate

• Options- AWSStepFunctions,AzureDurableFunctions,FnFlowetc.

• FnFlow– Buildlong-runningfunctionswithrichsetsoflanguage-specificprimitivesincludingfork-join,chaining,delaysanderrorhandling

– Supportscomplexparallelprocessesthatarereadableandtestable(includingunittests)withstandardprogrammingtools

27

FnFlowJavaUserGuide

Page 29: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Automation

Page 30: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Inframonitoring

IaaS

Create,start,stop,terminate

etc.

Events….

OracleFunctions

MonitoringOracleDBlifecycleevents

OCIEmailDeliveryService

Page 31: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

ScheduledJobs

• Configureandforget!• Goodforautomatingrepetitive tasks– Reminders,alerts(email,SMSetc.)– Backups,import/export– etc.

Page 32: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Links• Slack - https://fnproject.slack.com/

• Blog - https://medium.com/fnproject• Twitter - https://twitter.com/fnproject

• GitHub– Fn – https://github.com/fnproject/fn– FDKs- https://github.com/fnproject/?&q=fdk– Fn Flow- https://github.com/fnproject/flow

• OracleFunctions- https://blogs.oracle.com/cloud-infrastructure/announcing-oracle-functions

• GitHubrepoforthistalk- https://github.com/abhirockzz/gids2019

Page 33: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache

Copyright©2019,Oracleand/oritsaffiliates.Allrightsreserved.|

Thankyou!

Page 34: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache
Page 35: GIDS.2019 Serverless Architectures and - DeveloperMarch€¦ · Event-Driven systems Integration Automation • APIs • Web apps • Event driven apps ... •Amazon Kinesis, Apache