SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Beyond relational database
Building high performance website using
Redis and PHP




Pham Cong Dinh                   Hanoi PHP Day 2009
Software Developer               December 19, 2009
Vega Corporation
What I am talking about


               •     Relational database in our world
               •     High performance web apps: new challenges
               •     Redis: A data structure store
               •     Using some of Redis's PHP clients
                                90
                                80
                                70
                                60
                                                                             East
                                50
                                                                             West
                                40
                                                                             North
                                30                                           South
                                20
                                10
                                0
Go beyond relational database        1st Qtr   2nd Qtr   3rd Qtr   4th Qtr
Relational database in our world


                                  •    Question
                                        • How can we store our data?
                                  •    Answer
Part     1                              • Relational database
                                  •    ACID is our love
                                        • Atomicity - all parts of a transaction succeed or none of
                                            then succeed. Integrity.
                                        •   Consistency - Nothing in your transaction will violate the
                                            rules of the database. Integrity.
                                        •   Isolation - Each transaction operates independently of
                                            every other transaction.
                                        •   Durability - Once the database says that data is
                                            committed there is no opportunity for that to be undone.




       Go beyond relational database
Relational database in our world


                          •     Brewer's (CAP) Theorem
                                •   C: Consistency - The client perceives that a set
                                    of operations has occurred all at once.
                                     •   Strong consistency: ACID


                                •   A: Availability - Every operation must terminate
                                    in an intended response. Requests are to be
                                    served even when there is a partition in the
                                    cluster.


                                •   P: Partition tolerance - Operations will
                                    complete, even if individual components are
                                    unavailable.


Go beyond relational database
Relational database in our world


                          •     BASE: An ACID Alternative
                                •   Basically Available
                                •   Soft state
                                •   Eventually consistent.
                          •     Data partitioning and decision between
                                Consistency and Availability.




Go beyond relational database
Relational database in our world


                          •     Relational database in high performance
                                environments
                                 • Google
                                 • Facebook
                                 • Wikipedia
                                 • Live Journal
                                 • Yahoo
                                           FAILED?
                          •     … but most companies does not need
                                more than a single database server

                          •     … but modern web apps today is facing a
                                real challenge
Go beyond relational database
High performance web apps: new
             challenges

                                  •    Web server is bottleneck


Part     2




       Go beyond relational database
High performance web apps: new
      challenges

                          •     Database is bottleneck




Go beyond relational database
High performance web apps: new
      challenges

                          •     CPU is bottleneck




Go beyond relational database
High performance web apps: new
      challenges

                          •     More requests: going distributed is easy
                                •   Apache
                                •   PHP
                          •     Database scalability is hard
                                •   Struggling with SMP: MySQL
                                •   Replication is hard: replication is single
                                    threaded: MySQL
                                •   Most relational databases find hard to scale
                                    WRITEs
                                     •   Schema constraints
                                     •   Disk I/O
                                     •   Memory constraints
                                     •   Global lock
                                     •   Complicated data types
Go beyond relational database
High performance web apps: new
      challenges

                          •     Scaling for READ is easier for scaling for
                                WRITE
                          mysql> select count(1) from setacc;
                          +----------+
                          | count(1) |
                          +----------+
                          |     3982438 |
                          +----------+
                          1 row in set (0.00 sec)


                          mysql> select count(1) from setacc_del;
                          +----------+
                          | count(1) |
                          +----------+
                          |     4003793 |
                          +----------+
                          1 row in set (0.00 sec)

Go beyond relational database
REDIS: A data structure datastore


                                  •    Redis (REmote DIctionary Server)
                                  •    Network interface to language dependent
                                       client library: Python, Java, Ruby, Erlang,
Part     3                             C# …
                                  •    Written in C
                                  •    Latest version: 1.1




       Go beyond relational database
REDIS: A data structure datastore


                          •     In a most basic form, it is a key – value
                                store: think Memcached
                          •     Not memory only
                          •     Not immediately durable
                          •     Supports set of complicated data structure
                          •     Can be found at
                                http://code.google.com/p/redis/




Go beyond relational database
REDIS: A data structure datastore


                          •     Database concept
                                •   SELECT index




