SlideShare ist ein Scribd-Unternehmen logo
1 von 95
Downloaden Sie, um offline zu lesen
JEE
                    --



      njthnet#gmail.com

           2010.8
About Me
•   Name@H.E./
•   Jbos@JEE Architect
•   Title@JEvangelist
•   Life@NanJing
•   Hobby@Photography

• http://www.javabloger.com
•
•
•
•
•
Overview
2006

IM      LBS
PC
/Mp3




Wap          IC
Story
2010




       Construction
•



•
    PC



•
•
•
•
•
•
•
•
Mobile Computing


                IM
MSOffice


     Web Page Multimedia


                     Map
 PushMail
                     Info

            etc …
Internet
                                      User

              3G
            GSM WiFi




                        Mobile     Internet
 Mobile                Computing   Service
Computing               Server     Provide
  User
--
•
--
•
    –

        •        VIPS
        •
        •
        •   JS
        •
        •
- pushmail
• Push Mail
-- pushmail
•
    –

        • XML
        •         Push
        •
        • J2EE
        •
– IM
• IM
– IM
• IM
  –

       •   XML     XML   XPATH DOM
       •   http
       •   XMMP
       •   Linux
       •
- Sync
•Sync
– Sync
• Sync
  –

      •   WBXML
      •   XML
      •   SyncML
      •   Sync4J      Merge
      •   SMSC Push
      •
- LBS
• Location Based Services
– LBS
• LBS
  –

      •                    (Geographic Markup Language)

      • WiFi/GSM/CDMA
      • XML         JSON
      •
      • Http
•   Android
•   EC2
•   Java
•   Linux
• Web          Ngixn Apache HA-Proxy
• App Server   GlassFish Jboss Jetty
•              OpenMQ JbossMQ
•              MySQL
•              Memcached OSCache
•              NFS MogileFs Gluster
•              Nagois
•              Jamse
•              HA-Proxy LVS
•              Heartbeat
Java
Java

• Java

• ibatis                DAL
• ImageMagick
• SyncML
•   Xstream              XML
•   XMPP                       XML
•   Apache POI
•   Log4J
JEE

• JEE

•   Servlet
•   XML              /          /
•   JDBC                 CRUD
•   JMS                             /
•   JavaMail
•   JTA
Architecture
Web Portal Client
                                        Android/iPhone/Nokia


   Web                                              Device
   Portal                        XML/XSL/WBXML

HTML/CSS/Ajax
                           GSM
                wan
                                                    Web
                                                 Dispatch Router




                                    Adapter
                                     Adapter
                                      Adapter
                      DB
Web Client

         Web Layer




       Dispatch Layer




        Adapter Layer




      Data Access Layer
Sync
                                                   SP
               Push
    Device              SMSC
                                                  Sync


                                         Synced
             Web


 Load                    JMS
Balance

                   DB                       Scheduled


                         Load Accounts
Sync

          Web Layer




        Business Layer




      Data Access Layer




 Internal Communication Layer
PushMail
         Push    GSM
                Gateway
                                       Yahoo
Device                                 Agent

                                        Gmail                      SP
                                        Agent
                                                                   Mail
                                       Hot Mail                   Server
                                        Agent

         Web


                                                                 JMS


                          FileSystem
 DB
                                                  Task Factory
PushMail

       Web Interface


                                Admin GUI
        Agent Layer                &
                               CRM System

      Notification Layer



     Data Access Layer
                                  File
                                 System
Internal Communication Layer
IM

               Device
                                             Monitor       SP
                               Cache
Asynchronous
                                       Interval              Http
                                                       Long Connection

                    Web



                                       JMS
   Load
  Balance
                          DB
                                                           Trans
                                       Check Status
IM

           Web Layer



         Internal Communication Layer
Cache
                Monitor Factory



        Agent Trans Layer



        Data Access Layer
LBS
                                   LBS
                    GSM                     Latitude
                                  Service
         CellID    Gateway

Device

                                              Agent


                  Web               JMS




                               LBS
                                            Cartographic
            DB               Business
                             Manager
                                             Database
LBS

                  Web Layer



                Internal Communication Layer

Cartographic
                    LBS Business Manager
 Database


                       LBS Agent Layer



               Data Access Layer
“   ”
Scale-out
(Why)


          Load Balancing




Failure over         High Availability
Web App

•   App single 1:0
•   Apache to App 1:2
•   Apache to App 2:2
•   HAProxy to App N:N
•   HAProxy+Cache to App N:N
Web App                 Part1

              App1



     Apache          Session




              App2
If Apache Down!
   Everything Down!!


                       Apache



