SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
An Introduction to
Space Based Architecture




      Amin Abbaspour

MAGFA IT Development Center
       twitter.com/abbaspour
Agenda

                    Title                 Time
Scalability, why and hows (15)             10
Space Based Architecture (6)                5
Java Spaces (4)                             5
GigaSpaces (5)                             10
Migrating Spring Apps to GigaSpaces (6)     5
Case Study (2)                             10
Conclusion (2)                              1
Q/A                                         -
                  40 slides               45 min
Innovation Comes From The Need

The applications workload is increasing each day. This is
  inevitable.


We expect fast and reliable softwares even with increasing
 workload.


Speed and reliability means the death or life of a business.
But why so much Workload?

Todays softwares are not limited to operators and limited
  society. They directly interact with millions of people and
  thousand of other softwares.


    Large scale community sites, like facebook, hi5, twitter.
●


    Prepaid Telecoms
●


    Banking/XTP
●


    Online Gaming
●


    Online Fraud/Risk Management
●
Need For Speed

A brokerage can lose up to $4 million per millisecond of
  latency.
                                              - The Tabb Group


An additional 500 ms latency resulted in -20% traffic.
                                                         - Google


An additional 100 ms in latency resulted in -1% sales.
                                                     - Amazon
Cost of Downtime

According to a 2004 Forrester survey of 235 companies the
  hourly cost of downtime was:


         Percent of Companies       Hourly Cost

                33%                 $10K-100K

                25%                 $100K-500K

                13%                 $500K- 1M

                 4%                   >$1M

                25%                 Didn't Know
Unpredictable work load

    How do you design and build applications that cost-
●

      effectively scale in such conditions?
    Without compromising reliability, performance and time-
●

      to-market?
Scalability
The solutions is to have scalable softwares. With scalability
  we create speed and reliability.
           Vertical scalability; More powerful machines leads to
       –
             faster software.
           Horizontal scalability; More boxes leads to faster and
       –
             more reliable software.
           Linear scalability; The overall throughput = (number of
       –
             processing units) * (throughput per unit).
           Dynamic scalability; Scale on demand (usually using
       –
             some sort of provisioning and monitoring
             capabilities)
We usually refer to horizontal scalability, since its more
 applicable and cost effective. Budget is a great excuse.
Amdal's Law

 if, for example, your program has only 10% of a given function
synchronized, then:
if the throughput of that function at a single CPU is 100
messages per second,
to increase performance by a factor of 10 (to 1,000 msg/sec)
we will need to increase our CPU resources by a factor of 100


This is 10 times more then what would have been required if
the application wouldn't have any synchronization blocks in its
code
Scalability Wall

Non-Scalable applications are expensive and risky.
At some point the application will hit a wall:
    Application crashes
●


    Re-architecting the application every few months/years
●




                                             Server cost 20,000
                                             Server Throughput:
                                             1,000 tx/sec
                                             Contention: 15%
Amdal's Law Consequences
To have scalable softwares, we should eliminate
  synchronized blocks. This means eliminating the
  bottlenecks and contentions.
Do We build Scalable Software?
Order Management Example
Need Availability? Things Get Worse
Tier Based Car-wash

                          Total CPH is the
                      ●

                          minimal CPH.
                          Failure in each
                      ●

                          warehouse makes
                          the whole
                          business fail.
                          To increase
                      ●

                          performance need
                          to budget all three
                          warehouses.
                          Personnel with
                      ●

                          specialized
                          capabilities.
All in One Car-wash

                   To increase CPH,
               ●

                   simple add new
                   warehouses.
                   Better resources
               ●

                   utilization.
                   Each warehouse is
               ●

                   independent.
                   Less steps
               ●
Scaling Made Simple – Process Unit Design
Space-Based Architecture

    Based on Object Space Computational Model.
●


    Processing Unit
●


            Self sufficient unit of scale
        –

            Combination of Data, Processing and Messaging
        –

    Principles of Partitioning
●


    Content Based Routing
●


    Interaction Model Abstractions
