38
Faster than rabbits @BauerVlad, 2014

Be faster then rabbits

Embed Size (px)

Citation preview

Page 1: Be faster then rabbits

Faster than rabbits

@BauerVlad, 2014

Page 2: Be faster then rabbits

Questions / Problems

• Why are we so slow?• How to increase development productivity?• How to extend the sphere of projects to develop?• How to develop High-Load web applications?• How to develop small / medium sized projects fast?• What can we do with it?

Page 3: Be faster then rabbits

Java principles

1. It should be "simple, object-oriented and familiar"2. It should be "robust and secure"3. It should be "architecture-neutral and portable"4. It should execute with "high performance"5. It should be "interpreted, threaded, and dynamic”

+ WORA

James Gosling, 1991-1995

What's the catch?

Page 4: Be faster then rabbits

+ Java EE 8JSRs

JEE evolution

Page 5: Be faster then rabbits

spring.io

Page 6: Be faster then rabbits

Spring that you might not know

• Spring Web Services• Spring Data• Spring Web Flow• Spring Integration• Spring Batch• Spring Security• Spring HATEOAS• Spring Social• Spring AMQP• Spring Mobile• Spring for Android

• Spring Boot• Spring XD• Spring LDAP• Spring Scala• Spring Roo• Spring Blazeds Integration• Spring Loaded• Spring Shell• etc.

Page 7: Be faster then rabbits

Java disadvantages

• “Generic” solutions / Tons of code• High level of complexity in libraries / frameworks• Poor concurrency model• Stateful nature• Mutable nature• Backward compatibility• Monolithic applications architecture• High resource consumption• Poor code hot swapping• Static typing

Hussars keep silence!

Page 8: Be faster then rabbits

BeanShell, JudoScript, Fortress, Gosu, JGNAT, BBj, Adobe ColdFusion, Railo, Open BlueDragon, Armed Bear Common Lisp, CLforJava, Rhino, Nashorn, Free Pascal, MIDletPascal, Rakudo Perl 6, JIProlog, TuProlog, NetRexx, Bigloo, Kawa,

SISC, Jscheme, Jacl, …

JVM languages

Page 9: Be faster then rabbits

PHP: Hypertext Preprocessor

• Original name: Personal Home Page Tools• Paradigms: imperative, functional, object-oriented,

procedural, reflective• Short time to market• Easy integration• Flexibility• Availability of resources

“I don’t know how to stop it, there was never any intent to write a programming language. I have absolutely no idea how to write a programming

language, I just kept adding the next logical step on the way.”(Rasmus Lerdorf)

Page 10: Be faster then rabbits

What about High-Load?

Page 11: Be faster then rabbits

• Debian Linux• nginx• PHP + XCache• Apache + mod_php• memcached• MySQL• Custom DB (internal

project)• node.js for XMPP• HAProxy• XFS• ffmpeg

• Linux• PHP / HipHop / Hack• memcached• MySQL• Apache Thrift• Scribe

Page 12: Be faster then rabbits

• MySQL• Linux• PHP• Lucene• APC PHP Accelerator• Memcached

• Linux• Python• Django• Apache 2.2• PostgreSQL• memcached• HAProxy• Slony• heartbeat

Page 13: Be faster then rabbits

• Microsoft ASP.NET MVC• SQL Server 2008• C#• JQuery• LINQ to SQL

• WISC• Windows Server 2008 R2

x64, Ubuntu Server, CentOS• MS SQL Server 2008 R2• IIS 7.0, HAProxy• Redis• Lucene.NET• Bacula• Nagios (+ n2rrd, drraw)• DotNetOpenId• Prettify, MarkdownSharp,

Flot

Page 14: Be faster then rabbits

• Ubuntu Linux 11.04• Python• Django• Amazon: EC2, ELB, Route53,

S3, CloudFront• Nginx• gunicorn• HAProxy• PostgreSQL: postgis, pgfouine,

pgbouncer• Redis, Memcached• Gearman• Solr• munin, statsd, pingdom• Fabric• XFS

• Amazon AWS• Nginx• Python• Django• MySQL• Memcached• Redis• Solr• Hadoop

Page 15: Be faster then rabbits

• Linux (Debian Sarge)• Perl• Apache• MySQL + InnoDB• Perlbal• Memcached• MogileFS• Gearman• TheShwartz• djabberd

• CentOS, Mac OS X• Apache• PHP, Scala, Ruby, Java• Finagle• MySQL, HBase• memcached, Redis• Varnish, nginx• HAProxy• kestrel, Gearman• Thrift• Kafka• Hadoop• ZooKeeper

Page 16: Be faster then rabbits

• Windows & OpenSUSE• Java• С/С++• GWT• Apache Tomcat• JBoss 4• LVS & IPVS• MS SQL 2005 & 2008• BerkleyDB• Apache Lucene

• Solaris (x86, SPARC)• Java• Tomcat & Jetty• Oracle & MySQL• ORM• ActiveMQ for JMS• Lucene• Spring

Page 17: Be faster then rabbits

A long time ago in a galaxy far, far away…