Go beyond relational database
REDIS: A data structure datastore


                          •     Key => Value
                                •   SET mykey myvalue
                                •   GET mykey
                                •   More: MGET, MSET

                          •




Go beyond relational database
REDIS: A data structure datastore


                          •     LIST
                                •   RPUSH mylistkey string
                                •   LPUSH mylistkey string
                                •   LLEN mylistkey
                                •   LPOP mylistkey
                                •   RPOP mylistkey
                                •   More: LGET/LSET ...




Go beyond relational database
REDIS: A data structure datastore


                          •     SET
                                •   SADD mysetkey member
                                •   SREM key member
                          •     Sorted SET




Go beyond relational database
Redis PHP clients


                               •    Owlient's phpredis
                                    •   Can be found at
                                        http://github.com/owlient/phpredis

Phần 4                              •   C extension




    Go beyond relational database
Any question?




Phần 4




    Go beyond relational database

Weitere ähnliche Inhalte

Was ist angesagt?

Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, InformaticaHadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, InformaticaCloudera, Inc.
 
MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017Ivan Zoratti
 
Introduction to Hadoop - ACCU2010
Introduction to Hadoop - ACCU2010Introduction to Hadoop - ACCU2010
Introduction to Hadoop - ACCU2010Gavin Heavyside
 
SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013
SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013
SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013Michael Noel
 
DevNation Atlanta
DevNation AtlantaDevNation Atlanta
DevNation Atlantaboorad
 
Thousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OThousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OGeorge Cao
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydbDaniel Austin
 
Project Tools in Web Development
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Developmentkmloomis
 
Linkedin NUS QCon 2009 slides
Linkedin NUS QCon 2009 slidesLinkedin NUS QCon 2009 slides
Linkedin NUS QCon 2009 slidesruslansv
 
Conference tutorial: MySQL Cluster as NoSQL
Conference tutorial: MySQL Cluster as NoSQLConference tutorial: MySQL Cluster as NoSQL
Conference tutorial: MySQL Cluster as NoSQLSeveralnines
 
Google App Engine, Groovy and Gaelyk presentation at the Paris JUG
Google App Engine, Groovy and Gaelyk presentation at the Paris JUGGoogle App Engine, Groovy and Gaelyk presentation at the Paris JUG
Google App Engine, Groovy and Gaelyk presentation at the Paris JUGGuillaume Laforge
 
Stig: Social Graphs & Discovery at Scale
Stig: Social Graphs & Discovery at ScaleStig: Social Graphs & Discovery at Scale
Stig: Social Graphs & Discovery at ScaleDATAVERSITY
 
Ron Broersma dren-stavanger-22 nov2011
Ron Broersma dren-stavanger-22 nov2011Ron Broersma dren-stavanger-22 nov2011
Ron Broersma dren-stavanger-22 nov2011IPv6no
 
Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Chris Richardson
 
Hadoop World 2011: The Hadoop Stack - Then, Now and in the Future - Eli Colli...
Hadoop World 2011: The Hadoop Stack - Then, Now and in the Future - Eli Colli...Hadoop World 2011: The Hadoop Stack - Then, Now and in the Future - Eli Colli...
Hadoop World 2011: The Hadoop Stack - Then, Now and in the Future - Eli Colli...Cloudera, Inc.
 
Life Without IPv4: Tore Anderson, IPv6 guru, Redpill Linpro
Life Without IPv4: Tore Anderson, IPv6 guru, Redpill LinproLife Without IPv4: Tore Anderson, IPv6 guru, Redpill Linpro
Life Without IPv4: Tore Anderson, IPv6 guru, Redpill LinproIPv6no
 
Scalable vertical search engine with hadoop
Scalable vertical search engine with hadoopScalable vertical search engine with hadoop
Scalable vertical search engine with hadoopdatasalt
 
OSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suckOSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suckAaron Walker
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Chris Richardson
 

Was ist angesagt? (20)

Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, InformaticaHadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
Hadoop World 2011: Practical HBase - Ravi Veeramchaneni, Informatica
 
MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017
 
Introduction to Hadoop - ACCU2010
Introduction to Hadoop - ACCU2010Introduction to Hadoop - ACCU2010
Introduction to Hadoop - ACCU2010
 
SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013
SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013
SPSMEL 2012 - SQL 2012 AlwaysOn Availability Groups for SharePoint 2010 / 2013
 
DevNation Atlanta
DevNation AtlantaDevNation Atlanta
DevNation Atlanta
 
Thousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/OThousands of Threads and Blocking I/O
Thousands of Threads and Blocking I/O
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydb
 
Project Tools in Web Development
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Development
 
Linkedin NUS QCon 2009 slides
Linkedin NUS QCon 2009 slidesLinkedin NUS QCon 2009 slides
Linkedin NUS QCon 2009 slides
 
Anti-social Databases
Anti-social DatabasesAnti-social Databases
Anti-social Databases
 
Conference tutorial: MySQL Cluster as NoSQL
Conference tutorial: MySQL Cluster as NoSQLConference tutorial: MySQL Cluster as NoSQL
Conference tutorial: MySQL Cluster as NoSQL
 
Google App Engine, Groovy and Gaelyk presentation at the Paris JUG
Google App Engine, Groovy and Gaelyk presentation at the Paris JUGGoogle App Engine, Groovy and Gaelyk presentation at the Paris JUG
Google App Engine, Groovy and Gaelyk presentation at the Paris JUG
 
Stig: Social Graphs & Discovery at Scale
Stig: Social Graphs & Discovery at ScaleStig: Social Graphs & Discovery at Scale
Stig: Social Graphs & Discovery at Scale
 
Ron Broersma dren-stavanger-22 nov2011
Ron Broersma dren-stavanger-22 nov2011Ron Broersma dren-stavanger-22 nov2011
Ron Broersma dren-stavanger-22 nov2011
 
Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)
 
Hadoop World 2011: The Hadoop Stack - Then, Now and in the Future - Eli Colli...
Hadoop World 2011: The Hadoop Stack - Then, Now and in the Future - Eli Colli...Hadoop World 2011: The Hadoop Stack - Then, Now and in the Future - Eli Colli...
Hadoop World 2011: The Hadoop Stack - Then, Now and in the Future - Eli Colli...
 
Life Without IPv4: Tore Anderson, IPv6 guru, Redpill Linpro
Life Without IPv4: Tore Anderson, IPv6 guru, Redpill LinproLife Without IPv4: Tore Anderson, IPv6 guru, Redpill Linpro
Life Without IPv4: Tore Anderson, IPv6 guru, Redpill Linpro
 
Scalable vertical search engine with hadoop
Scalable vertical search engine with hadoopScalable vertical search engine with hadoop
Scalable vertical search engine with hadoop
 
OSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suckOSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suck
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 

Andere mochten auch

nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicehazzaz
 
CEBIT 2007 - LEO Satellite communication services for energy, transport and d...
CEBIT 2007 - LEO Satellite communication services for energy, transport and d...CEBIT 2007 - LEO Satellite communication services for energy, transport and d...
CEBIT 2007 - LEO Satellite communication services for energy, transport and d...Antonio Bove
 
02 phan-thai-trung-drupal
02 phan-thai-trung-drupal02 phan-thai-trung-drupal
02 phan-thai-trung-drupalhazzaz
 
VI Tavola Rotonda con AGCOM
VI Tavola Rotonda con AGCOMVI Tavola Rotonda con AGCOM
VI Tavola Rotonda con AGCOMAntonio Bove
 
Delivering on the broadband promise: technology trends and institutional land...
Delivering on the broadband promise: technology trends and institutional land...Delivering on the broadband promise: technology trends and institutional land...
Delivering on the broadband promise: technology trends and institutional land...Antonio Bove
 
Coffee1
Coffee1Coffee1
Coffee1hazzaz
 
Creating a new landscape for satellite broadband over Europe and beyond
Creating a new landscape for satellite broadband over Europe and beyondCreating a new landscape for satellite broadband over Europe and beyond
Creating a new landscape for satellite broadband over Europe and beyondAntonio Bove
 
Internet, TV and Voice over Satellite The Future is Now
Internet, TV and Voice over Satellite The Future is NowInternet, TV and Voice over Satellite The Future is Now
Internet, TV and Voice over Satellite The Future is NowAntonio Bove
 
