tuenti tech teams. frontend, backend, systems and more, working together

24
Octubre, 2009

Upload: tuenti

Post on 11-May-2015

3.581 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Octubre, 2009

Page 2: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Tuenti Tech Teams

Frontend, Backend, Systems and more, working together

Page 3: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

WebTuenti Tech Teams - Frontend

Page 4: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

WebTuenti Tech Teams - Frontend

Page 5: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Mobile WebTuenti Tech Teams - Frontend

Page 6: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

FrameworksJavascript

Client-side ProfilingSample perceived load times! This is what matters to the users!

Presentation / UINavigation

Tuenti Tech Teams - Frontend

Stick together!Have fun!

Page 7: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Product teamsDevelopers - JS/PHP - frontend and backendProduct managersDesignersDo

Product developmentProduct designSoftware designEverybody's input matters - it's a team effort! Everybody has to be proud of the result!

Tuenti Tech Teams - Frontend

Page 8: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Make possible the "web scale"

20.000.000.000 page views / month

3.000.000 page views / day in tuenti mobile

2.500.000 uploaded photos / day

72 minutes per user per day

500+ servers

Tuenti Tech Teams - Backend

Page 9: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

DB design ... ... forgetting about the old theoryCache, cache, cacheChange the way you think... ... concurrency, race conditions, failuresHard to test scalabilityEvery bit countsKnow your software & work closely with systems

Tuenti Tech Teams - Backend

Page 10: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Managing our amazing servers:

Tuenti Tech Teams - Systems

Page 11: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Fundamental, the base of everything!!!Network design, systems architectureCope with problems:

Internal network traffic, latencies, isolate trafficLoad balancersElectricity consumptionBGP, OSPF, multiple links with providersKnow how to find problems, know how everything works.Deep linux knowledge, know how to optimize servers for each task.

A big challenge to maintain and monitor hundreds of servers +500!

Tuenti Tech Teams - Systems

Page 12: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

A sample case

Developing the Tuenti IM

Page 13: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Large scale & cost-effective web-based IM serviceOpen source + innovative ideas Do not reinvent the wheel

Delay product launch indefinitely Repeat old mistakes

XMPP is a mature, open, distributed & extensible middle-wareNext generation large-scale real-time web applicationsGoogle Wave!

1M concurrent chatting users...launching to everybody in a couple of days

Get a high quality IM platform: ejabberdExtend + adapt + optimizeHigh performance, clustered & fault-tolerantOpen source + deployed all over the world Implemented in Erlang/OTP

Overview

Page 14: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Designed in Ericsson’s Computer Science LabEricsson ⇒ AXD301 ATM switchNortel Networks (Alteon) ⇒ SSL acceleratorCouchDB, RabbitMQ, Yaws, MochiWeb, Tsung, ejabberd...

Distributed functional paradigmSimple and easy to learn High level of abstractionHigh productivity Built in solid concurrency modelExplicit or transparent distributionAsynchronous message passingSoft real timeRobustnessMulti-core architectures

A glimpse at Erlang/OTP

Page 15: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

The challenge, Handle even more concurrent users per server

Optimize memory & CPU consumptionBe ready for site/service growth

Smart partitioning/load balancing strategiesIntegrate in existing backend

State-less instant messaging serviceData duplications / additional storage reqsAPI integration

Monitoring infrastructureSelf-management when overloadedAnti-abuse policies

Controlled client implementation + not server federationSome cheating is allowed

The backend/systems side (I)

Page 16: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Our strategy,BenchmarkOptimizeMonitorDark launchOptimize

Performance bottlenecksBugs

LaunchProbably largest Jabber/XMPP deployment in Spain

> 100M routed messages first week on-lineContinuous grownAverage 25M daily routed messages

The backend/systems side (and II)

Page 17: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Build a rich UIIncrease user engagementMake them use the chat

Browser issuesRender timeCSS constraints

Technical requirementsXMPP JS libraryCross domain XHRFault tolerant client-side engineMetrics

The frontend side

Page 18: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together
Page 19: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Make the chat visible at the very first page loadShow the buddy listOne click - start chat

Unobtrusive interfaceThe user must be able to keep browsing the site with minimum impactDeal with small screen resolutions and multiple conversationsIntegrate with the rest of our site (i.e. video player)

Building a rich UI

Page 20: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together
Page 21: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Discard IE6SLOW javascriptStyle limitations (position fixed)

Fake the behavior attaching events is expensiveThank god the number of IE6 users is going down

IE7 render performanceSave states of the rendered elementsReduce DOM manipulation

Reuse the buddy list module instead of repainting itFirebug is your best friend

Webkit browsers throwing generic errors from the JS libraryBuild our own error wrapper

Browser issues

Page 22: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Send XMPP requests from the client to the jabber serversPick a JS Jabber library

Audit the codePerformance testsAdapt and extend

Cross domain XHR requestsCan't work with the current iframe approachApproaches

window.name cookie transport

Finallyiframe controller file

Technical requirements (I)

Page 23: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

Fault tolerant request engineUsers poor connectionsMultiple connections from different browsers/computersGracefully recover from server errors

MetricsChat usage patternsDetect possible message delivery problemsTrack active chat user engagementBrowser stats

Technical requirements (II)

Page 24: Tuenti Tech Teams. Frontend, Backend, Systems and more, working together

[email protected]

http://jobs.tuenti.com