How to Handle?!
Web App                     Part2

          Work    App1


         Apache

                         Session
    Heartbeat




        Apache    App2

        Standby
If Many Nodes!
                       App1
                        App1
                         App1
                          App1
                            App1
                             App1
                              App1
Session Replication?           App1
                                 App1
                                  App1
      Too bad!                     App1
                                    App1
                                      App1
                                       App1
                                        App1
                                         App1
                                           App1
                                            App1
How to Handle?!                              App
Web App                           Part3
                         Session Stick

          Work       App1

                                     Session Stick
         Apache

                                          App2
    Heartbeat

                          Session Stick

        Apache    App3

        Standby
2 Issues
                            Reasons1                Fast
    Slow

     HTTPS           HTTP        UDP         TCP




            Http       Application Layer   Reasons2
O                                          One Account to One Session,
S                      Transport Layer
            Tcp                            One Session to One Server.
I

           Network     Physical Layer
Web App                                                 Part4

                                                              Session
       Work    TCP Mode         App1

     HAProxy
                    TCP Mode
                                                               Cache
                                       App2
 Heartbeat        TCP Mode




    HAProxy                  App3

     Standby

                          Share Nothing Architecture --RasmusLerdor(PHP   )
                                             ,               .
Web App                                   Part4 II


      Work                     App            Session
              Tcp Mode


    HAProxy         Tcp Mode
                                           Cache     Cache
                                   App2
Heartbeat        Tcp Mode

                                              replication


   HAProxy                  App3

    Standby
American               Canada
             slow




                             China
           very slow




How to Handle?!         very fast
Web App                                Part5

                     CDN
                    Service
                                       dispatch
 dispatch


                                       App
                                              App
                  dispatch           App
   App
            App                            Canada
App
                        App
      China                    App
                     App

                              USA
•   MySQL Master single 1:0
•   MySQL Master to Slave 1:N
•   MySQL Master to Master 1:1
•   MySQL Write And Read 1:N
•   MySQL Sharding N:N
Part1


          App




         Replication
  DB                   DB


Master                 Slave
If MySQL Master break!



                  DB


                 Master




How to Handle?! How to replication?!
Part2


                   App

           R/W                 R/W



Work             Replication                  Standby
       DB                       DB


  Master                             Master

                   Switch
35% Write    65%Read



                        DB
    DB


    write
                        Read

How to Handle?!
Part3
                                App




           MySQL-Proxy



      W                     R


                                             Slave
                                       DB
 DB               Replication
          DB
                                            DB
                                      DB
Master
Write I/O bottleneck
Master to Master Not Load Balance
Database Overload
  JDBC
  Client
   JDBC
   Client
     JDBC
     Client
       JDBC
       Client
          JDBC             DB
        Client
          JDBC
          Client



 How to Handle?!
Part4

                 App


     MySQL JDBC round robin




DB
                 DB            DB

 MySQL Cluster
                         MySQL Cluster
MySQL Cluster No Support long
columns



      MySQL        Support        Tab
                             Long columns
    NDB Engine




 How to Handle?!
Part5
                                 App



                                            user_id=1001
                                 Data       db_cluster=1
                                Router
              SELECT * FROM
              users WHERE
              User_id=1001
     1-2W
     Users                         3w-N                            DB
                                                SELECT * FROM     Search
                                   Users
                                                users WHERE         DB
                                                username=‘tom’

      DB DB                                                      Index DB
                                    DB DB

     DB_Cluster1
MySQL Master To Master             DB_Cluster2
                              MySQL Master To Master
•   HashMap                1:0
•   OScache                1:0
•   OScache Cluster        N:N
•   Memcached              1:0
•   Memcached +Magent      2:N
•   Memcached +repcached   N:N
part1


  App



  App
 Cache




Local Server
How to share in cluster environment


                  App



                  App
                 Cache


                              Everything in local
               Local Server
part2
                                                          Total
                                                          66M
12M                      22M                     32M




 App                     App                     App



  App
OSCache                   App
                        OSCache                   App
                                                OSCache




Server1                 Server2                 Server3



          Replication             Replication
If Many Nodes!
                     App
                       App
                          App
                     App
                   OSCache App
                        App
                     OSCache App
                          App
                        OSCache App
                    Server1 App
                          OSCache App
                      Server1 App
                             OSCache App
                         Server1 App
                               OSCache App
                           Server1 App
                                  OSCache App
                              Server1 App
                                    OSCache App
                                Server1 App
                                       OSCache App
                                   Server1 App
                                         OSCache App
                                     Server1 App
                                            OSCache App
                                        Server1 App
                                              OSCache App
                                          Server1 App
                                                 OSCache App
                                             Server1 App
                                                   OSCache App


