full stack development

28
Full stack What stands behind these words

Upload: paul-yuriychuck

Post on 24-Dec-2014

346 views

Category:

Engineering


4 download

DESCRIPTION

Essentials of becoming full stack developer

TRANSCRIPT

Page 1: Full stack development

Full stackWhat stands behind these words

Page 2: Full stack development

@Me

● Front-end lead developer● Front-end since 2008● Full stack since 2013● Now: Node.js● Before: Angular.js, Backbone.js, Chaplin,

Google Closure Toolkit, Flex, Actionscript

Page 3: Full stack development

Agenda

1. Front-end world2. Back-end world3. Reasons of bugs4. Best practices5. Stories with morality6. Summary7. QA?

Page 4: Full stack development

Front-end. So different applications.

● Gaming● Media publishing● Internet Messaging● Data visualization● Social networks● GIS● And many many more...

Page 5: Full stack development

Front-end evolution

1. Pre AJAX:a. LAMP: Linux + Apache + MySQL + PHP(PERL,

Python). index.php2. AJAX:

a. Multi paged: CakePHP, Django, Symfony, Zend Framework, JSP

b. Single paged: Index.html + anchors, jQuery3. Post AJAX:

a. Realtime API: Meteor.js, WebSockets, WebRTC

Page 6: Full stack development

Typical tasks

● Unit testing, end-to-end testing of modules and components

● Minifaction and merge of javascript modules

● Compilation of LESS/SASS/Stylus to CSS● Revisioning of files● Assets preparation● Generation of manifesto file

Page 7: Full stack development

Front-end

● Client-side○ Interoperability

■ Cross-browser - same feature + different implementations, polyfills

■ Mobile devices - fast css + slow javascript + slow internet connection

● Presentation○ HTML5 - a lot of buzz-words, but only few jedis

know about them

Page 9: Full stack development

Reasons of front-end bugs

● Browser detection code● Too wide CSS selectors● Event cycle management● Event listeners not removed properly● Closures variables

Page 10: Full stack development

Summary

● One language many environments● Heterogenous clients (OS + Browser +

Platform)● Significant amount of events are invoked by

user: mouse, keyboard, touch-screen● Mostly visual representation

Page 11: Full stack development

Back-end

● Platforms○ *nix: Linux, BSD, Solaris, AIX, HP-UX○ MS Windows

● Databases○ Relational: Oracle, MySQL, PostgreSQL, MS SQL○ Non-relational: MongoDB, OrientDB, CouchDB, Cassandra, BerkeleyDB

● Languages○ Perl, PHP, Python, Erlang○ Java, Scala, Groovy○ Ruby, Ruby on Rails○ Node.js, CoffeeScript

Page 12: Full stack development

Tasks

● Builds (unit testing, integration testing)● Deployment● Environment configurations● High Availability● Load balancing● Performance testing● Continuous Integration

Page 13: Full stack development

Reasons of back-end bugs

● Configuration○ Not applied○ Not loaded○ Points to wrong place

● Action sequence flow● Asynchronicity issues● Parameters validation● Integration with third-party API’s or other services● Trying to apply coding pattern that does not work as expected● Memory management issues

Page 14: Full stack development

Back-end summary

● Mostly homogenous environment● Price of API changes● Most events are emitted by

OS/Services/Network/Databases● Predictability - you are driving environment● User does not see the back-end explicitly. He even

does not know that it exists.

Page 15: Full stack development

Kill em’ all

● One paltform could not fit all tasks:○ Many data sources, fast handling - Node.js○ Universal scripting platform - Python○ Hipster platform -Ruby on Rails○ Long-term tasks performance - Java, Scala○ Narrow fast tasks - C/C++

● One interchange format is not applicable for all use cases○ JSON - Data○ HTML - Pages○ Markdown - documentation○ XML - RPC, SOAP, Structured text○ YAML - Configuration files, descriptions

Page 16: Full stack development