html5 css3 the future of web technology
html5 css3 the future of web technologyhtml5 css3 the future of web technology
html5 css3 the future of web technologyhazzaz
 
Burkina Faso | Commission Électorale Nationale Indépendante (CENI) - Electora...
Burkina Faso | Commission Électorale Nationale Indépendante (CENI) - Electora...Burkina Faso | Commission Électorale Nationale Indépendante (CENI) - Electora...
Burkina Faso | Commission Électorale Nationale Indépendante (CENI) - Electora...Antonio Bove
 
PolCorridor User Forum, Prague, 25 September 2003
PolCorridor User Forum, Prague, 25 September 2003PolCorridor User Forum, Prague, 25 September 2003
PolCorridor User Forum, Prague, 25 September 2003Antonio Bove
 
VSAT Conference London, 16-18 September 2015 - Antonio Bove, Director Product...
VSAT Conference London, 16-18 September 2015 - Antonio Bove, Director Product...VSAT Conference London, 16-18 September 2015 - Antonio Bove, Director Product...
VSAT Conference London, 16-18 September 2015 - Antonio Bove, Director Product...Antonio Bove
 
Suy ngam
Suy ngamSuy ngam
Suy ngamhazzaz
 
A Satellite-based Metering Architecture to improve Renewable Energy Productio...
A Satellite-based Metering Architecture to improve Renewable Energy Productio...A Satellite-based Metering Architecture to improve Renewable Energy Productio...
A Satellite-based Metering Architecture to improve Renewable Energy Productio...Antonio Bove
 
kiem tien online
kiem tien onlinekiem tien online
kiem tien onlinehazzaz
 
java script unit testing framework
java script unit testing frameworkjava script unit testing framework
java script unit testing frameworkhazzaz
 
Node js
Node jsNode js
Node jshazzaz
 

Andere mochten auch (19)

nguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-servicenguyenhainhathuy-building-restful-web-service
nguyenhainhathuy-building-restful-web-service
 
CEBIT 2007 - LEO Satellite communication services for energy, transport and d...
CEBIT 2007 - LEO Satellite communication services for energy, transport and d...CEBIT 2007 - LEO Satellite communication services for energy, transport and d...
CEBIT 2007 - LEO Satellite communication services for energy, transport and d...
 
Albus
AlbusAlbus
Albus
 
02 phan-thai-trung-drupal
02 phan-thai-trung-drupal02 phan-thai-trung-drupal
02 phan-thai-trung-drupal
 
VI Tavola Rotonda con AGCOM
VI Tavola Rotonda con AGCOMVI Tavola Rotonda con AGCOM
VI Tavola Rotonda con AGCOM
 
Delivering on the broadband promise: technology trends and institutional land...
Delivering on the broadband promise: technology trends and institutional land...Delivering on the broadband promise: technology trends and institutional land...
Delivering on the broadband promise: technology trends and institutional land...
 
Coffee1
Coffee1Coffee1
Coffee1
 
Creating a new landscape for satellite broadband over Europe and beyond
Creating a new landscape for satellite broadband over Europe and beyondCreating a new landscape for satellite broadband over Europe and beyond
Creating a new landscape for satellite broadband over Europe and beyond
 
Internet, TV and Voice over Satellite The Future is Now
Internet, TV and Voice over Satellite The Future is NowInternet, TV and Voice over Satellite The Future is Now
Internet, TV and Voice over Satellite The Future is Now
 
html5 css3 the future of web technology
html5 css3 the future of web technologyhtml5 css3 the future of web technology
html5 css3 the future of web technology
 
Burkina Faso | Commission Électorale Nationale Indépendante (CENI) - Electora...
Burkina Faso | Commission Électorale Nationale Indépendante (CENI) - Electora...Burkina Faso | Commission Électorale Nationale Indépendante (CENI) - Electora...
Burkina Faso | Commission Électorale Nationale Indépendante (CENI) - Electora...
 
PolCorridor User Forum, Prague, 25 September 2003
PolCorridor User Forum, Prague, 25 September 2003PolCorridor User Forum, Prague, 25 September 2003
PolCorridor User Forum, Prague, 25 September 2003
 