How to Handle?!                                Server1 App
                                                      OSCache App
                                                  Server1 App
                                                        OSCache
                                                    Server1 App
                                                           OSCache
                                                       Server1 App
                                                             OSCache
                                                         Server1
                                                            Server1
                                                              ServerN
part3
12M                  22M                      32M



       App                              App
                     App


      Server1                      Server3
                   Server2




                Server2
                                Total
                  Memcached     32M
If Memcached Down!


                   Memcached


How to Handle?!
part4

                          double

                                   Memcached

 App
          Memcached
            Agent

Server1



                               Memcached

                      double
If Memcached Agent break!


                Memcached Agent Single Point Issue
  Memcached     Memcached Restore Issue
    Agent




How to Handle?! How to replication?!
part5


                         Memcached               Memcached
            Group1
                             +                       +
                         Repcached               Repcached

                                     Replication
  App


Server1-3
             Group2
                      Memcached                 Memcached
                          +                         +
                      Repcached                 Repcached

                                  Replication
JMS

•   Jboss JMS        1:0
•   OpenMQ           1:0
•   OpenMQ Cluster   2:N
•   OpenMQ Cluster   N:N
JMS         Part1

                         Topic



                     Consumer


Producer   JMS
                     Queue



                     Consumer
If JMS Server break!


          If JMS Server Overload!
  JMS




                 How to Handle?!
JMS                    Part2
                                            Topic

                      work
                                          Consumer


           Random
Producer
                     JMS
                                           Queue
   Ra




             work                         Consumer
    nd
      om




                    Takeover               Queue

             JMS
                                          Consumer
                                Topic

                               Consumer
•   Local Log4j Single       1:0
•   Local Package Output     1:0
•   Log4j to NOSQL           N:1
•   Log4j Server to Client   N:N
Part1

 App                    App



Server                 Server


Log4j                  Log4j




         Log View
Too Many Servers
            Too Many Logs




              How to Handle?!


Developer
Part2

 App
                           GUI
Server                    Tools

Log4j

          NOSQL

  App


 Server

  Log4j
“I Need Track Business Status
      and Alarm It !”




                How to Handle?!
Customer
Part3

 App                                 GUI
                                    Tools
Server

Log4j     Log4j
         Server
                        NOSQL


 App


Server                              Alarm
                   Log              Server
                   Filter
Log4j
                  Server
Task

• Jboss JMS        1:0
• OpenMQ           1:0
• OpenMQ Cluster   1:N
Task            Part1


       Task



       Server


    worker
                    Accounts
   (Threads)
100W Accounts
   in time have 1W Thread! ?
      We need a God Server ?!




How to Handle?!
Task                        Part2
                      Work                  Standby
3K Jobs                      HeartBeat
                      Task                   Task




                               EJB
                              Server
                              (Cluster)



          1K                                          1K
                             1K

                                    Jobs                   Jobs
               Jobs
In Progress a Job Server Down!



     Jobs          Unfinished
    Server            Job




             How to Handle?!
Task                              Part3
                               Standby
                 Work
3K Jobs                        Task
                 Task




                                    EJB
                                   Server                        Job
                                            Unfinished Job
                                                               Tracker
          1K
                          1K
                                      1K
          Jobs
                        Jobs
                                  Jobs                       Watch
Task         Part4
•   Yahoo   Zookeeper

•

•
Share
•   Linux OS
•   JVM
•   Web Server & Proxy
•   App Server
•   Databases & SQL
•   JMS
•   Distributed Transaction
•   Code & Business Logic
Questions to...
njthnet@gmail.com
www.javabloger.com

Weitere ähnliche Inhalte

Was ist angesagt?

Codestrong 2012 breakout session the role of cloud services in your next ge...
Codestrong 2012 breakout session   the role of cloud services in your next ge...Codestrong 2012 breakout session   the role of cloud services in your next ge...
Codestrong 2012 breakout session the role of cloud services in your next ge...Axway Appcelerator
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DayTechMaster Vietnam
 
A great api is hard to find
A great api is hard to findA great api is hard to find
A great api is hard to findDan Diephouse
 
Mesh-Enabled Web Applications
Mesh-Enabled Web ApplicationsMesh-Enabled Web Applications
Mesh-Enabled Web Applicationsgoodfriday
 
Cloudonomics IP Monetization Conf - Malaysia
Cloudonomics IP Monetization Conf - MalaysiaCloudonomics IP Monetization Conf - Malaysia
Cloudonomics IP Monetization Conf - MalaysiaBash Badawi
 