●
Inside A Processing Unit
Closer Look at PU
Parallel Pus – Bring Linear Scalability
The Ideal Scenario - “Write Once Scale Anywhere”


                               Scale-out to get more
                           ●

                               processing power
                               when volume
                               increases.
                               Through caching
                           ●


                               Parallelizing of TX
                           ●


                               Low commodity
                           ●

                               resources
                               Better Utilization
                           ●
Space Based Architecture – Theory Basics

    Object Spaces is a paradigm for development of
●

    distributed computing applications.
    Spaces can be used to achieve scalability through parallel
●

    processing.
    Objects, when deposited in an Object Space are passive,
●

    i.e., their methods cannot be invoked while the objects are
    in the Object Space.
    This paradigm inherently provides mutual exclusion.
●


    Linda coordination language was developed at Yale.
●


    Object Spaces is usually called Tuple Spaces since it
●

    contains of tuples unrelated to each others.
SBA Paradigm in Java;
            Sun Didn't (Re)invent The Wheel

    Linda a language and platform on tuple-spaces.
●


    Space model was recommending a plug-n-play
●

      infrastructure.
            Jini was there
        –

    So JavaSpaces was invented, based on TupleSpaces
●

      paradigm and on top of Jini platform.
    By the way Java is not the only language to take the
●

      concept. Tuple-spaces are ported to many other
      languages such as Python, Ruby, Scala, C, .NET, ... .
Tuple/Java Spaces Basics Operations
JavaSpaces Standard API

// An Entry class
public class SpaceEntry implements Entry {
   public Integer count = 0;
   public String toString() {
      return quot;Count: quot; + count;
    }
}


public class Server {
  public static void main(String[] args) throws Exception {
    SpaceEntry entry = new SpaceEntry();
    JavaSpace space = (JavaSpace) space();

    // Register and write the Entry into the Space
    space.write(entry, null, Lease.FOREVER);

    // retrieve the Entry and check its state.
    SpaceEntry e = space.read(new SpaceEntry(), null, Long.MAX_VALUE);
}
Java Spaces Implementations

    Sun RI (now River Project)
●


    Orbitz (running orbitz.com)
●


    Blitz (open source)
●


    Openwings (?)
●


    Semispaces
●


