how we spread out our service globally by utilizing aws and open source software ( coscup 2013)
DESCRIPTION
Presentation slides at http://coscup.org/2013/zh-tw/TRANSCRIPT
How we spread out our service globallyby utilizing
AWS and open source software
2013/08/04(sun)
COSCUP 2013 Taipei
Takashi SOMEDA
染田 貴志
https://twitter.com/tksmd
Technology Evangelist at Nulab,Inc.
JAWS UG Kyoto Branch leader
About me
https://facebook.com/takashi.someda
Write tech articles about AWS, SCM
https://github.com/tksmd
COSCUP 2013 Taipei
Backlog is a project management tool that 1,800 companies use.
In addition to issue management feature, Backlog provides• File sharing by WebDAV• Git and Subversion repository hosting.
Visit http://backlogtool.com/tw/
920,000 users around the world draw wireframes, network
diagrams, UML, business plans and so on.
Cacoo provides basic functionality as a draw tool and powerful collaborative features like• Simultaneous Editing on same diagram by multiple users• Integration with Google Services like Google Apps, Google Drive
and Google+ Hangouts
COSCUP 2013 Taipei
Examples
COSCUP 2013 Taipei
User Growth of Cacoo
Oct,2010 Oct,2011 Oct,2012 Aug,20130
100,000
200,000
300,000
400,000
500,000
600,000
700,000
800,000
900,000
1,000,000
62,000
200,000
600,000
920,000
AllJapanOverseas
Agenda
COSCUP 2013 Taipei
Service Overview
Real time collaboration
Flexible Infrastructure by AWS
Summary
Service Overview
http://www.flickr.com/photos/ancientsword/2856148716/
Service Components
COSCUP 2013 Taipei
Software Architecture
COSCUP 2013 Taipei
Real time Collaboration
http://www.flickr.com/photos/ian_munroe/3315718996/
Simultaneous Editing
COSCUP 2013 Taipei
BlazeDS client
COSCUP 2013 Taipei
http://livedocs.adobe.com/blazeds/1/blazeds_devguide/lcarch_2.html
BlazeDS server
COSCUP 2013 Taipei
http://livedocs.adobe.com/blazeds/1/blazeds_devguide/lcarch_3.html
Message flow between Cacoo Editors
COSCUP 2013 Taipei
Synchronize MessageDestination
COSCUP 2013 Taipei
Patch added toflex.messaging.cluster.JGroupsClusterflex.messaging.cluster.ClusterNode
Using custom MessageService extendsflex.messaging.services.MessageService( can be configured in messaging-config.xml )
What message exchanged
COSCUP 2013 Taipei
http://www.flickr.com/photos/dps/7161557/
Command
Command Execution Model
COSCUP 2013 Taipei
1.add 1.add1.add
2.moveUndomoveadd
1.add
2.zoomzoom …
Command Interface
COSCUP 2013 Taipei
public class Command implements IExternalizable {
public var sequenceNo:uint = 0;
public var isLocal:Boolean = true;
public function Command() { } public function execute():void { }
public function undo():void { }
public function redo():void { execute(); }:}
/*
sequenceNo keeps the order of commands to be executed in each editors.
isLocal is used to distinguish that the command is created on local editor or it is received from other editor.
*/
# of Saved Commands
COSCUP 2013 Taipei
430,749,991
Partition on different tablespaces
COSCUP 2013 Taipei
create table command_01 ( LIKE command INCLUDING INDEXES INCLUDING DEFAULTS INCLUDING
CONSTRAINTS,
CHECK (diagram_id % 4 = 0)
) INHERITS (command) TABLESPACE tblspc_01;
ALTER TABLE command_01_pkey set tablespace tblspc_01;
Flexible Infrastructure by AWS
http://www.flickr.com/photos/naturegeak/5688437941/
COSCUP 2013 Taipei
Cacoo for Google+ Hangouts
http://launch-hangouts.cacoo.com/lp-zh_tw.html
COSCUP 2013 Taipei
We had only one month
beginning of March 2012Cacoo became a candidate of the 3rd party app
announced on Hangouts API launch
28th Mar. 2012Cacoo for Google+ Hangouts launched
Need to Develop application Do performance testing estimating 10-20 times accesses
than that of cacoo.com at that time Prepare 10+ Servers for performance testing and new
production environment
Simplify server operations
COSCUP 2013 Taipei
@taskdef add_app(zone): ec2 = connect_ec2() ami = ec2.get_image(AMI_ID['app']) r = ami.run(min_count=1, max_count=1, key_name=KEY_NAME, user_data=load_cloudinit_script(), security_groups=['app’],instance_type=INSTANCE_TYPE['app'], block_device_map=create_block_device_map(), placement=zone, instance_initiated_shutdown_behavior='stop')
instance = r.instances[0] wait_for_startup(instance)
execute(”setup_app", hosts=[instance.public_dns_name]) execute(”update_hosts", roles=['all']) execute(”start_app", hosts=[instance.public_dns_name]) execute(“update_nginx_upstream”)
$ fab add_app:zone=us-west-1a
# fabric and boto# http://fabfile.org# http://docs.pythonboto.org/
Tipping Point Example #1
COSCUP 2013 Taipei
Tipping Point Example #2
COSCUP 2013 Taipei
What we did for those growth
COSCUP 2013 Taipei
# For example1
$ ec2addsnap$ ec2addvol –snapshot <snap_id> –s 1024G$ ec2attvol
# For example2
$ ec2run
CloudFront for SWF distribution
COSCUP 2013 Taipei
Loading SWF is 10+ times faster
Summary
http://www.flickr.com/photos/nauright/2662160957/
OSS and AWS enable us
COSCUP 2013 Taipei
To fit the infrastructure according to the growth
To make it available to use all over the world
To make realize the key features quickly
COSCUP 2013 Taipei
Thanks!!
Q and A