VSAT Conference London, 16-18 September 2015 - Antonio Bove, Director Product...
VSAT Conference London, 16-18 September 2015 - Antonio Bove, Director Product...VSAT Conference London, 16-18 September 2015 - Antonio Bove, Director Product...
VSAT Conference London, 16-18 September 2015 - Antonio Bove, Director Product...
 
Suy ngam
Suy ngamSuy ngam
Suy ngam
 
Cloud
CloudCloud
Cloud
 
A Satellite-based Metering Architecture to improve Renewable Energy Productio...
A Satellite-based Metering Architecture to improve Renewable Energy Productio...A Satellite-based Metering Architecture to improve Renewable Energy Productio...
A Satellite-based Metering Architecture to improve Renewable Energy Productio...
 
kiem tien online
kiem tien onlinekiem tien online
kiem tien online
 
java script unit testing framework
java script unit testing frameworkjava script unit testing framework
java script unit testing framework
 
Node js
Node jsNode js
Node js
 

Ähnlich wie redis

Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social GamesPaolo Negri
 
Big Data Paris : Hadoop and NoSQL
Big Data Paris : Hadoop and NoSQLBig Data Paris : Hadoop and NoSQL
Big Data Paris : Hadoop and NoSQLTugdual Grall
 
Intro to NoSQL and MongoDB
Intro to NoSQL and MongoDBIntro to NoSQL and MongoDB
Intro to NoSQL and MongoDBDATAVERSITY
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQLDon Demcsak
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterJohn Adams
 
Bridging the Developer and the Datacenter
Bridging the Developer and the DatacenterBridging the Developer and the Datacenter
Bridging the Developer and the Datacenterlurs83
 
Building a highly scalable and available cloud application
Building a highly scalable and available cloud applicationBuilding a highly scalable and available cloud application
Building a highly scalable and available cloud applicationNoam Sheffer
 
Fixing twitter
Fixing twitterFixing twitter
Fixing twitterRoger Xia
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...smallerror
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...xlight
 
Scaling Your Database in the Cloud
Scaling Your Database in the CloudScaling Your Database in the Cloud
Scaling Your Database in the CloudRightScale
 
Big data hadoop-no sql and graph db-final
Big data hadoop-no sql and graph db-finalBig data hadoop-no sql and graph db-final
Big data hadoop-no sql and graph db-finalramazan fırın
 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQLRTigger
 
SeaJUG May 2012 mybatis
SeaJUG May 2012 mybatisSeaJUG May 2012 mybatis
SeaJUG May 2012 mybatisWill Iverson
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Ricard Clau
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's ArchitectureTony Tam
 
Introduction to no sql database
Introduction to no sql databaseIntroduction to no sql database
Introduction to no sql databaseHeman Hosainpana
 

Ähnlich wie redis (20)

Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social Games
 
Big Data Paris : Hadoop and NoSQL
Big Data Paris : Hadoop and NoSQLBig Data Paris : Hadoop and NoSQL
Big Data Paris : Hadoop and NoSQL
 
noSQL choices
noSQL choicesnoSQL choices
noSQL choices
 
Intro to NoSQL and MongoDB
Intro to NoSQL and MongoDBIntro to NoSQL and MongoDB
Intro to NoSQL and MongoDB
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling Twitter
 
Bridging the Developer and the Datacenter
Bridging the Developer and the DatacenterBridging the Developer and the Datacenter
Bridging the Developer and the Datacenter
 
Building a highly scalable and available cloud application
Building a highly scalable and available cloud applicationBuilding a highly scalable and available cloud application
Building a highly scalable and available cloud application
 
Fixing twitter
Fixing twitterFixing twitter
Fixing twitter
 
Fixing_Twitter
Fixing_TwitterFixing_Twitter
Fixing_Twitter
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
 
Scaling Your Database in the Cloud
Scaling Your Database in the CloudScaling Your Database in the Cloud
Scaling Your Database in the Cloud
 
Big data hadoop-no sql and graph db-final
Big data hadoop-no sql and graph db-finalBig data hadoop-no sql and graph db-final
Big data hadoop-no sql and graph db-final
 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQL
 
SeaJUG May 2012 mybatis
SeaJUG May 2012 mybatisSeaJUG May 2012 mybatis
SeaJUG May 2012 mybatis
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
 
