go revel gooo

35
Go Revel Gooo.. dovchar 2014

Upload: dmytro-ovcharenko

Post on 02-Jul-2015

466 views

Category:

Software


0 download

DESCRIPTION

It will be a presentation about relatively new programming language from “google go” (http://golang.org/). We will also talk about web framework and Revel (http://revel.github.io/), and additionally I’ll tell you why do you need to choose “go” and not “node.js”.

TRANSCRIPT

Page 1: Go Revel Gooo

Go Revel Gooo..

dovchar 2014

Page 2: Go Revel Gooo

✦ 8 years in IT

✦ 4 years in SoftServe

✦ 1.6 years Application Architect

✦Main language: Javascript

✦ Hobby language: Go

✦ Pacemaker conference

✦ Script’n’Code meet-up

✦Open source (typescript grails, clio

go, sonar qunit, kojak, jspro)

do

vch

ar itw

ee

ke

nd

20

14

About

me

Page 3: Go Revel Gooo

✦ I love my project :)

✦ Technology stack / toolset

✦ Cloud Infrastructure

✦Monitoring

✦ Choose another lang/framework

✦GO lang

✦ Performance/Memory/Concurrency

✦ Revel

✦Questions

do

vch

ar itw

ee

ke

nd

20

14

Agenda

Page 4: Go Revel Gooo

✦Medical Start-up

✦ Connects Patients and Providers

✦ 5 people

✦ 9 months development (super part time :)

✦ Budget: 235$

✦ SaaS

✦ Public cloud

✦ Single page application (SPA)

do

vch

ar itw

ee

ke

nd

20

14

About

Pro

ject

Page 5: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Tech S

tack

Page 6: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Clo

ud

Page 7: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Monitoring

Page 8: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Node.js you were my favorite toy…

Page 9: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Bra

insto

rmin

g

Page 10: Go Revel Gooo

Go lang

do

vch

ar itw

ee

ke

nd

20

14

«Go, also commonly referred to as golang, is a programming language initially

developed at Google in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson.

It is a statically-typed language with syntax loosely derived from that of C, adding

garbage collection, type safety, some dynamic-typing capabilities, additional built-

in types such as variable-length arrays and key-value maps, and a large standard

library.»

Wikipedia

Page 11: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Perf

orm

ance

You can find benchmarks comparing Go to a bunch

of other languages at the Computer Language

Benchmarks Game site

Page 12: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Mem

ory

Go doesn't have a virtual machine

or interpreter to load up, so it

starts fast and small. Right now,

our production servers are running

at ~400 MB. A few months in,

we've never had a memory leak or

problems related to memory.

Page 13: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Concurrency is a huge part of Go with some high

level constructs that make it a breeze to use. Go has

goroutines for concurrent operations and channels

for communicating between them.

Concurr

ency

Page 14: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Reliability in a language is kind of hard to quantify.

We had a problem only with go-socket.io package.

Relia

bili

ty

Page 15: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Go compiles into a

single, static binary

file so deployment is

simply putting the file

on a server and

starting it up. No

dependencies

required. No runtime

required (you don't

need to install Go on

the server). And it's

small.

Deplo

ym

ent

Page 16: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Tech S

tack

Page 17: Go Revel Gooo

Revel

do

vch

ar itw

ee

ke

nd

20

14

Revel enables you to get going really quickly, it has nice

defaults put in place that enable rapid development, and

high productivity; as advertised on the project page. Is

known for its flexibility in live environment, like code

reloading and such.

What is Revel?

Page 18: Go Revel Gooo

Featu

res

do

vch

ar itw

ee

ke

nd

20

14

✦ Hot Code Reload: Edit, save, and refresh. Revel compiles your code and templates for you, so you don't miss a beat.

✦ Comprehensive: Revel provides routing, parameter parsing, validation, session/flash, templating, caching, job running, a testing framework, and even internationalization.

✦ High Performance: Revel builds on top of the Go HTTP server, which was recently benchmarked to serve three to ten times as many requests as Rails across a variety of loads.

✦ Synchronous: The Go HTTP server runs each request in its own goroutine. Write simple callback-free code without guilt.

✦ Stateless: Revel provides primitives that keep the web tier stateless for predictable scaling. For example, session data is stored in the user cookie, and the cache is backed by a memcached cluster.

✦ Modular: Revel is built around composable middleware called filters, which implement nearly all request-processing functionality. Developers have the freedom to replace the default filters with custom implementations (e.g. a custom router).

Page 19: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Get S

tart

ed

install go

set up your GOPATH and GOROOT

install git and hg

get Revel

Build the Revel command line tool

Page 20: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Get S

tart

ed

Page 21: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Get S

tart

ed

Page 22: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Get S

tart

ed

Page 23: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Get S

tart

ed

Page 24: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Ne

w S

tart

ed

Page 25: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Ne

w S

tart

ed

Page 26: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Ro

ute

r

Page 27: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Co

ntr

olle

r

Page 28: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Se

rvic

e

Page 29: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Mo

de

l

Page 30: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Init

Page 31: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

So

cke

t.io

Page 32: Go Revel Gooo

do

vch

ar itw

ee

ke

nd

20

14

Ha

nd

ler

Page 33: Go Revel Gooo

Conclu

sio

n

do

vch

ar itw

ee

ke

nd

20

14

Page 35: Go Revel Gooo

Questions?

do

vch

ar itw

ee

ke

nd

20

14