SlideShare a Scribd company logo
1 of 17
Web Performance & Operations Meetup
2 march 2012




Ahmed Omar – omar@nimbuzz.nl
Nico Klasens – nico@nimbuzz.nl

                                      2
What is Nimbuzz?


Nimbuzz is a communication platform which provides
  services
     to make calls (Audio and Video), Internet and normal numbers
     send instant messages
     share files
On any mobile device, desktop computer or Internet
  browser if possible.

It connects with popular instant messaging and social
    networks
     Facebook, Windows Live Messenger (MSN), GoogleTalk, Yahoo!,
     and SIP/VoIP accounts

                                                                    3
Architecture
Guidelines


•   Implement business features in external components,
    not modules inside xmpp router

•   Bundle functionality in small services

•   Implement services as stateless as possible

•   Communicate with users over XMPP

•   Communicate internal data over other connections

This makes it possible to do multiple deployments to
  Nimbuzz every day.

                                                          4
High level architecture




                          5
What is XMPP?
eXtensible Message and Presence Protocol, Formerly known as Jabber

A full XMPP session is one XML document.
   Client opens a <stream> and exchanges xml packets
   At the end closes </stream>.
   This requires long running TCP connections

Packets always have a

    •   From JID (JabberID : user@nimbuzz.com /resource)
    •   To JID (JabberID : user@nimbuzz.com /resource)
Three subtypes (Message, Presence and IQ)

    •   Message (type=normal/chat, subject, body)
    •   Presence (type=unavailable/subscribe/probe, show=chat/away/dnd)
    •   IQ (id, type=get/set/result/error,
        one child element with extension namespace)

                                                                          6
What is XMPP?
Instant Messaging and Presence extension

•   Roster - central point of focus is a list of one's contacts or
    "buddies"

    •   Local Nimbuzz friends
    •   Transports (gateways to external IM systems)
    •   Transport friends
•   Presence information - network availability of particular
    contacts

•   Presence subscription – authorize contacts to receive
    “presence”

•   PrivacyList

                                                                     7
Ejabberd / Erlang


Ejabberd is a XMPP instant messaging server, written in
  Erlang/OTP. Nimbuzz runs a modified version with its
  own extensions.

Erlang is a programming language
   Erlang's runtime system has built-in support for
   concurrency, distribution and fault tolerance.

OTP is a set of Erlang libraries It includes its own
  distributed database, debugging and release
  handling tools.

                                                          8
Erlang/OTP


 - Quick History

 - Why Erlang?

   o   Concurrency
   o   Fault tolerance
   o   Distribution
   o   Hot code swapping/ High Availability
 - Who uses Erlang?
XMPP in action

•   XML stanzas (presence, iq, message)

<presence to=‘user3@server-x’ type=‘subscribe’/>
  <presence> <show> chat </show><status>Just
  talk</status></presence>

    <iq from='user2@server-x/pc' type='get' id='roster_req1'>
        <query xmlns='jabber:iq:roster'/>
    </iq>

    <message to='user3@server-x' from ='user1@server-x/pc'
    type = 'chat‘>
       <body> Hey </body>
    </message>
Ejabberd


Why XMPP?
   o   Real time communication
   o   Extensibility
Why Ejabberd?
   o   Flexible
           easy to setup a cluster
           easy to configure
           easy to extend
           support for external services.
   o   Powerful
   o   Scalable... with caution.
Persistence Bridge


Application introduced to migrate to ejabberd, while still
  using the old database schema of the old xmpp server.

  data requests 1.839.333.853 per day = 21.288 per second

  A REST service written in java

     Apply validation/business rules and enhance data.
     Cache most accessed data in memcached what is stored in
     MySQL
     Cache community gateway rosters in Redis
     Migrate data to more efficient storage backends or database
     tables.

                                                                   12
Cache server Practices

Use a naming convention for your keys: namespace:sequence@identifier
       Sequence has to be configurable

Choose a good balance between memory size, expiry and number of
  servers.
       Memcached is/was single-threaded

Decide on connection, read and data retrieval timeouts.
       Use command pipelining on every connection.
       Use different connections for different namespaced keys.