Introduction to no sql database
Introduction to no sql databaseIntroduction to no sql database
Introduction to no sql database
 

Mehr von hazzaz

Tu dong dat hang tu he thong ban le lon nhat trung quoc
Tu dong dat hang tu he thong ban le lon nhat trung quocTu dong dat hang tu he thong ban le lon nhat trung quoc
Tu dong dat hang tu he thong ban le lon nhat trung quochazzaz
 
how startups can benefit from launch community
how startups can benefit from launch communityhow startups can benefit from launch community
how startups can benefit from launch communityhazzaz
 
social network game
social network gamesocial network game
social network gamehazzaz
 
trung oss magento overview
trung oss magento overviewtrung oss magento overview
trung oss magento overviewhazzaz
 
su dung drupal xay dung mang xa hoi
su dung drupal xay dung mang xa hoisu dung drupal xay dung mang xa hoi
su dung drupal xay dung mang xa hoihazzaz
 
build your own php extension
build your own php extensionbuild your own php extension
build your own php extensionhazzaz
 
web optimization
web optimizationweb optimization
web optimizationhazzaz
 
speed up ntvv2 by php ext module
speed up ntvv2 by php ext modulespeed up ntvv2 by php ext module
speed up ntvv2 by php ext modulehazzaz
 
zingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphpzingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphphazzaz
 
mysql optimization
mysql optimizationmysql optimization
mysql optimizationhazzaz
 
EAV in Magento
EAV in MagentoEAV in Magento
EAV in Magentohazzaz
 
css_trends
css_trendscss_trends
css_trendshazzaz
 
Phan mem tu do nguon mo
Phan mem tu do nguon moPhan mem tu do nguon mo
Phan mem tu do nguon mohazzaz
 
Howtobuildyourownframework
HowtobuildyourownframeworkHowtobuildyourownframework
Howtobuildyourownframeworkhazzaz
 
dangminhtuan-htmlcssjavascript
dangminhtuan-htmlcssjavascriptdangminhtuan-htmlcssjavascript
dangminhtuan-htmlcssjavascripthazzaz
 
nguyen-duc-phu-search-engine
nguyen-duc-phu-search-enginenguyen-duc-phu-search-engine
nguyen-duc-phu-search-enginehazzaz
 

Mehr von hazzaz (17)

Tu dong dat hang tu he thong ban le lon nhat trung quoc
Tu dong dat hang tu he thong ban le lon nhat trung quocTu dong dat hang tu he thong ban le lon nhat trung quoc
Tu dong dat hang tu he thong ban le lon nhat trung quoc
 
how startups can benefit from launch community
how startups can benefit from launch communityhow startups can benefit from launch community
how startups can benefit from launch community
 
social network game
social network gamesocial network game
social network game
 
trung oss magento overview
trung oss magento overviewtrung oss magento overview
trung oss magento overview
 
su dung drupal xay dung mang xa hoi
su dung drupal xay dung mang xa hoisu dung drupal xay dung mang xa hoi
su dung drupal xay dung mang xa hoi
 
build your own php extension
build your own php extensionbuild your own php extension
build your own php extension
 
web optimization
web optimizationweb optimization
web optimization
 
speed up ntvv2 by php ext module
speed up ntvv2 by php ext modulespeed up ntvv2 by php ext module
speed up ntvv2 by php ext module
 
zingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphpzingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphp
 
mysql optimization
mysql optimizationmysql optimization
mysql optimization
 
EAV in Magento
EAV in MagentoEAV in Magento
EAV in Magento
 
css_trends
css_trendscss_trends
css_trends
 
Phan mem tu do nguon mo
Phan mem tu do nguon moPhan mem tu do nguon mo
Phan mem tu do nguon mo
 
Zing
ZingZing
Zing
 
Howtobuildyourownframework
HowtobuildyourownframeworkHowtobuildyourownframework
Howtobuildyourownframework
 
dangminhtuan-htmlcssjavascript
dangminhtuan-htmlcssjavascriptdangminhtuan-htmlcssjavascript
dangminhtuan-htmlcssjavascript
 