Page 20: Be faster then rabbits

Example: Halloween project

• Description: TELNET application

• 38 RFC describes TELNET protocol

• Node.js, modules: net, cowsay, colors

• 39 lines of code• Development time: 15-

30m (+ 2-3h to find content)

Page 21: Be faster then rabbits

BaaS / MBaaS

• Versioning• User management• Analytics• Code generation• Media streaming• File management• Geolocation• Push notifications• Integration with social

networks• etc.

• http://parse.com• http://backendless.com• http://cloudbase.io• http://quickblox.com• http://appery.io• http://feedhenry.com• http://apiomat.com• http://applicasa.com• http://kidozend.com• etc

Page 22: Be faster then rabbits

Web frameworks

Page 23: Be faster then rabbits

Java Web developmentClick, OFBiz, Shale, Sling, Struts, Tapestry, Wicket, AppFuse, Eclipse RAP, FormEngine, Google Web Toolkit, Hamlets, ItsNat, JavaServer Faces, JBoss Seam, JSF (RichFaces, ICEFaces, PrimeFaces, MyFaces, Oracle ADF Faces Rich Client, Backbase Enterprise Ajax, IBM Notes,

Sun Java BluePrints, ZK Ajax), JSP, Jspx-bay, JVx, OpenLaszlo, OpenXava, RIFE, Spark, Spring (MVC, WebFlow), Stripes, ThinWire,

Vaadin, Wavemaker, WebObjects, WebWork, ZK, ztemplate...

Tomcat, Geronimo, GlassFish, JBoss, Jetty, Jaminid, Enhydra, Winstone, Underthow, TJWS, Eclipse Virgo, Borland ES, JRun,

LiteWebServer, WebLogic, Orion, Resin, ServletExec, WebSphere, NetWeaver, tc Server

...

Page 24: Be faster then rabbits

JSF• JSF 2.2 (2013-05-21) — Introduced new concepts like stateless views, page flow and the

ability to create portable resource contracts.• JSF 2.1 (2010-11-22) — Maintenance release 2 of JSF 2.0. Only very minor amount of spec

changes.• JSF 2.0 (2009-07-01) — Major release for ease of use, enhanced functionality, and

performance. Coincides with Java EE 6.• JSF 1.2 (2006-05-11) — Many improvements to core systems and APIs. Coincides with Java EE

5. Initial adoption into Java EE.• JSF 1.1 (2004-05-27) — Bug fix release. No specification changes.• JSF 1.0 (2004-03-11) — Initial specification released.

Server-side rendering

Components:PrimeFaces, JBoss RichFaces, ICEfaces, Apache MyFaces, Oracle ADF Faces Rich Client, Backbase Enterprise Ajax, IBM Notes, Sun Java BluePrints, ZK Ajax

Problems with customization

Page 25: Be faster then rabbits

GWT?

• Using HTML in GWT - poor• Using CSS in GWT - poor• Separation of concerns - poor• Union of problems• Desktop != Web

• Live examples:• Simba: GWT -> AngularJS• 30-50m to build big projects

Client-side rendering

Page 26: Be faster then rabbits

Rendering

Server-Side• Has expensive (re)deploy• Needs a lot of hardware

resources• Uses expensive caching• Needs additional REST API• Uses needed data set• Has framework components• Can split development team• Has got less JS code

Client-Side• Has instant redeploy• Does not use a lot of server

resources• Uses cheap caching• Has out-of-box REST API• Uses extended data set• Has framework components• Can split development team• Has got a lot of JS code

vs

Page 27: Be faster then rabbits

Client-side

• Demand (Hot Google searches):• Java: about 230 000 000 results• JavaScript: about 916 000 000 results• PHP: about 3 140 000 000 results

Page 28: Be faster then rabbits

Distribution of workDesigner

Frontend Developer

Backend Developer

HTML Coder

10%10%

40%

40%

Page 29: Be faster then rabbits

Web browsers

Browser Version

IE 11

Firefox 28.0

Chrome 33.0.x

Safari 7.0.3

Opera 20.0

WebKit (Apple)V8 (Google)

Page 30: Be faster then rabbits

http://html5test.comBrowser Version Points (max: 555)

Chrome 33 505

Opera 20 496

Opera Mobile 16 471

Firefox 28 448

Android 4.4 428

iOS 7 412

Safari 7 397

Internet Explorer

11 376

10 335

9 128

Windows Phone 8.1 372

Page 31: Be faster then rabbits

http://css3test.comBrowser OS Version %

Opera Windows 7 20.0 59%

Chrome OS X 10.9.2 33 57%

Firefox OS X 10.9.2 22 52%

Internet Explorer Windows 7 11 52%

Opera OS X 10.9.2 12.5 48%

(without vendor-specific features)

Page 33: Be faster then rabbits

GUI/Application related frameworks

Page 34: Be faster then rabbits

AngularJS

Page 37: Be faster then rabbits

Tools

> > >

(Apache Maven) (Apache Ant) (Apache Ivy)

(checkstyle)

Page 38: Be faster then rabbits

Questions?