Only write to MySQL, try to only read from cache server. update cache
  server on write

Use Check And Set (CAS) command for partial updates and back out
  after retries.
                                                                        13
MySQL Practices

Use connection pooling (mysql driver for java creates
  connections slow)

Test connections with a mysql ping not with a statement
  “SELECT 1”

Make every transaction a single sql-statement and turn
 autocommit on by default

Split read and write statements to different connections.

Add requesting host and application as sql comment to
  statement

                                                            14
MySQL Practices


Put statements outside programming code.

Never use "SELECT *" column order might change and hard to check
  which are still used

Never use "INSERT INTO table_name VALUES( ... )“
   Use "INSERT INTO column1, colum2 table_name VALUES( ... )“

Do not rely on database DEFAULT values. Provide all values on INSERT.
  An exception on this is a TIMESTAMP field.

All columns in the database have to be NOT NULL and a DEFAULT value

Use Primary Keys as much as possible.



                                                                        15
Data tweaks

    Users send a lot of junk. Validate and drop. Do not try to correct
    Do not store data which is implied like + of phonenumbers
    Bulk insert, update and delete.
       INSERT INTO table (data) VALUES(?), (?)
       INSERT INTO table (id, data) VALUES(?,?), (?, ?)
       ON DUPLICATE KEY UPDATE data = VALUES(data)
       Do not use REPLACE if you don’t want to DELETE and INSERT.
       Very bad IO performance
    Sort rows based on primary key before update and delete Improves
    InnoDB page locks
    Use compound primary key to store records of one user together on
    disk (user_id, auto_increment_id)
    A mysql index on large table with text columns do not perform. Use
    fulltext search engines to have an index which is not fully in memory.
    Remove foreign keys to reduce storage. Trust the application to update
    and delete

                                                                             16
Wanna play? We hire

More Related Content

What's hot

Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsAppScaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsAppmustafa sarac
 
Zimbra scripting with python
Zimbra scripting with pythonZimbra scripting with python
Zimbra scripting with pythonImam Omar Mochtar
 
Fixing Domino Server Sickness
Fixing Domino Server SicknessFixing Domino Server Sickness
Fixing Domino Server SicknessGabriella Davis
 
Nginx internals
Nginx internalsNginx internals
Nginx internalsliqiang xu
 
Selenium grid workshop london 2016
Selenium grid workshop london 2016Selenium grid workshop london 2016
Selenium grid workshop london 2016Marcus Merrell
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamerSharon James
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamerWannes Rams
 
Building fast,scalable game server in node.js
Building fast,scalable game server in node.jsBuilding fast,scalable game server in node.js
Building fast,scalable game server in node.jsXie ChengChao
 
Introduction to NGINX web server
Introduction to NGINX web serverIntroduction to NGINX web server
Introduction to NGINX web serverMd Waresul Islam
 
Intro to Zenoss by Andrew Kirch
Intro to Zenoss by Andrew KirchIntro to Zenoss by Andrew Kirch
Intro to Zenoss by Andrew Kirchbuildacloud
 
Game server development in node.js
Game server development in node.jsGame server development in node.js
Game server development in node.jsXie ChengChao
 
Real life XMPP Instant Messaging
Real life XMPP Instant MessagingReal life XMPP Instant Messaging
Real life XMPP Instant MessagingMickaël Rémond
 
Game server development in node.js in jsconf eu
Game server development in node.js in jsconf euGame server development in node.js in jsconf eu
Game server development in node.js in jsconf euXie ChengChao
 
Java troubleshooting thread dump
Java troubleshooting thread dumpJava troubleshooting thread dump
Java troubleshooting thread dumpejlp12
 

What's hot (17)

Linux Servers
Linux ServersLinux Servers
Linux Servers
 
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsAppScaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
 
Zimbra scripting with python
Zimbra scripting with pythonZimbra scripting with python
Zimbra scripting with python
 
Fixing Domino Server Sickness
Fixing Domino Server SicknessFixing Domino Server Sickness
Fixing Domino Server Sickness
 
Nginx internals
Nginx internalsNginx internals
Nginx internals
 
