product! - the road to production deployment

50
PRODUCT! THE ROAD TO PRODUCTION DEPLOYMENT presented by / Filippo Zanella @r4m

Upload: filippo-zanella

Post on 21-Jan-2018

153 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Product! - The road to production deployment

PRODUCT!THE ROAD TO PRODUCTION DEPLOYMENT

presented by / Filippo Zanella @r4m

Page 2: Product! - The road to production deployment

WHO I AM

Ph.D. in Information Engineering at the, Visiting Researcher

at UC Berkeley and UC Santa Barbara.University of Padua

Founder of , full-stack engineer(RubyOnRails & Ember.js).

Sellf srl

President of the and Memberof the .

Fencing Club of MontebellunaRotary Club of Montebelluna

Page 3: Product! - The road to production deployment

SELLF

Sellf helps people in sales monitortheir deals and manage their

activities to grow and close them.

Small business owners,professionals

and sales agentsusually struggle to keep their

business life organized,overwhelmed by spreadsheets, todo

lists, calendars and notes.

Page 4: Product! - The road to production deployment

PROTOTYPINGBE STUBBORN ON VISION BUT FLEXIBLE ON DETAILS.

(JEFF BEZOS, AMAZON)

Page 5: Product! - The road to production deployment

THE ARDUINO WAYA prototype is meant to be a test. Built using the most

"hacky" approach with the least amount of time to get initialfeedback on whether a concept is viable.

Copyright © 2006-2011 by John Szakmeister

Page 6: Product! - The road to production deployment

CONCEPTHandmade sketch of the data visualization of the app.

Page 7: Product! - The road to production deployment

BACKBONETry to de�ne as much as you can:

InfrastructureCommunication protocolDatabase schemaUX �ow

Page 8: Product! - The road to production deployment

WIREFRAMESDetailed descriptions of the different views of the app.

Page 9: Product! - The road to production deployment

(BALSAMIQ) MOCKUPS

Page 10: Product! - The road to production deployment

MINIMUM VIABLE PRODUCTIF YOU AREN'T EMBARRASSED BY THE FIRST VERSION OF THE PRODUCT YOU'VE LAUNCHED TOO LATE.

(REID HOFFMAN, LINKEDIN)

Page 11: Product! - The road to production deployment

MVPIt is built from the smallest set of features that delivers

customer early adopters value.More than 60% of features in software products are rarely or never used.

Prioritize each feature according to a few factors:

1. How important is this feature for �nishing the process?2. How often will the feature be used?3. How many users will use this feature?4. How much value will the feature bring to the customer?5. How risky is this feature?6. How much time does it take to be implemented?

Page 12: Product! - The road to production deployment

SAAS, BAAS, PAAS, IAASSoftware as a Service (Sellf, Google Apps, GoToMeeting)Backend as a Service (Parse, Apprenda)Platform as a Service (AWS Beanstalk, Heroku)Infrastructure as a Service (AWS EC2, Microsoft Azure)

Page 13: Product! - The road to production deployment

PRODUCTIT IS NOT ABOUT BITS, BYTES AND PROTOCOLS, BUT PROFITS, LOSSES AND MARGINS.

(LOU GERSTNER, IBM)

Page 14: Product! - The road to production deployment

WHEN THE HEAT GETS HOTYou cannot survive with (too) buggy and clumsy code.

You slightly move from MVP and beta releases to a workingapp that your customer expect to be:

fastsecurestable

While you see your user base increasing, you see theirexpectations growing too.

Page 15: Product! - The road to production deployment

SELLF 3.0

Page 16: Product! - The road to production deployment

LOGGING & ALERTINGLog activities of your app to �nd:

failuresbugsheavy algorithmsexpensive queriesunwanted/unexpected behaviors

Set alerts to be noti�ed when speci�c events occur.

Building an ef�cient logging and alerting system allows yourteam to �nd and �x problems quickly.

Page 17: Product! - The road to production deployment

