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

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 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