Selenium grid workshop london 2016
Selenium grid workshop london 2016Selenium grid workshop london 2016
Selenium grid workshop london 2016
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamer
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamer
 
Building fast,scalable game server in node.js
Building fast,scalable game server in node.jsBuilding fast,scalable game server in node.js
Building fast,scalable game server in node.js
 
14 FILE Server
14 FILE Server14 FILE Server
14 FILE Server
 
Introduction to NGINX web server
Introduction to NGINX web serverIntroduction to NGINX web server
Introduction to NGINX web server
 
Intro to Zenoss by Andrew Kirch
Intro to Zenoss by Andrew KirchIntro to Zenoss by Andrew Kirch
Intro to Zenoss by Andrew Kirch
 
Game server development in node.js
Game server development in node.jsGame server development in node.js
Game server development in node.js
 
Real life XMPP Instant Messaging
Real life XMPP Instant MessagingReal life XMPP Instant Messaging
Real life XMPP Instant Messaging
 
Game server development in node.js in jsconf eu
Game server development in node.js in jsconf euGame server development in node.js in jsconf eu
Game server development in node.js in jsconf eu
 
Java troubleshooting thread dump
Java troubleshooting thread dumpJava troubleshooting thread dump
Java troubleshooting thread dump
 
Domino Adminblast
Domino AdminblastDomino Adminblast
Domino Adminblast
 

Similar to Nimbuzz march2012

Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applicationsDing Li
 
MySQL HA Alternatives 2010
MySQL  HA  Alternatives 2010MySQL  HA  Alternatives 2010
MySQL HA Alternatives 2010Kris Buytaert
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introductionRandy Abernethy
 
SQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerSQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerMichael Rys
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMakerKris Buytaert
 
MySQL Cluster overview + development slides (2014)
MySQL Cluster overview + development slides (2014) MySQL Cluster overview + development slides (2014)
MySQL Cluster overview + development slides (2014) Frazer Clement
 
Database Architecture - Case Study - SMS Gyan.pdf
Database Architecture - Case Study - SMS Gyan.pdfDatabase Architecture - Case Study - SMS Gyan.pdf
Database Architecture - Case Study - SMS Gyan.pdfShyam Anand
 
Django è pronto per l'Enterprise
Django è pronto per l'EnterpriseDjango è pronto per l'Enterprise
Django è pronto per l'EnterprisePyCon Italia
 
Integrating Apple Macs Using Novell Technologies
Integrating Apple Macs Using Novell TechnologiesIntegrating Apple Macs Using Novell Technologies
Integrating Apple Macs Using Novell TechnologiesNovell
 
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...netvis
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUGKeith Hollman
 
Cassandra presentation
Cassandra presentationCassandra presentation
Cassandra presentationSergey Enin
 
Music city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeMusic city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeTimothy Spann
 
MongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOLMongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOLMongoDB
 
Complex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBaseComplex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBasedarach
 

Similar to Nimbuzz march2012 (20)

Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applications
 
MySQL HA Alternatives 2010
MySQL  HA  Alternatives 2010MySQL  HA  Alternatives 2010
MySQL HA Alternatives 2010
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introduction
 
8023.ppt
8023.ppt8023.ppt
8023.ppt
 
SQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerSQL and NoSQL in SQL Server
SQL and NoSQL in SQL Server
 
Ice
IceIce
Ice
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
 
Dev381.Pp
Dev381.PpDev381.Pp
Dev381.Pp
 
MySQL Cluster overview + development slides (2014)
MySQL Cluster overview + development slides (2014) MySQL Cluster overview + development slides (2014)
MySQL Cluster overview + development slides (2014)
 
Cassandra
CassandraCassandra
Cassandra
 
Sql material
Sql materialSql material
Sql material
 
Database Architecture - Case Study - SMS Gyan.pdf
Database Architecture - Case Study - SMS Gyan.pdfDatabase Architecture - Case Study - SMS Gyan.pdf
Database Architecture - Case Study - SMS Gyan.pdf
 