Web Standards Infographics
Web Standards InfographicsWeb Standards Infographics
Web Standards Infographicsdynamis
 
Hello SharePoint 2007!!!
Hello SharePoint 2007!!!Hello SharePoint 2007!!!
Hello SharePoint 2007!!!Marwan Tarek
 
Marketing Automation Mind Map
Marketing Automation Mind MapMarketing Automation Mind Map
Marketing Automation Mind MapQuarry
 
Marketing Automation Mind Map Quarry
Marketing Automation Mind Map QuarryMarketing Automation Mind Map Quarry
Marketing Automation Mind Map QuarryPeter McAlpine
 
Davivienda - Exceptional Web Experiences
Davivienda - Exceptional Web ExperiencesDavivienda - Exceptional Web Experiences
Davivienda - Exceptional Web ExperiencesDjalma Britto
 
Office 365: Planning and Automating for Hybrid Identity Scenarios in the Clou...
Office 365: Planning and Automating for Hybrid Identity Scenarios in the Clou...Office 365: Planning and Automating for Hybrid Identity Scenarios in the Clou...
Office 365: Planning and Automating for Hybrid Identity Scenarios in the Clou...Microsoft TechNet - Belgium and Luxembourg
 
Best Practices To Fix 5 Common Web Application Problems: Web Performance Moni...
Best Practices To Fix 5 Common Web Application Problems: Web Performance Moni...Best Practices To Fix 5 Common Web Application Problems: Web Performance Moni...
Best Practices To Fix 5 Common Web Application Problems: Web Performance Moni...Compuware APM
 
Accessing Native APIs from Touch
Accessing Native APIs from TouchAccessing Native APIs from Touch
Accessing Native APIs from TouchSencha
 
Sharepoint2010applicationplatform 110203035048-phpapp01
Sharepoint2010applicationplatform 110203035048-phpapp01Sharepoint2010applicationplatform 110203035048-phpapp01
Sharepoint2010applicationplatform 110203035048-phpapp01microsoftasap
 
Share point 2010 application platform
Share point 2010 application platformShare point 2010 application platform
Share point 2010 application platformmicrosoftasap
 

Was ist angesagt? (20)

Codestrong 2012 breakout session the role of cloud services in your next ge...
Codestrong 2012 breakout session   the role of cloud services in your next ge...Codestrong 2012 breakout session   the role of cloud services in your next ge...
Codestrong 2012 breakout session the role of cloud services in your next ge...
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech Day
 
A great api is hard to find
A great api is hard to findA great api is hard to find
A great api is hard to find
 
Mesh-Enabled Web Applications
Mesh-Enabled Web ApplicationsMesh-Enabled Web Applications
Mesh-Enabled Web Applications
 
Sws Han
Sws HanSws Han
Sws Han
 
Cloudonomics IP Monetization Conf - Malaysia
Cloudonomics IP Monetization Conf - MalaysiaCloudonomics IP Monetization Conf - Malaysia
Cloudonomics IP Monetization Conf - Malaysia
 
Intro to Force.com Webinar presentation
Intro to Force.com Webinar presentationIntro to Force.com Webinar presentation
Intro to Force.com Webinar presentation
 
Web Standards Infographics
Web Standards InfographicsWeb Standards Infographics
Web Standards Infographics
 
Web Sphere Portal
Web Sphere PortalWeb Sphere Portal
Web Sphere Portal
 
Hello SharePoint 2007!!!
Hello SharePoint 2007!!!Hello SharePoint 2007!!!
Hello SharePoint 2007!!!
 
Marketing Automation Mind Map
Marketing Automation Mind MapMarketing Automation Mind Map
Marketing Automation Mind Map
 
Ideas for addictive series 40 web apps
Ideas for addictive series 40 web appsIdeas for addictive series 40 web apps
Ideas for addictive series 40 web apps
 
Marketing Automation Mind Map Quarry
Marketing Automation Mind Map QuarryMarketing Automation Mind Map Quarry
Marketing Automation Mind Map Quarry
 
Davivienda - Exceptional Web Experiences
Davivienda - Exceptional Web ExperiencesDavivienda - Exceptional Web Experiences
Davivienda - Exceptional Web Experiences
 
Office 365: Planning and Automating for Hybrid Identity Scenarios in the Clou...
Office 365: Planning and Automating for Hybrid Identity Scenarios in the Clou...Office 365: Planning and Automating for Hybrid Identity Scenarios in the Clou...
Office 365: Planning and Automating for Hybrid Identity Scenarios in the Clou...
 