nguyen-duc-phu-search-engine
nguyen-duc-phu-search-enginenguyen-duc-phu-search-engine
nguyen-duc-phu-search-engine
 

Kürzlich hochgeladen

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Kürzlich hochgeladen (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

redis

  • 1. Beyond relational database Building high performance website using Redis and PHP Pham Cong Dinh Hanoi PHP Day 2009 Software Developer December 19, 2009 Vega Corporation
  • 2. What I am talking about • Relational database in our world • High performance web apps: new challenges • Redis: A data structure store • Using some of Redis's PHP clients 90 80 70 60 East 50 West 40 North 30 South 20 10 0 Go beyond relational database 1st Qtr 2nd Qtr 3rd Qtr 4th Qtr
  • 3. Relational database in our world • Question • How can we store our data? • Answer Part 1 • Relational database • ACID is our love • Atomicity - all parts of a transaction succeed or none of then succeed. Integrity. • Consistency - Nothing in your transaction will violate the rules of the database. Integrity. • Isolation - Each transaction operates independently of every other transaction. • Durability - Once the database says that data is committed there is no opportunity for that to be undone. Go beyond relational database
  • 4. Relational database in our world • Brewer's (CAP) Theorem • C: Consistency - The client perceives that a set of operations has occurred all at once. • Strong consistency: ACID • A: Availability - Every operation must terminate in an intended response. Requests are to be served even when there is a partition in the cluster. • P: Partition tolerance - Operations will complete, even if individual components are unavailable. Go beyond relational database
  • 5. Relational database in our world • BASE: An ACID Alternative • Basically Available • Soft state • Eventually consistent. • Data partitioning and decision between Consistency and Availability. Go beyond relational database
  • 6. Relational database in our world • Relational database in high performance environments • Google • Facebook • Wikipedia • Live Journal • Yahoo FAILED? • … but most companies does not need more than a single database server • … but modern web apps today is facing a real challenge Go beyond relational database
  • 7. High performance web apps: new challenges • Web server is bottleneck Part 2 Go beyond relational database
  • 8. High performance web apps: new challenges • Database is bottleneck Go beyond relational database
  • 9. High performance web apps: new challenges • CPU is bottleneck Go beyond relational database
  • 10. High performance web apps: new challenges • More requests: going distributed is easy • Apache • PHP • Database scalability is hard • Struggling with SMP: MySQL • Replication is hard: replication is single threaded: MySQL • Most relational databases find hard to scale WRITEs • Schema constraints • Disk I/O • Memory constraints • Global lock • Complicated data types Go beyond relational database
  • 11. High performance web apps: new challenges • Scaling for READ is easier for scaling for WRITE mysql> select count(1) from setacc; +----------+ | count(1) | +----------+ | 3982438 | +----------+ 1 row in set (0.00 sec) mysql> select count(1) from setacc_del; +----------+ | count(1) | +----------+ | 4003793 | +----------+ 1 row in set (0.00 sec) Go beyond relational database
  • 12. REDIS: A data structure datastore • Redis (REmote DIctionary Server) • Network interface to language dependent client library: Python, Java, Ruby, Erlang, Part 3 C# … • Written in C • Latest version: 1.1 Go beyond relational database
  • 13. REDIS: A data structure datastore • In a most basic form, it is a key – value store: think Memcached • Not memory only • Not immediately durable • Supports set of complicated data structure • Can be found at http://code.google.com/p/redis/ Go beyond relational database
  • 14. REDIS: A data structure datastore • Database concept • SELECT index Go beyond relational database
  • 15. REDIS: A data structure datastore • Key => Value • SET mykey myvalue • GET mykey • More: MGET, MSET • Go beyond relational database
  • 16. REDIS: A data structure datastore • LIST • RPUSH mylistkey string • LPUSH mylistkey string • LLEN mylistkey • LPOP mylistkey • RPOP mylistkey • More: LGET/LSET ... Go beyond relational database
  • 17. REDIS: A data structure datastore • SET • SADD mysetkey member • SREM key member • Sorted SET Go beyond relational database
  • 18. Redis PHP clients • Owlient's phpredis • Can be found at http://github.com/owlient/phpredis Phần 4 • C extension Go beyond relational database
  • 19. Any question? Phần 4 Go beyond relational database