Django è pronto per l'Enterprise
Django è pronto per l'EnterpriseDjango è pronto per l'Enterprise
Django è pronto per l'Enterprise
 
Integrating Apple Macs Using Novell Technologies
Integrating Apple Macs Using Novell TechnologiesIntegrating Apple Macs Using Novell Technologies
Integrating Apple Macs Using Novell Technologies
 
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
 
Cassandra presentation
Cassandra presentationCassandra presentation
Cassandra presentation
 
Music city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeMusic city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lake
 
MongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOLMongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOL
 
Complex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBaseComplex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBase
 

More from nlwebperf

MeasureWorks - eCommerce Live - Designing Time & Conversion
MeasureWorks -  eCommerce Live - Designing Time & ConversionMeasureWorks -  eCommerce Live - Designing Time & Conversion
MeasureWorks - eCommerce Live - Designing Time & Conversionnlwebperf
 
Aaron Peters aug2012
Aaron Peters aug2012Aaron Peters aug2012
Aaron Peters aug2012nlwebperf
 
Jinspired june2012
Jinspired june2012Jinspired june2012
Jinspired june2012nlwebperf
 
Usabilla june2012
Usabilla june2012Usabilla june2012
Usabilla june2012nlwebperf
 
Steve Souders
Steve SoudersSteve Souders
Steve Soudersnlwebperf
 
Aspects of Modern APM Solutions
Aspects of Modern APM SolutionsAspects of Modern APM Solutions
Aspects of Modern APM Solutionsnlwebperf
 
Nimsoft Web performance monitoring
Nimsoft Web performance monitoringNimsoft Web performance monitoring
Nimsoft Web performance monitoringnlwebperf
 
Hyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and JavascriptHyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and Javascriptnlwebperf
 
NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better nlwebperf
 
2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Sitenlwebperf
 

More from nlwebperf (11)

MeasureWorks - eCommerce Live - Designing Time & Conversion
MeasureWorks -  eCommerce Live - Designing Time & ConversionMeasureWorks -  eCommerce Live - Designing Time & Conversion
MeasureWorks - eCommerce Live - Designing Time & Conversion
 
Aaron Peters aug2012
Aaron Peters aug2012Aaron Peters aug2012
Aaron Peters aug2012
 
Fashiolista
FashiolistaFashiolista
Fashiolista
 
Jinspired june2012
Jinspired june2012Jinspired june2012
Jinspired june2012
 
Usabilla june2012
Usabilla june2012Usabilla june2012
Usabilla june2012
 
Steve Souders
Steve SoudersSteve Souders
Steve Souders
 
Aspects of Modern APM Solutions
Aspects of Modern APM SolutionsAspects of Modern APM Solutions
Aspects of Modern APM Solutions
 
Nimsoft Web performance monitoring
Nimsoft Web performance monitoringNimsoft Web performance monitoring
Nimsoft Web performance monitoring
 
Hyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and JavascriptHyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and Javascript
 
NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better
 
2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site
 