Best Practices To Fix 5 Common Web Application Problems: Web Performance Moni...
Best Practices To Fix 5 Common Web Application Problems: Web Performance Moni...Best Practices To Fix 5 Common Web Application Problems: Web Performance Moni...
Best Practices To Fix 5 Common Web Application Problems: Web Performance Moni...
 
Accessing Native APIs from Touch
Accessing Native APIs from TouchAccessing Native APIs from Touch
Accessing Native APIs from Touch
 
Sharepoint2010applicationplatform 110203035048-phpapp01
Sharepoint2010applicationplatform 110203035048-phpapp01Sharepoint2010applicationplatform 110203035048-phpapp01
Sharepoint2010applicationplatform 110203035048-phpapp01
 
Share point 2010 application platform
Share point 2010 application platformShare point 2010 application platform
Share point 2010 application platform
 
Easyling at atc London
Easyling at atc LondonEasyling at atc London
Easyling at atc London
 

Andere mochten auch

Life Behind The Curve - MKGN #5
Life Behind The Curve - MKGN #5Life Behind The Curve - MKGN #5
Life Behind The Curve - MKGN #5meteoracle
 
Presentation pomodoro i phone(2)
Presentation pomodoro i phone(2)Presentation pomodoro i phone(2)
Presentation pomodoro i phone(2)Michael Sandén
 
El socialisme a l’amèrica llatina
El socialisme a l’amèrica llatinaEl socialisme a l’amèrica llatina
El socialisme a l’amèrica llatinavilarojaime
 
Bachillerato general oficial
Bachillerato general oficialBachillerato general oficial
Bachillerato general oficialviky1998
 
Thoughts on Digital Design 2013
Thoughts on Digital Design 2013Thoughts on Digital Design 2013
Thoughts on Digital Design 2013Frantic
 
Developing Your Social Media Business Strategy
Developing Your Social Media Business StrategyDeveloping Your Social Media Business Strategy
Developing Your Social Media Business StrategySt. Thomas University (CA)
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 

Andere mochten auch (12)

Life Behind The Curve - MKGN #5
Life Behind The Curve - MKGN #5Life Behind The Curve - MKGN #5
Life Behind The Curve - MKGN #5
 
Presentation pomodoro i phone(2)
Presentation pomodoro i phone(2)Presentation pomodoro i phone(2)
Presentation pomodoro i phone(2)
 
El socialisme a l’amèrica llatina
El socialisme a l’amèrica llatinaEl socialisme a l’amèrica llatina
El socialisme a l’amèrica llatina
 
Hide and seek
Hide and seekHide and seek
Hide and seek
 
.NET Drop 4
.NET Drop 4.NET Drop 4
.NET Drop 4
 
Kira awards
Kira awardsKira awards
Kira awards
 
Bachillerato general oficial
Bachillerato general oficialBachillerato general oficial
Bachillerato general oficial
 
Unit 6 plantas
Unit 6 plantasUnit 6 plantas
Unit 6 plantas
 
Thoughts on Digital Design 2013
Thoughts on Digital Design 2013Thoughts on Digital Design 2013
Thoughts on Digital Design 2013
 
Developing Your Social Media Business Strategy
Developing Your Social Media Business StrategyDeveloping Your Social Media Business Strategy
Developing Your Social Media Business Strategy
 
Venus
VenusVenus
Venus
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Ähnlich wie Jee技术在移动互联网中的应用

Google App Engine At A Glance
Google App Engine At A GlanceGoogle App Engine At A Glance
Google App Engine At A GlanceStefan Christoph
 
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)Shreeraj Shah
 
Building Cloud-Based Cross-Platform Mobile Web Apps
Building Cloud-Based Cross-Platform Mobile Web AppsBuilding Cloud-Based Cross-Platform Mobile Web Apps
Building Cloud-Based Cross-Platform Mobile Web AppsJames Pearce
 
Cross platform mobile web apps
Cross platform mobile web appsCross platform mobile web apps
Cross platform mobile web appsJames Pearce
 
An Intro to Mobile HTML5
An Intro to Mobile HTML5An Intro to Mobile HTML5
An Intro to Mobile HTML5James Pearce
 
Find me if you can – smart fuzzing and discovery! shreeraj shah
Find me if you can – smart fuzzing and discovery!   shreeraj shahFind me if you can – smart fuzzing and discovery!   shreeraj shah
Find me if you can – smart fuzzing and discovery! shreeraj shahowaspindia
 
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERYFIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERYShreeraj Shah
 
Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007ClubHack
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsJames Pearce
 
Shreeraj-Hacking_Web_2
Shreeraj-Hacking_Web_2Shreeraj-Hacking_Web_2
Shreeraj-Hacking_Web_2guest66dc5f
 