Full stack profile

1. Client side stacka. HTML5 - presentation and client side APIb. Build automation Grunt/Ant/Mavenc. Unit testingd. LESS/SASS/Styluse. AJAX, WebSockets, WebRTC

2. Server side stacka. Java, Python, PHP, Rubyb. MVC frameworkc. Databasesd. *nixe. CI

Page 17: Full stack development

Stories: Four Weddings and One Funeral

● What could happen if developers do not understand each other

● What should be avoided● Where to point● What is going on when: oh crap it does not

work!

Page 18: Full stack development

Story #1

1. HTML5 game for mobile platforms2. CSS3 + Spritesheets + Lime.js + Google

Closure Toolkit3. CakePHP + MySQL + Ubuntu Linux4. XML as interchange format5. Over 20 API calls to load friends game

scores and over 5 minutes to load it all

Page 19: Full stack development

Story #2

1. HTML5 Newspaper App for mobiles2. Backbone.js + Require.js + jQuery3. Drupal6 + Ubuntu linux + MySQL4. XML as interchange format5. XML built using strings concatenation (sic!)6. Many drupal hooks that do not know about

each other7. 5 - 10 mins to load news feeds

Page 20: Full stack development

Story #3

1. HTML5 Multi Page Web App2. Java + Ubuntu Linux + Oracle DB3. Require.js + Backbone.js + jQuery4. All clients in GMT timezone5. Server was located in non-GMT and used local time

zone6. Clients needed to adopt server time to local time7. Day could have 22, 23 and 25 hours. Really.

Page 21: Full stack development

Story #4

1. HTML5 Web portal for OpenStack platform2. Python + OpenStack + Ubuntu + RabbitMQ3. Angular.js + LESS + HTML54. One action invokes many (>5) ajax calls5. All calls are enqueued as long as domain is the same6. Gimme code #1, Gimme code #27. Huge latency, over 1 min to see single statistics

entry

Page 22: Full stack development

Moral

1. One single UI element could involve a lot of back-end interactions

2. Applying front-end approaches to back-end and vice versa is a bad idea

3. Quick and dirty in a long term period leads to just dirty

4. Laziness on one side leads to overtime on another side

Page 23: Full stack development

Best practices

● RAML● When you have over 3-5 calls per single action - think about middleware● Tools should be chosen when you have analysed requirements and

workaround● No silver bullet and ‘Не все йогурты одинаково полезны’● Be ready for production from the very beginning● Be ready for changes and do not rely on library/framework. Library

could be replaced with another one if it implements the same pattern

Page 24: Full stack development

Best practices

● Definition of done for back-end work ○ RAML or documentation about HTTP

request/response format○ Unit tests○ Deployable package deb, rpm whatever○ VM where it could be deployed Jenkins job is even

better○ Notification to all team

Page 25: Full stack development

Best practices

● Definition of done for front-end work○ Proper config for web server/requirements for back-end○ Unit tests, cover these cases: negative, positive, invalid○ Behavior

■ Right for correct user data. ■ Expected for incorrect user data. ■ Predictable for network failures. 200 OK is not the only response

○ Look and feel■ Check your target browsers and devices. Safari !== iOS safari !==

Chrome○ Load time is reasonable and not only from localhost;)○ Packaged into deb/rpm

Page 26: Full stack development

Best practices

● Definition of bugfix is done○ Jira issue with description about bug○ Code fixed and reviewed○ Unit and automation test added to cover the case

that bug is fixed○ Code merged into master branch○ Deployable package is available

Page 27: Full stack development

Resume, or why to choose full-stack?

1. Being full stack developer makes you polyglot. You can negotiate with front-end and back-end devs and dev-ops and QAs

2. Being full stack developer gives you better understanding of product lifecycle

3. You will know the junction points of your app

Page 28: Full stack development

Contacts

[email protected]● skype: pavlo.yuriychuck● twitter: @pavlo-yuriychuck