Recently uploaded

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Nimbuzz march2012

  • 1.
  • 2. Web Performance & Operations Meetup 2 march 2012 Ahmed Omar – omar@nimbuzz.nl Nico Klasens – nico@nimbuzz.nl 2
  • 3. What is Nimbuzz? Nimbuzz is a communication platform which provides services to make calls (Audio and Video), Internet and normal numbers send instant messages share files On any mobile device, desktop computer or Internet browser if possible. It connects with popular instant messaging and social networks Facebook, Windows Live Messenger (MSN), GoogleTalk, Yahoo!, and SIP/VoIP accounts 3
  • 4. Architecture Guidelines • Implement business features in external components, not modules inside xmpp router • Bundle functionality in small services • Implement services as stateless as possible • Communicate with users over XMPP • Communicate internal data over other connections This makes it possible to do multiple deployments to Nimbuzz every day. 4
  • 6. What is XMPP? eXtensible Message and Presence Protocol, Formerly known as Jabber A full XMPP session is one XML document. Client opens a <stream> and exchanges xml packets At the end closes </stream>. This requires long running TCP connections Packets always have a • From JID (JabberID : user@nimbuzz.com /resource) • To JID (JabberID : user@nimbuzz.com /resource) Three subtypes (Message, Presence and IQ) • Message (type=normal/chat, subject, body) • Presence (type=unavailable/subscribe/probe, show=chat/away/dnd) • IQ (id, type=get/set/result/error, one child element with extension namespace) 6
  • 7. What is XMPP? Instant Messaging and Presence extension • Roster - central point of focus is a list of one's contacts or "buddies" • Local Nimbuzz friends • Transports (gateways to external IM systems) • Transport friends • Presence information - network availability of particular contacts • Presence subscription – authorize contacts to receive “presence” • PrivacyList 7
  • 8. Ejabberd / Erlang Ejabberd is a XMPP instant messaging server, written in Erlang/OTP. Nimbuzz runs a modified version with its own extensions. Erlang is a programming language Erlang's runtime system has built-in support for concurrency, distribution and fault tolerance. OTP is a set of Erlang libraries It includes its own distributed database, debugging and release handling tools. 8
  • 9. Erlang/OTP - Quick History - Why Erlang? o Concurrency o Fault tolerance o Distribution o Hot code swapping/ High Availability - Who uses Erlang?
  • 10. XMPP in action • XML stanzas (presence, iq, message) <presence to=‘user3@server-x’ type=‘subscribe’/> <presence> <show> chat </show><status>Just talk</status></presence> <iq from='user2@server-x/pc' type='get' id='roster_req1'> <query xmlns='jabber:iq:roster'/> </iq> <message to='user3@server-x' from ='user1@server-x/pc' type = 'chat‘> <body> Hey </body> </message>
  • 11. Ejabberd Why XMPP? o Real time communication o Extensibility Why Ejabberd? o Flexible  easy to setup a cluster  easy to configure  easy to extend  support for external services. o Powerful o Scalable... with caution.
  • 12. Persistence Bridge Application introduced to migrate to ejabberd, while still using the old database schema of the old xmpp server. data requests 1.839.333.853 per day = 21.288 per second A REST service written in java Apply validation/business rules and enhance data. Cache most accessed data in memcached what is stored in MySQL Cache community gateway rosters in Redis Migrate data to more efficient storage backends or database tables. 12
  • 13. Cache server Practices Use a naming convention for your keys: namespace:sequence@identifier Sequence has to be configurable Choose a good balance between memory size, expiry and number of servers. Memcached is/was single-threaded Decide on connection, read and data retrieval timeouts. Use command pipelining on every connection. Use different connections for different namespaced keys. Only write to MySQL, try to only read from cache server. update cache server on write Use Check And Set (CAS) command for partial updates and back out after retries. 13
  • 14. MySQL Practices Use connection pooling (mysql driver for java creates connections slow) Test connections with a mysql ping not with a statement “SELECT 1” Make every transaction a single sql-statement and turn autocommit on by default Split read and write statements to different connections. Add requesting host and application as sql comment to statement 14
  • 15. MySQL Practices Put statements outside programming code. Never use "SELECT *" column order might change and hard to check which are still used Never use "INSERT INTO table_name VALUES( ... )“ Use "INSERT INTO column1, colum2 table_name VALUES( ... )“ Do not rely on database DEFAULT values. Provide all values on INSERT. An exception on this is a TIMESTAMP field. All columns in the database have to be NOT NULL and a DEFAULT value Use Primary Keys as much as possible. 15
  • 16. Data tweaks Users send a lot of junk. Validate and drop. Do not try to correct Do not store data which is implied like + of phonenumbers Bulk insert, update and delete. INSERT INTO table (data) VALUES(?), (?) INSERT INTO table (id, data) VALUES(?,?), (?, ?) ON DUPLICATE KEY UPDATE data = VALUES(data) Do not use REPLACE if you don’t want to DELETE and INSERT. Very bad IO performance Sort rows based on primary key before update and delete Improves InnoDB page locks Use compound primary key to store records of one user together on disk (user_id, auto_increment_id) A mysql index on large table with text columns do not perform. Use fulltext search engines to have an index which is not fully in memory. Remove foreign keys to reduce storage. Trust the application to update and delete 16