USER BEHAVIOR MONITORINGWhat people really do with your application.

Page 18: Product! - The road to production deployment

PERFORMANCE MONITORINGNobody writes slow code on purpose.

Page 19: Product! - The road to production deployment

AVAILABILITY MONITORINGHow do you know when your app has an outage?

Page 20: Product! - The road to production deployment

ERRORS HANDLINGAnticipate, detect, resolve BUGS.

Page 21: Product! - The road to production deployment

NETWORK ERRORS$.ajax({ type: 'POST', url: '/some/resource', success: function(data, textStatus) { // Handle success }, error: function(xhr, textStatus, errorThrown) { if (xhr.status) { if (xhr.status === 403) { // Handle forbidden access error } else { // Handle generic error } } }});

Page 22: Product! - The road to production deployment

PLATFORM ERRORS

Page 23: Product! - The road to production deployment

FRAMEWORK ERRORS

Page 24: Product! - The road to production deployment

LIBRARY ERRORS...

Page 25: Product! - The road to production deployment

...LIBRARY REPLACEMENTIn the long run, libraries are like a stick in the mud:

not longer maintaineddegrade performancemissing custom needsnot easy to debug

Page 26: Product! - The road to production deployment

YOUR ERRORSThe bloody asynchrony

callAction: function() { var _this, defer; _this = this; defer = Ember.RSVP.defer(); defer.promise.then(function() { if (_this && !_this.isDestroyed) { return _this.set('isLoaded', true); } }, function() { if (_this && !_this.isDestroyed) { return _this.set('isLoaded', false); } });}

Page 27: Product! - The road to production deployment

MAINTAIN 3RD-PARTY SOFTWARE UPDATEDWhen the project relies on external software, it's useful to

leverage the updates, for:

Fix bugs (not caused by our app)Improve overall performancesAdding new featuresDeprecate old conventions

Page 28: Product! - The road to production deployment

CHANGELOGRecord of all the changes made to a project.

Page 29: Product! - The road to production deployment

Now the inline form can be use in addiction:

EXAMPLE OF BUMPINGPrior v1.11 in Ember's an if condition in a template was

limited to the following syntax:

{{#if isEnabled}} <a class="active" href="http://www.facebook.com">Facebook</a>{{else}} <a class="disabled" href="http://www.facebook.com">Facebook</a>{{/if}}

<a class="{{if isEnabled 'active' 'disabled'}}" href="http://www.facebook.com"

simpli�ng the number of lines of code, enhancing readabilityand allowing new behaviours.

Page 30: Product! - The road to production deployment

SECURITYThe Gartner Group however estimates that 75% of attacksare at the web application layer, and found out "that out of

300 audited sites, 97% are vulnerable to attack".

The threats against web applications include:

user account hijackingbypass of access controlreading or modifying sensitive datapresenting fraudulent content

Page 31: Product! - The road to production deployment

SQL INJECTIONA technique where malicious users can inject SQL commands

into an SQL statement, via web page input.Client<p>UserId: <br><input type="text" name="UserId" value="105 or 1=1"></p>

ServerSELECT * FROM Users WHERE UserId = 105 or 1=1

The SQL above is valid. It will return all rows from the tableUsers, since WHERE 1=1 is always true!

Page 32: Product! - The road to production deployment

SSLThe Secure Socket Layer is a cryptographic protocol designedto provide secure communications over a computer network.

Serve everything over SSL.

PS: don't let your certi�cates expire.

Page 33: Product! - The road to production deployment

SCALINGIt means rapid adaptation to a growing user activity.You need to push your system to a higher level, getting the best from your infrastructure.

Page 34: Product! - The road to production deployment

APOCALYPSE NOWYou'll never be ready till the day you have to.

Page 35: Product! - The road to production deployment

HARD STUFFSLoad balancing, caching, CDN, background jobs, ...

... sharding, master/slaves, ETAGs, etc.

Page 36: Product! - The road to production deployment

TEAM GROWTHBeing agile is mandatory when your team growths to stay

focused in delivering real value to the company

No wasting time on unneeded planning docs.No delivering features that do not �t customers needs.

Page 37: Product! - The road to production deployment

THE PROJECT TRIANGLE

Page 38: Product! - The road to production deployment

OPTIMIZATION

Page 39: Product! - The road to production deployment

IMPROVING PERFORMANCESAn optimization analysis should include:

network utilisationCPUmemory usagedatabase query

Optimizing is critical because it has an impact on the scalingfactor of the system!

Page 40: Product! - The road to production deployment

CODING TRICKSParallel versus sequential assignment

var a, b = 1, 2 a= 1, b = 2

5821.3 (±6.0%) i/s 8010.3 (±5.5%) i/s

slow fast

40% faster!

Page 41: Product! - The road to production deployment

LOADING TIMESGoogle Developer Tools (via Chrome)

Page 42: Product! - The road to production deployment

UI DRAINING RESOURCEIn a single-page framework, template rendering choices can

make the difference in terms of RAM usage.

<ul> {{#each alumni as |alumnus|}} <li> <p>Hello, {{alumnus.name}}!</p> <!-- This is RAM consuming... --> <div>{{detailed-profile content=alumnus}}</div> </li> {{/each}}</ul>

Page 43: Product! - The road to production deployment

UI DRAINING RESOURCEDestroy not visibile child views to free up their memory.

<ul> {{#each alumni as |alumnus|}} <li> <p>Hello, {{alumnus.name}}!</p> <!-- Show the details only when the alumnus is selected --> {{#if view.isSelected}} <div>{{detailed-profile content=alumnus}}</div> {{/if}} </li> {{/each}}</ul>

Page 44: Product! - The road to production deployment

CROSS COMPATIBILITY

The (W3C), founded in 1994 topromote open standards for the , pulled ,

together with others to develop a standard forbrowser scripting languages called " ".

World Wide Web ConsortiumWWW Netscape

MicrosoftECMAScript

Page 45: Product! - The road to production deployment

TEST DRIVEN DEVELOPMENTIf you avoid at the beginning TDD practices, you'll discover

that they are as much important as the app code itself.

Continuous integration and testing is a must sooner or later.

Tests can be applied to:

backend - just do it.frontend - think about it.mobile - forget it.

Page 46: Product! - The road to production deployment

UNIT TESTSThey are generally used to test a small piece of code and

ensure that it is doing what was intended.

App.SomeThing = Ember.Object.extend({ foo: 'bar', testMethod: function() { this.set('foo', 'baz'); }});

module('Unit: SomeThing');

test('calling testMethod updates foo', function() { var someThing = App.SomeThing.create(); someThing.testMethod(); equal(someThing.get('foo'), 'baz');});

Page 47: Product! - The road to production deployment

REFACTORINGImproving the design of code without changing its behavior.

Clarity enables performance:

long methodsspeculative codecomments

When you look back to your one-year old code you look at it with the same compassion with whom you look ata photo of you a few years before: you wonder how the hell you could get those clothes and that hairstyle.

Page 48: Product! - The road to production deployment

REMOVE DUPLICATIONif (this.target.entity.is("decoration")) { this.target.entity.game.publish("decoration/showBoost", { entityView: this.target, x: this.target.entity.x, y: this.target.entity.y });}

var entity = this.target.entity;if (entity.is("decoration")) { entity.game.publish("decoration/showBoost", { entityView: this.target, x: entity.x, y: entity.y });}

Page 49: Product! - The road to production deployment

USE MEANINGFUL NAMESvar p = this.current.params;var r = this.current.results;if (r.restProduct) { p.query = r.prestProduct;}

var params = this.current.params;var results = this.current.results;if (results.restProduct) { params.query = results.prestProduct;}

Page 50: Product! - The road to production deployment

THANK YOU!