Complex End-to-End Testing
Complex End-to-End TestingComplex End-to-End Testing
Complex End-to-End TestingErika Barron
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns FrameworksMike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns Frameworksukdpe
 
Building Rich Mobile Apps with HTML5, CSS3 and JavaScript
Building Rich Mobile Apps with HTML5, CSS3 and JavaScriptBuilding Rich Mobile Apps with HTML5, CSS3 and JavaScript
Building Rich Mobile Apps with HTML5, CSS3 and JavaScriptSencha
 
A Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 RevolutionA Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 RevolutionJames Pearce
 
An Introduction to Sencha Touch
An Introduction to Sencha TouchAn Introduction to Sencha Touch
An Introduction to Sencha TouchJames Pearce
 
Building Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web AppsBuilding Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web AppsJames Pearce
 
Polysource It Profile
Polysource It ProfilePolysource It Profile
Polysource It Profileelenarys
 

Ähnlich wie Jee技术在移动互联网中的应用 (20)

Google App Engine At A Glance
Google App Engine At A GlanceGoogle App Engine At A Glance
Google App Engine At A Glance
 
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
Next Generation Web Attacks – HTML 5, DOM(L3) and XHR(L2)
 
Internet GIS
Internet GISInternet GIS
Internet GIS
 
Building Cloud-Based Cross-Platform Mobile Web Apps
Building Cloud-Based Cross-Platform Mobile Web AppsBuilding Cloud-Based Cross-Platform Mobile Web Apps
Building Cloud-Based Cross-Platform Mobile Web Apps
 
Cross platform mobile web apps
Cross platform mobile web appsCross platform mobile web apps
Cross platform mobile web apps
 
Building Scalable and Robust Solutions with Service Bus in Cloud and Server
Building Scalable and Robust Solutions with Service Bus in Cloud and ServerBuilding Scalable and Robust Solutions with Service Bus in Cloud and Server
Building Scalable and Robust Solutions with Service Bus in Cloud and Server
 
Exchange 2013 ABC's: Architecture, Best Practices and Client Access
Exchange 2013 ABC's: Architecture, Best Practices and Client AccessExchange 2013 ABC's: Architecture, Best Practices and Client Access
Exchange 2013 ABC's: Architecture, Best Practices and Client Access
 
An Intro to Mobile HTML5
An Intro to Mobile HTML5An Intro to Mobile HTML5
An Intro to Mobile HTML5
 
Find me if you can – smart fuzzing and discovery! shreeraj shah
Find me if you can – smart fuzzing and discovery!   shreeraj shahFind me if you can – smart fuzzing and discovery!   shreeraj shah
Find me if you can – smart fuzzing and discovery! shreeraj shah
 
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERYFIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
FIND ME IF YOU CAN – SMART FUZZING AND DISCOVERY
 
Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007Shreeraj - Hacking Web 2 0 - ClubHack2007
Shreeraj - Hacking Web 2 0 - ClubHack2007
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
 
Shreeraj-Hacking_Web_2
Shreeraj-Hacking_Web_2Shreeraj-Hacking_Web_2
Shreeraj-Hacking_Web_2
 
Complex End-to-End Testing
Complex End-to-End TestingComplex End-to-End Testing
Complex End-to-End Testing
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns FrameworksMike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
 
Building Rich Mobile Apps with HTML5, CSS3 and JavaScript
Building Rich Mobile Apps with HTML5, CSS3 and JavaScriptBuilding Rich Mobile Apps with HTML5, CSS3 and JavaScript
Building Rich Mobile Apps with HTML5, CSS3 and JavaScript
 
A Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 RevolutionA Snapshot of the Mobile HTML5 Revolution
A Snapshot of the Mobile HTML5 Revolution
 
An Introduction to Sencha Touch
An Introduction to Sencha TouchAn Introduction to Sencha Touch
An Introduction to Sencha Touch
 
Building Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web AppsBuilding Cross Platform Mobile Web Apps
Building Cross Platform Mobile Web Apps
 
Polysource It Profile
Polysource It ProfilePolysource It Profile
Polysource It Profile
 

