Developer connect - microservices

21
Microservices Anton McConville - Developer Advocate | IBM Bluemix

Transcript of Developer connect - microservices

MicroservicesAnton McConville - Developer Advocate | IBM Bluemix

@antonmc

The expectations that people using apps have are changing. The way we build apps needs to keep changing. Yet suddenly, for many companies, the way their apps are currently built don’t meet the needs and expectations that the user base has.

Booklet view

Schedule view

Bookmark view

The home view for the app. It is intended to be like a regular booklet for the event. Three pages right as of now.

Where the attendees will spend most of their time - clearly indicating time and content of the events.

A clear set of links and bookmarks about the content

Everyone now understands apps! Take this app that I’m making for a conference. It started life as a ‘what if we had an app?’ idea from a marketing team. I took the idea and prototyped a simple app …

Schedule View

• Can we include a short bio and picture for each speaker? • Can we add the Twitter handles of the speakers, allow a 'follow' / 'tweet to' button and possibly include a Twitter analysis for each of their handles? Perhaps as part of the

bio?

Session Information: • Can we do live polling with the app / ability to submit questions live during the session? • Can we conduct session surveys at the end of every session, even if it’s a smiley face or a frown to denote their experience? Could there also be a push notification at the

end of each session? • Can we add an option to receive more information about a certain breakout session? For example, a button to "receive more info" in the app so we can send a follow up

email with content and articles specific to the breakout for a deeper dive. • Can we add a "contact sales" CTA that can be added for each session to enable users to take the next step or ask questions?

Interactive Elements: • We had this wild idea of getting a drone to take pictures during the event, and then have those pics be uploaded into a gallery on the app. Is such a thing possible? • If the drone isn’t feasible, can we have a picture sharing section, so any pics that have been taken gets uploaded to a shared gallery in the app? • Can we add an iOS push to the app? There's a direct message to those who have installed the app. We could easily get away with 1 message post-event that requires an

action. (even if it's just the following day to a webform) Social: • Can we add a link to follow @IBMBluemix?

About this App: • Can we add the “how to build this app” guide we discussed?

… this is what they came back with … more ideas … from non programmers … apps are universal, we see them being updated all the time … quickly and easily as consumers … it is a world of app publication!

JSP

Servlets

Web Services

Session Beans

CMP Entity Beans

JDBC

JMS

Secu

rity

Prob

lem

Det

erm

inat

ion

Anal

ytic

s

app.war

App Server app.config

@antonmc

For those of us who have been programming for a while, we’re familiar with the JEE stack …

Monolithic

@antonmc

… it is monolithic … all functionality locked together …

@antonmc

… big, slow to start up, elegant in it’s own way … wouldn’t want to stop it when it gets going … time consuming to scale …

@antonmc

… and often resulting in spaghetti code …

Service Oriented Architecture

@antonmc

… we evolved to make service oriented apps and they helped … though we relied on the same technologies to make them …

@antonmc

… and they were autonomous … but followed strict protocols … they slotted in, but in in a regimented way …

@antonmc

Netflix, eBay and others have pioneered a different approach. They constantly update their apps right before our eyes - sometimes dozens of times a day.

Small autonomous services that work together

Microservices

Narrowly focused, independently deployable

@antonmc

They cultivated a concept known as micro services …

@antonmc

… which, if you indulge the many metaphors going on in this presentation … works like a bee hive … each individual is autonomous, self directed, unique, but replaceable, focused on one job … but they cooperate to fulfil a system.

MicroServices

@antonmc

Tiny focused services that work together.

Store UI (PHP)

Inventory (Nodejs)

Ordrers (Java)

MySQL

SendGrid SQLDB

Cloudant

MicroServices Demo

@antonmc

Let’s look at a demo … courtesy of Ram, and https://developer.ibm.com/bluemix/2015/03/16/sample-application-using-microservices-bluemix/

Principles

Autonomy

Abstract implementation details

Focused ona domain

Isolate Failure

Deploy independently

Observable

Continuous Integration

@antonmc

Iteration 1 Iteration 3 Iteration 5

Helps evolve an app

@antonmc

Microservices conveniently offer a helpful evolution path - since the whole idea is that we can add and tweak each autonomous, focused part.

@antonmc

And, I think the cloud enables so much more to happen easily. It is a publishing system - guess what, we’re publishing apps!

@antonmc

Interface

Data

Server

Development

Scaling

Security

Design

Development

Cost

In stark contrast, even just four years ago, when I started developing iPhone apps most of the work behind an app happened way beneath the surface. Way beneath it. The cloud has really narrowed the distance between data and interface. It is genuinely an exciting time for a developer.

I. Codebase One codebase tracked in revision control, many deploys

II. Dependencies Explicitly declare and isolate dependencies

III. Config Store config in the environment

IV. Backing Services Treat backing services as attached resources

V. Build, release, run Strictly separate build and run stages

VI. Processes Execute the app as one or more stateless processes

VII. Port binding Export services via port binding

VIII. Concurrency Scale out via the process model

IX. Disposability Maximize robustness with fast startup and graceful shutdown

X. Dev/prod parity Keep development, staging, and production as similar as possible

XI. Logs Treat logs as event streams

XII. Admin processes Run admin/management tasks as one-off processes

Cloud Native App

12 Factor App

http://12factor.net/

@antonmc

I’m not going to annotate this much. If you’re serious about cloud apps, then you should respect, and recite ;) the 12 factor app manifesto … http://12factor.net - read it!

@antonmc

And in the end … as the Beatles would sing …

And in the endThe love you takeIs equal to the loveYou make

Which is my musical/hippy way of saying, that the analytics you study, will be proportional to the content you offer - Bluemix has tools to show you some of that too ;)