SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Kürzlich hochgeladen (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

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