Jee技术在移动互联网中的应用

  • 1. JEE -- njthnet#gmail.com 2010.8
  • 2. About Me • Name@H.E./ • Jbos@JEE Architect • Title@JEvangelist • Life@NanJing • Hobby@Photography • http://www.javabloger.com
  • 5. 2006 IM LBS
  • 6. PC
  • 7. /Mp3 Wap IC
  • 9. 2010 Construction
  • 10. • • PC •
  • 12. Mobile Computing IM MSOffice Web Page Multimedia Map PushMail Info etc …
  • 13. Internet User 3G GSM WiFi Mobile Internet Mobile Computing Service Computing Server Provide User
  • 15. -- • – • VIPS • • • JS • •
  • 17. -- pushmail • – • XML • Push • • J2EE •
  • 19. – IM • IM – • XML XML XPATH DOM • http • XMMP • Linux •
  • 21. – Sync • Sync – • WBXML • XML • SyncML • Sync4J Merge • SMSC Push •
  • 22. - LBS • Location Based Services
  • 23. – LBS • LBS – • (Geographic Markup Language) • WiFi/GSM/CDMA • XML JSON • • Http
  • 24. Android • EC2 • Java • Linux
  • 25.
  • 26. • Web Ngixn Apache HA-Proxy • App Server GlassFish Jboss Jetty • OpenMQ JbossMQ • MySQL • Memcached OSCache • NFS MogileFs Gluster • Nagois • Jamse • HA-Proxy LVS • Heartbeat
  • 27. Java
  • 28. Java • Java • ibatis DAL • ImageMagick • SyncML • Xstream XML • XMPP XML • Apache POI • Log4J
  • 29. JEE • JEE • Servlet • XML / / • JDBC CRUD • JMS / • JavaMail • JTA
  • 31. Web Portal Client Android/iPhone/Nokia Web Device Portal XML/XSL/WBXML HTML/CSS/Ajax GSM wan Web Dispatch Router Adapter Adapter Adapter DB
  • 32. Web Client Web Layer Dispatch Layer Adapter Layer Data Access Layer
  • 33. Sync SP Push Device SMSC Sync Synced Web Load JMS Balance DB Scheduled Load Accounts
  • 34. Sync Web Layer Business Layer Data Access Layer Internal Communication Layer
  • 35. PushMail Push GSM Gateway Yahoo Device Agent Gmail SP Agent Mail Hot Mail Server Agent Web JMS FileSystem DB Task Factory
  • 36. PushMail Web Interface Admin GUI Agent Layer & CRM System Notification Layer Data Access Layer File System Internal Communication Layer
  • 37. IM Device Monitor SP Cache Asynchronous Interval Http Long Connection Web JMS Load Balance DB Trans Check Status
  • 38. IM Web Layer Internal Communication Layer Cache Monitor Factory Agent Trans Layer Data Access Layer
  • 39. LBS LBS GSM Latitude Service CellID Gateway Device Agent Web JMS LBS Cartographic DB Business Manager Database
  • 40. LBS Web Layer Internal Communication Layer Cartographic LBS Business Manager Database LBS Agent Layer Data Access Layer
  • 41.
  • 43. (Why) Load Balancing Failure over High Availability
  • 44. Web App • App single 1:0 • Apache to App 1:2 • Apache to App 2:2 • HAProxy to App N:N • HAProxy+Cache to App N:N
  • 45. Web App Part1 App1 Apache Session App2
  • 46. If Apache Down! Everything Down!! Apache How to Handle?!
  • 47. Web App Part2 Work App1 Apache Session Heartbeat Apache App2 Standby
  • 48. If Many Nodes! App1 App1 App1 App1 App1 App1 App1 Session Replication? App1 App1 App1 Too bad! App1 App1 App1 App1 App1 App1 App1 App1 How to Handle?! App
  • 49. Web App Part3 Session Stick Work App1 Session Stick Apache App2 Heartbeat Session Stick Apache App3 Standby
  • 50. 2 Issues Reasons1 Fast Slow HTTPS HTTP UDP TCP Http Application Layer Reasons2 O One Account to One Session, S Transport Layer Tcp One Session to One Server. I Network Physical Layer
  • 51. Web App Part4 Session Work TCP Mode App1 HAProxy TCP Mode Cache App2 Heartbeat TCP Mode HAProxy App3 Standby Share Nothing Architecture --RasmusLerdor(PHP ) , .
  • 52. Web App Part4 II Work App Session Tcp Mode HAProxy Tcp Mode Cache Cache App2 Heartbeat Tcp Mode replication HAProxy App3 Standby
  • 53. American Canada slow China very slow How to Handle?! very fast
  • 54. Web App Part5 CDN Service dispatch dispatch App App dispatch App App App Canada App App China App App USA
  • 55. MySQL Master single 1:0 • MySQL Master to Slave 1:N • MySQL Master to Master 1:1 • MySQL Write And Read 1:N • MySQL Sharding N:N
  • 56. Part1 App Replication DB DB Master Slave
  • 57. If MySQL Master break! DB Master How to Handle?! How to replication?!
  • 58. Part2 App R/W R/W Work Replication Standby DB DB Master Master Switch
  • 59. 35% Write 65%Read DB DB write Read How to Handle?!
  • 60. Part3 App MySQL-Proxy W R Slave DB DB Replication DB DB DB Master
  • 61. Write I/O bottleneck Master to Master Not Load Balance Database Overload JDBC Client JDBC Client JDBC Client JDBC Client JDBC DB Client JDBC Client How to Handle?!
  • 62. Part4 App MySQL JDBC round robin DB DB DB MySQL Cluster MySQL Cluster
  • 63. MySQL Cluster No Support long columns MySQL Support Tab Long columns NDB Engine How to Handle?!
  • 64. Part5 App user_id=1001 Data db_cluster=1 Router SELECT * FROM users WHERE User_id=1001 1-2W Users 3w-N DB SELECT * FROM Search Users users WHERE DB username=‘tom’ DB DB Index DB DB DB DB_Cluster1 MySQL Master To Master DB_Cluster2 MySQL Master To Master
  • 65. HashMap 1:0 • OScache 1:0 • OScache Cluster N:N • Memcached 1:0 • Memcached +Magent 2:N • Memcached +repcached N:N
  • 66. part1 App App Cache Local Server
  • 67. How to share in cluster environment App App Cache Everything in local Local Server
  • 68. part2 Total 66M 12M 22M 32M App App App App OSCache App OSCache App OSCache Server1 Server2 Server3 Replication Replication
  • 69. If Many Nodes! App App App App OSCache App App OSCache App App OSCache App Server1 App OSCache App Server1 App OSCache App Server1 App OSCache App Server1 App OSCache App Server1 App OSCache App Server1 App OSCache App Server1 App OSCache App Server1 App OSCache App Server1 App OSCache App Server1 App OSCache App Server1 App OSCache App How to Handle?! Server1 App OSCache App Server1 App OSCache Server1 App OSCache Server1 App OSCache Server1 Server1 ServerN
  • 70. part3 12M 22M 32M App App App Server1 Server3 Server2 Server2 Total Memcached 32M
  • 71. If Memcached Down! Memcached How to Handle?!
  • 72. part4 double Memcached App Memcached Agent Server1 Memcached double
  • 73. If Memcached Agent break! Memcached Agent Single Point Issue Memcached Memcached Restore Issue Agent How to Handle?! How to replication?!
  • 74. part5 Memcached Memcached Group1 + + Repcached Repcached Replication App Server1-3 Group2 Memcached Memcached + + Repcached Repcached Replication
  • 75. JMS • Jboss JMS 1:0 • OpenMQ 1:0 • OpenMQ Cluster 2:N • OpenMQ Cluster N:N
  • 76. JMS Part1 Topic Consumer Producer JMS Queue Consumer
  • 77. If JMS Server break! If JMS Server Overload! JMS How to Handle?!
  • 78. JMS Part2 Topic work Consumer Random Producer JMS Queue Ra work Consumer nd om Takeover Queue JMS Consumer Topic Consumer
  • 79. Local Log4j Single 1:0 • Local Package Output 1:0 • Log4j to NOSQL N:1 • Log4j Server to Client N:N
  • 80. Part1 App App Server Server Log4j Log4j Log View
  • 81. Too Many Servers Too Many Logs How to Handle?! Developer
  • 82. Part2 App GUI Server Tools Log4j NOSQL App Server Log4j
  • 83. “I Need Track Business Status and Alarm It !” How to Handle?! Customer
  • 84. Part3 App GUI Tools Server Log4j Log4j Server NOSQL App Server Alarm Log Server Filter Log4j Server
  • 85. Task • Jboss JMS 1:0 • OpenMQ 1:0 • OpenMQ Cluster 1:N
  • 86. Task Part1 Task Server worker Accounts (Threads)
  • 87. 100W Accounts in time have 1W Thread! ? We need a God Server ?! How to Handle?!
  • 88. Task Part2 Work Standby 3K Jobs HeartBeat Task Task EJB Server (Cluster) 1K 1K 1K Jobs Jobs Jobs
  • 89. In Progress a Job Server Down! Jobs Unfinished Server Job How to Handle?!
  • 90. Task Part3 Standby Work 3K Jobs Task Task EJB Server Job Unfinished Job Tracker 1K 1K 1K Jobs Jobs Jobs Watch
  • 91. Task Part4 • Yahoo Zookeeper • •
  • 92. Share
  • 93. Linux OS • JVM • Web Server & Proxy • App Server • Databases & SQL • JMS • Distributed Transaction • Code & Business Logic