now.in 背後的技術 - python軍火庫

47
Broadcast and listen to the world 1

Upload: -

Post on 15-May-2015

2.337 views

Category:

Technology


0 download

TRANSCRIPT

1

Broadcast and listen to the world

2

3

4

5

Website Application

Audio Streaming

Servers

System Administration

Desktop Application

Web-based Chat-room

System

iPhone & Android

Application

6

Enterprise-class

Total solution

7

2007 2008 2009 2010 2011 now

Have the idea

Design system & seek technologies

Start to implement

Goes online

8

2.5+ Man-Years After-school

time

9

10

Almost zerocommercial

software

11

Use C++ at very first

12

Is performance that important?

Develop Compile

ExecuteDebug

13

Fall in love with Python

14

Development cycle of Python

Develop Compile

ExecuteDebug

15

Web Application Solutions

16

• Light weight• Easy to learn• Easy to integrate• Kind of dirty• Fun• Suitable for:– Web-based API services– Light-weight web application

17

Flask -Backend Dashboard

18

Flask -Chat-room

19

Flask -Web-based API

Web-basedAPI Service

Query

20

Dependencies of Flask

21

22

• Middle weight• Well documented• Well tested• Easy to learn• Suitable for:– Enterprise-class web application– Middle size web application

23

Dependencies of Pyramid

24

• Heavy weight• Difficult to learn• Integrated with:

– Pylons– SQLAlchemy– Genshi– Others

• Can’t work with debugger• Too many dependencies• Suitable for:

– Enterprise-class web application

25

TurboGears2 -Front-end Website

26

Dependencies of TG2

27

You think this is heavy weight?

28

How about this?

29

Dependencies of Plone

30

More dependencies graph:

http://goo.gl/kBCdW

31

Celery

• Distributed task queue• Easy to use• Flexible• Multiple back-ends• Suitable for:– Time consuming tasks– Bach operation– Sending mails

32

Internet application solution

Twisted

33

Twisted

• Event-driven network library• Plenty resources• Portable• Build-in protocol implements

– HTTP– SMTP– DNS– Others

• Suitable for:– Internet servers– Asynchronous web service

34

Audio Streaming Cloud

Listener

Audio Streaming Cloud

DJ

35

Ajax/Comet server

Web-appUser

HTTP Request Comet server

HTTP push

Comet API

36

Desktop application solution

37

• Python port of wxWidget• Native controls• wxWindow licensed (LGPL-like)• Cross platform• Suitable for:– Desktop application

38

Mr.DJ

39

System administration solutions

Fabric

40

• WSGI container server• Mainly integrated with Nginx• Flexible configuration• High performance• Support modes:– Preforking– Threaded– Asynchornous/evented

41

• Tool for running daemons• XML-RPC API• Say good bye to Unix init scripts

Supervisor

Server process A

Server process B

Server process C

XML-RPC

Console

Control

42

Fabric

• Tool for deploying• Send command to lots of host at once

Fabric

Host A

Host B

Host C

hg pull –urestart web

43

Easter egg of player

• Click space of player• Press

↑↑↓↓←←→→ABThen 1, 2, 3 and 0

44

Login message

45

Name of hostsnerv.now.in magi.now.in

homura.now.in madoka.now.in

46

I Will collect all of them someday

47

Any question?