    TSpaces (IBM's implementation)
●


    GigaSpaces
●
About GigaSpaces Technologies
    Provides Application Platform product (XAP) for
●

      applications characterized by:
            High volume transaction processing and
        –

            Very Low latency requirements
        –

            Large Data Volumes
        –

    Scaled-Out Application Server – GigaSpaces XAP
●


            In-Memory Data Grid
        –

            Service Grid
        –

            Java, .NET and C++
        –

    Customer Base
●


            Financial Services, Retail, Banking, Gaming
        –
XAP – eXtreme Application Platform

XAP – pronounced zap - a new class of application server
  focusing cloud computing and scaling out architectures.


Used for two main domain:
    Data intensive/EDG (write-behind cache)
●


    Compute intensive
●
GigaSpaces Architecture – Sub Systems
GigaSpaces Architecture - Runtime
GigaSpaces Architecture - SLA
How Can GigaSpaces Help Me
    To much data and DB is slow. My application has too many
●

    interactions with database.
    Application does not scale well. We have (strong) hardware but
●

    throughput does not increase anymore (symptom of tier based
    architecture)
    We develop XTP platform. e.g. billing, banking, finance.
●



    Not pleased with my HTTP session clustering solution.
●



    Want an scalable SOA/ESB platform.
●



    Need in memory indexing, searching.
●



    Want to deploy my application in cloud (pay-as-you-go)
●



    Want CBR over my MQ.
●



    We don't use Java. Want to stay in C++ or .NET.
●



    Want SLA in my application/data-partition.
●
Expectations From Application Server

    Data access
●


    Messaging / Event Processing
●


    Remoting
●


    TX management
●


    Web
●
Migration to GigaSpaces
    Messaging / Event processing
●


              Replace MDBs with GigaSpaces event listeners
          –

    Remoting
●


              Replace SLSBs with GigaSpaces SVF
          –
                (Remoting/Executors)
    Data access
●


              Use GigaSpaces 2nd cache for Hibernate
          –

              Convert your DAOs to use GigaSpaces, use mirror to persist
          –

    TX management
●


              Use Spring…
          –

    Web
●


              Use GigaSpaces web processing unit
          –

              Use GS HTTP session replication
          –
Migration in Practice

Converted       Code change           Config Effort
  Layer                               change   (3 is
                                               biggest)

Messaging       Minor to none           Yes       1


                                                  1
Remoting              No                Yes


                                        Yes      2-3
  Data      ORM 2nd level cache: No
 Access            DAO: Yes
                                                  1
  Http                No                No
 Session
XAP and Integration to Other (JEE) Platforms

    Spring
●


    ORM
●


    Lucene/Compass
●


    Mule ESB
●


    JGroovy, JRuby, and hopefully Scala
●


    C++
●


    .NET
●
XAP Alternatives

    Data Grid
●


        GemFire, Coherence
    –

    Shared Memory
●


        Terracotta/NAM, Memcached, Tokyo Cabinet, Infinispin
    –

    Computation Grids
●


        IBM Extreme Scale Platform
    –

    Cloud/Grid
●


        Google AppEngine, GridGain
    –

    Map Reduce Engines
●


        Hadoop, Disco, Skynet
    –
Case Study – MAGFA SMPP Gateway
Case Study – Let's See it in Action
Other Useful Results
    Use everything in place. Memcached helped us a lot to
●

    have a fast, simple and centralized Key/Value store.
    BASE-like transactions in favor of full XA. Memcached as
●

    a transaction-memory.
    Tried on both Linux and Solaris. No tangible difference.
●


    Don't design for an specific platform. Use them as tools.
●


             Easily switched to ActiveMQ, RabbitMQ, Coherence
         –

    Spring greatly helps to apply above rule.
●


    Love immutable. It prevents bugs before they happen.
●


    Reduces contention as much as possible.
●
References

    Migrating JEE Apps to GigaSpaces, Uri Cohen
●


    Scaling Out Tier Based Applications, Nati Shalom
●


    Cloud Computing; Designing Applications for Efficiency,
●

      Geva Perry
    Characteristics of The Next Generation Application
●

      Servers, Guy Nirpaz
    GigaSpaces Wiki
●


    Wikipedia
●
Thanks for Your Attention




          Q/A

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Apache Hadoop
Introduction to Apache HadoopIntroduction to Apache Hadoop
Introduction to Apache Hadoop
Christopher Pezza
 
Design Theory - Lecture 03: Design as Learning / Methods & Tools
Design Theory - Lecture 03: Design as Learning / Methods & ToolsDesign Theory - Lecture 03: Design as Learning / Methods & Tools
Design Theory - Lecture 03: Design as Learning / Methods & Tools
Bas Leurs
 

Was ist angesagt? (20)

Big Data Architectural Patterns
Big Data Architectural PatternsBig Data Architectural Patterns
Big Data Architectural Patterns
 
Big Data ppt
Big Data pptBig Data ppt
Big Data ppt
 
Data Lakehouse, Data Mesh, and Data Fabric (r2)
Data Lakehouse, Data Mesh, and Data Fabric (r2)Data Lakehouse, Data Mesh, and Data Fabric (r2)
Data Lakehouse, Data Mesh, and Data Fabric (r2)
 
Data Platform Architecture Principles and Evaluation Criteria
Data Platform Architecture Principles and Evaluation CriteriaData Platform Architecture Principles and Evaluation Criteria
Data Platform Architecture Principles and Evaluation Criteria
 
Big data introduction
Big data introductionBig data introduction
Big data introduction
 
Sam Guckenheimer - Moving to One Engineering System
Sam Guckenheimer - Moving to One Engineering SystemSam Guckenheimer - Moving to One Engineering System
Sam Guckenheimer - Moving to One Engineering System
 
Introduction to Apache Hadoop
Introduction to Apache HadoopIntroduction to Apache Hadoop
Introduction to Apache Hadoop
 
The Architect's Clue Bucket
The Architect's Clue BucketThe Architect's Clue Bucket
The Architect's Clue Bucket
 
Real time analytics
Real time analyticsReal time analytics
Real time analytics
 
Design Theory - Lecture 03: Design as Learning / Methods & Tools
Design Theory - Lecture 03: Design as Learning / Methods & ToolsDesign Theory - Lecture 03: Design as Learning / Methods & Tools
Design Theory - Lecture 03: Design as Learning / Methods & Tools
 
Mongo DB: Operational Big Data Database
Mongo DB: Operational Big Data DatabaseMongo DB: Operational Big Data Database
Mongo DB: Operational Big Data Database
 
Introduction Data warehouse
Introduction Data warehouseIntroduction Data warehouse
Introduction Data warehouse
 
Big Data & Data Science
Big Data & Data ScienceBig Data & Data Science
Big Data & Data Science
 
Big Data Analytics with Google BigQuery. By Javier Ramirez. All your base Co...
Big Data Analytics with Google BigQuery.  By Javier Ramirez. All your base Co...Big Data Analytics with Google BigQuery.  By Javier Ramirez. All your base Co...
Big Data Analytics with Google BigQuery. By Javier Ramirez. All your base Co...
 
Speculative Everything: Be a Dreamer with Critical Design and Design Fiction
Speculative Everything: Be a Dreamer with Critical Design and Design FictionSpeculative Everything: Be a Dreamer with Critical Design and Design Fiction
Speculative Everything: Be a Dreamer with Critical Design and Design Fiction
 
Big data visualization
Big data visualizationBig data visualization
Big data visualization
 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
 
Real-Time Streaming Data on AWS
Real-Time Streaming Data on AWSReal-Time Streaming Data on AWS
Real-Time Streaming Data on AWS
 
Presentation sql server to oracle a database migration roadmap
Presentation    sql server to oracle a database migration roadmapPresentation    sql server to oracle a database migration roadmap
Presentation sql server to oracle a database migration roadmap
 
Leveraging Multiple GPUs and CPUs for Graphlet Counting in Large Networks
Leveraging Multiple GPUs and CPUs for  Graphlet Counting in Large Networks Leveraging Multiple GPUs and CPUs for  Graphlet Counting in Large Networks
Leveraging Multiple GPUs and CPUs for Graphlet Counting in Large Networks
 

Ähnlich wie An Introduction To Space Based Architecture

A scalable server environment for your applications
A scalable server environment for your applicationsA scalable server environment for your applications
A scalable server environment for your applications
GigaSpaces
 
Giga Spaces Getting Ready For The Cloud
Giga Spaces   Getting Ready For The CloudGiga Spaces   Getting Ready For The Cloud
Giga Spaces Getting Ready For The Cloud
chzesin
 
GigaSpaces - Getting Ready For The Cloud
GigaSpaces - Getting Ready For The CloudGigaSpaces - Getting Ready For The Cloud
GigaSpaces - Getting Ready For The Cloud
gigaspaces
 
ASAS 2013 - Space-based architecture: Linear scalability? High throughput? Lo...
ASAS 2013 - Space-based architecture: Linear scalability? High throughput? Lo...ASAS 2013 - Space-based architecture: Linear scalability? High throughput? Lo...
ASAS 2013 - Space-based architecture: Linear scalability? High throughput? Lo...
Avisi B.V.
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
Ross Lawley
 
Azul yandexjune010
Azul yandexjune010Azul yandexjune010
Azul yandexjune010
yaevents
 
Building Web Applications on AWS - AWS Summit 2012 - NYC
Building Web Applications on AWS - AWS Summit 2012 - NYCBuilding Web Applications on AWS - AWS Summit 2012 - NYC
Building Web Applications on AWS - AWS Summit 2012 - NYC
Amazon Web Services
 

Ähnlich wie An Introduction To Space Based Architecture (20)

Empowering Amazon EC2 with GigaSpaces XAP
Empowering Amazon EC2 with GigaSpaces XAPEmpowering Amazon EC2 with GigaSpaces XAP
Empowering Amazon EC2 with GigaSpaces XAP
 
A scalable server environment for your applications
A scalable server environment for your applicationsA scalable server environment for your applications
A scalable server environment for your applications
 
Giga Spaces Getting Ready For The Cloud
Giga Spaces   Getting Ready For The CloudGiga Spaces   Getting Ready For The Cloud
Giga Spaces Getting Ready For The Cloud
 
GigaSpaces - Getting Ready For The Cloud
GigaSpaces - Getting Ready For The CloudGigaSpaces - Getting Ready For The Cloud
GigaSpaces - Getting Ready For The Cloud
 
Performance Comparison of Streaming Big Data Platforms
Performance Comparison of Streaming Big Data PlatformsPerformance Comparison of Streaming Big Data Platforms
Performance Comparison of Streaming Big Data Platforms
 
Internet Scale Architecture
Internet Scale ArchitectureInternet Scale Architecture
Internet Scale Architecture
 
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...
Smuggling Multi-Cloud Support into Cloud-native Applications using Elastic Co...
 
ASAS 2013 - Space-based architecture: Linear scalability? High throughput? Lo...
ASAS 2013 - Space-based architecture: Linear scalability? High throughput? Lo...ASAS 2013 - Space-based architecture: Linear scalability? High throughput? Lo...
ASAS 2013 - Space-based architecture: Linear scalability? High throughput? Lo...
 
AWS re:Invent 2016: Building HPC Clusters as Code in the (Almost) Infinite Cl...
AWS re:Invent 2016: Building HPC Clusters as Code in the (Almost) Infinite Cl...AWS re:Invent 2016: Building HPC Clusters as Code in the (Almost) Infinite Cl...
AWS re:Invent 2016: Building HPC Clusters as Code in the (Almost) Infinite Cl...
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 
One millions users vs your web application mega testing cloud applications pr...
One millions users vs your web application mega testing cloud applications pr...One millions users vs your web application mega testing cloud applications pr...
One millions users vs your web application mega testing cloud applications pr...
 
NoSQL and ACID
NoSQL and ACIDNoSQL and ACID
NoSQL and ACID
 
Cloud Expo Silicon Valley 2013 | Why Lease When You Can Buy Your Cloud
Cloud Expo Silicon Valley 2013 | Why Lease When You Can Buy Your CloudCloud Expo Silicon Valley 2013 | Why Lease When You Can Buy Your Cloud
Cloud Expo Silicon Valley 2013 | Why Lease When You Can Buy Your Cloud
 
Azul yandexjune010
Azul yandexjune010Azul yandexjune010
Azul yandexjune010
 
Internet World Web2
Internet World Web2Internet World Web2
Internet World Web2
 
Improving velocity through abstraction
Improving velocity through abstractionImproving velocity through abstraction
Improving velocity through abstraction
 
Accelerating Analytics for the Future of Genomics
Accelerating Analytics for the Future of GenomicsAccelerating Analytics for the Future of Genomics
Accelerating Analytics for the Future of Genomics
 
Building Web Applications on AWS - AWS Summit 2012 - NYC
Building Web Applications on AWS - AWS Summit 2012 - NYCBuilding Web Applications on AWS - AWS Summit 2012 - NYC
Building Web Applications on AWS - AWS Summit 2012 - NYC
 
Machine learning model to production
Machine learning model to productionMachine learning model to production
Machine learning model to production
 
Architecture Best Practices on Windows Azure
Architecture Best Practices on Windows AzureArchitecture Best Practices on Windows Azure
Architecture Best Practices on Windows Azure
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

An Introduction To Space Based Architecture

  • 1. An Introduction to Space Based Architecture Amin Abbaspour MAGFA IT Development Center twitter.com/abbaspour
  • 2. Agenda Title Time Scalability, why and hows (15) 10 Space Based Architecture (6) 5 Java Spaces (4) 5 GigaSpaces (5) 10 Migrating Spring Apps to GigaSpaces (6) 5 Case Study (2) 10 Conclusion (2) 1 Q/A - 40 slides 45 min
  • 3. Innovation Comes From The Need The applications workload is increasing each day. This is inevitable. We expect fast and reliable softwares even with increasing workload. Speed and reliability means the death or life of a business.
  • 4. But why so much Workload? Todays softwares are not limited to operators and limited society. They directly interact with millions of people and thousand of other softwares. Large scale community sites, like facebook, hi5, twitter. ● Prepaid Telecoms ● Banking/XTP ● Online Gaming ● Online Fraud/Risk Management ●
  • 5. Need For Speed A brokerage can lose up to $4 million per millisecond of latency. - The Tabb Group An additional 500 ms latency resulted in -20% traffic. - Google An additional 100 ms in latency resulted in -1% sales. - Amazon
  • 6. Cost of Downtime According to a 2004 Forrester survey of 235 companies the hourly cost of downtime was: Percent of Companies Hourly Cost 33% $10K-100K 25% $100K-500K 13% $500K- 1M 4% >$1M 25% Didn't Know
  • 7. Unpredictable work load How do you design and build applications that cost- ● effectively scale in such conditions? Without compromising reliability, performance and time- ● to-market?
  • 8. Scalability The solutions is to have scalable softwares. With scalability we create speed and reliability. Vertical scalability; More powerful machines leads to – faster software. Horizontal scalability; More boxes leads to faster and – more reliable software. Linear scalability; The overall throughput = (number of – processing units) * (throughput per unit). Dynamic scalability; Scale on demand (usually using – some sort of provisioning and monitoring capabilities) We usually refer to horizontal scalability, since its more applicable and cost effective. Budget is a great excuse.
  • 9. Amdal's Law if, for example, your program has only 10% of a given function synchronized, then: if the throughput of that function at a single CPU is 100 messages per second, to increase performance by a factor of 10 (to 1,000 msg/sec) we will need to increase our CPU resources by a factor of 100 This is 10 times more then what would have been required if the application wouldn't have any synchronization blocks in its code
  • 10. Scalability Wall Non-Scalable applications are expensive and risky. At some point the application will hit a wall: Application crashes ● Re-architecting the application every few months/years ● Server cost 20,000 Server Throughput: 1,000 tx/sec Contention: 15%
  • 11. Amdal's Law Consequences To have scalable softwares, we should eliminate synchronized blocks. This means eliminating the bottlenecks and contentions.
  • 12. Do We build Scalable Software?
  • 15. Tier Based Car-wash Total CPH is the ● minimal CPH. Failure in each ● warehouse makes the whole business fail. To increase ● performance need to budget all three warehouses. Personnel with ● specialized capabilities.
  • 16. All in One Car-wash To increase CPH, ● simple add new warehouses. Better resources ● utilization. Each warehouse is ● independent. Less steps ●
  • 17. Scaling Made Simple – Process Unit Design
  • 18. Space-Based Architecture Based on Object Space Computational Model. ● Processing Unit ● Self sufficient unit of scale – Combination of Data, Processing and Messaging – Principles of Partitioning ● Content Based Routing ● Interaction Model Abstractions ●
  • 21. Parallel Pus – Bring Linear Scalability
  • 22. The Ideal Scenario - “Write Once Scale Anywhere” Scale-out to get more ● processing power when volume increases. Through caching ● Parallelizing of TX ● Low commodity ● resources Better Utilization ●
  • 23. Space Based Architecture – Theory Basics Object Spaces is a paradigm for development of ● distributed computing applications. Spaces can be used to achieve scalability through parallel ● processing. Objects, when deposited in an Object Space are passive, ● i.e., their methods cannot be invoked while the objects are in the Object Space. This paradigm inherently provides mutual exclusion. ● Linda coordination language was developed at Yale. ● Object Spaces is usually called Tuple Spaces since it ● contains of tuples unrelated to each others.
  • 24. SBA Paradigm in Java; Sun Didn't (Re)invent The Wheel Linda a language and platform on tuple-spaces. ● Space model was recommending a plug-n-play ● infrastructure. Jini was there – So JavaSpaces was invented, based on TupleSpaces ● paradigm and on top of Jini platform. By the way Java is not the only language to take the ● concept. Tuple-spaces are ported to many other languages such as Python, Ruby, Scala, C, .NET, ... .
  • 26. JavaSpaces Standard API // An Entry class public class SpaceEntry implements Entry { public Integer count = 0; public String toString() { return quot;Count: quot; + count; } } public class Server { public static void main(String[] args) throws Exception { SpaceEntry entry = new SpaceEntry(); JavaSpace space = (JavaSpace) space(); // Register and write the Entry into the Space space.write(entry, null, Lease.FOREVER); // retrieve the Entry and check its state. SpaceEntry e = space.read(new SpaceEntry(), null, Long.MAX_VALUE); }
  • 27. Java Spaces Implementations Sun RI (now River Project) ● Orbitz (running orbitz.com) ● Blitz (open source) ● Openwings (?) ● Semispaces ● TSpaces (IBM's implementation) ● GigaSpaces ●
  • 28. About GigaSpaces Technologies Provides Application Platform product (XAP) for ● applications characterized by: High volume transaction processing and – Very Low latency requirements – Large Data Volumes – Scaled-Out Application Server – GigaSpaces XAP ● In-Memory Data Grid – Service Grid – Java, .NET and C++ – Customer Base ● Financial Services, Retail, Banking, Gaming –
  • 29. XAP – eXtreme Application Platform XAP – pronounced zap - a new class of application server focusing cloud computing and scaling out architectures. Used for two main domain: Data intensive/EDG (write-behind cache) ● Compute intensive ●
  • 33. How Can GigaSpaces Help Me To much data and DB is slow. My application has too many ● interactions with database. Application does not scale well. We have (strong) hardware but ● throughput does not increase anymore (symptom of tier based architecture) We develop XTP platform. e.g. billing, banking, finance. ● Not pleased with my HTTP session clustering solution. ● Want an scalable SOA/ESB platform. ● Need in memory indexing, searching. ● Want to deploy my application in cloud (pay-as-you-go) ● Want CBR over my MQ. ● We don't use Java. Want to stay in C++ or .NET. ● Want SLA in my application/data-partition. ●
  • 34. Expectations From Application Server Data access ● Messaging / Event Processing ● Remoting ● TX management ● Web ●
  • 35. Migration to GigaSpaces Messaging / Event processing ● Replace MDBs with GigaSpaces event listeners – Remoting ● Replace SLSBs with GigaSpaces SVF – (Remoting/Executors) Data access ● Use GigaSpaces 2nd cache for Hibernate – Convert your DAOs to use GigaSpaces, use mirror to persist – TX management ● Use Spring… – Web ● Use GigaSpaces web processing unit – Use GS HTTP session replication –
  • 36. Migration in Practice Converted Code change Config Effort Layer change (3 is biggest) Messaging Minor to none Yes 1 1 Remoting No Yes Yes 2-3 Data ORM 2nd level cache: No Access DAO: Yes 1 Http No No Session
  • 37. XAP and Integration to Other (JEE) Platforms Spring ● ORM ● Lucene/Compass ● Mule ESB ● JGroovy, JRuby, and hopefully Scala ● C++ ● .NET ●
  • 38. XAP Alternatives Data Grid ● GemFire, Coherence – Shared Memory ● Terracotta/NAM, Memcached, Tokyo Cabinet, Infinispin – Computation Grids ● IBM Extreme Scale Platform – Cloud/Grid ● Google AppEngine, GridGain – Map Reduce Engines ● Hadoop, Disco, Skynet –
  • 39. Case Study – MAGFA SMPP Gateway
  • 40. Case Study – Let's See it in Action
  • 41. Other Useful Results Use everything in place. Memcached helped us a lot to ● have a fast, simple and centralized Key/Value store. BASE-like transactions in favor of full XA. Memcached as ● a transaction-memory. Tried on both Linux and Solaris. No tangible difference. ● Don't design for an specific platform. Use them as tools. ● Easily switched to ActiveMQ, RabbitMQ, Coherence – Spring greatly helps to apply above rule. ● Love immutable. It prevents bugs before they happen. ● Reduces contention as much as possible. ●
  • 42. References Migrating JEE Apps to GigaSpaces, Uri Cohen ● Scaling Out Tier Based Applications, Nati Shalom ● Cloud Computing; Designing Applications for Efficiency, ● Geva Perry Characteristics of The Next Generation Application ● Servers, Guy Nirpaz GigaSpaces Wiki ● Wikipedia ●
  • 43. Thanks for Your Attention Q/A