SlideShare a Scribd company logo
1 of 17
Ciarán Lee
RateMyArea.com

•   Local-Social-Search
•   Starting off in Dublin
•   Launched 7 November
•   Rails app
Interesting things we have done


• Search
• Caching
• iPhone web app
Search
Search = sphinx

• moving from ultrasphinx to thinking_sphinx
  • more actively developed
  • nice syntax
  • we are overhauling search
geo-search
• sphinx does this very well
• insists on radians
• ultrasphinx provides a nice interface
   # CREATE AN INDEX
   define_index do
    indexes :name
    has quot;RADIANS(latitude)quot;, :as => :latitude, :type => :float
    has quot;RADIANS(longitude)quot;, :as => :longitude, :type => :float
   end

   # RUN A SEARCH for popular bars nearby
   @bars = Listing.search(quot;barquot;,
        :per_page => 10,
        :page => 1,
        :geo => [deg2rad(@where.latitude), deg2rad(@where.longitude)],
        :order => average_rating DESC,
        :with => {quot;@geodistquot; => 0.0..2000})
caching - in order of preference


1. Page caching
2. Action caching
3. Fragment caching
Caching
Page caching not possible if
content changes for ANY
user *


Action caching can be used
conditionally - for logged out
users
   caches_action :show ,
       :if => Proc.new { |controller| controller.send(:logged_out?) }




                        * unless server side includes (SSI) are used
20,000 action cached places
   But... the footer is dynamic




   How to keep the action cache but
   change the footer?
Server Side Includes
Wikipedia:

“As its name implies, its primary use is including the
contents of one file into another one dynamically when
the latter is served by a web server.”


         <!--# include virtual=quot;/ssi/footerquot; -->

The webserver inserts the contents of the include
before sending the response to the client

http://blog.kovyrin.net/2007/08/05/using-nginx-ssi-and-memcache-to-make-your-web-applications-faster/

http://www.jkraemer.net/tags/nginx
also...


•    Object caching can be handy for expensive queries
    • these objects can be fetched out of request/
      response cycle (we use workling for this)
•   don’t keep page cache in RAILS_ROOT/public -
    this will preserve it through redeploys
    http://blog.hasmanythrough.com/2008/1/30/segregated-page-cache-storage
RateMyArea on your mobile
                                    (if you have an iPhone)




•   We like MobileSafari!


•    iUi used for the interface
    • development has stalled
    • good starting point...
      • Flickr agree with copied us :)
    http://code.flickr.com/blog/2008/10/27/lessons-learned-while-building-an-iphone-site/
RateMyArea on your mobile
                     (if you have an iPhone)




•    No access to CoreLocation through the browser :(
    • phonegap can fix this
     • native iPhone app
     • wraps a web-app
     • really is a site specific browser
     • http://github.com/sintaxi/phonegap/tree/master
Maps on the iPhone
•    Native app is really nice
    • can render kml
    • different firmware versions have different
      capabilities :(
Thank You
keepusbusy@ratemyarea.com

More Related Content

What's hot

What's hot (10)

Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumber
 
RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2
 
SPA using Rails & Backbone
SPA using Rails & BackboneSPA using Rails & Backbone
SPA using Rails & Backbone
 
RoR 101: Session 6
RoR 101: Session 6RoR 101: Session 6
RoR 101: Session 6
 
Programming Ruby On Rails
Programming Ruby On RailsProgramming Ruby On Rails
Programming Ruby On Rails
 
AJAX Solr JS filters in Drupal
AJAX Solr JS filters in DrupalAJAX Solr JS filters in Drupal
AJAX Solr JS filters in Drupal
 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React Router
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 
xml-motor ~ What,Why,How
xml-motor ~ What,Why,Howxml-motor ~ What,Why,How
xml-motor ~ What,Why,How
 
Project development - preparing hell dish together – Oleksii Dashkevych
Project development - preparing hell dish together – Oleksii DashkevychProject development - preparing hell dish together – Oleksii Dashkevych
Project development - preparing hell dish together – Oleksii Dashkevych
 

Viewers also liked (8)

Oss Implementation OSCC MAMPU
Oss Implementation OSCC MAMPUOss Implementation OSCC MAMPU
Oss Implementation OSCC MAMPU
 
B2 b crm and supply chain connection
B2 b crm and supply chain connectionB2 b crm and supply chain connection
B2 b crm and supply chain connection
 
Unamigo
UnamigoUnamigo
Unamigo
 
La Publicidad
La PublicidadLa Publicidad
La Publicidad
 
Informe Bandas y Bandidos
Informe Bandas y BandidosInforme Bandas y Bandidos
Informe Bandas y Bandidos
 
D Ay 1
D Ay 1D Ay 1
D Ay 1
 
Neuro diseases newest
Neuro diseases newestNeuro diseases newest
Neuro diseases newest
 
Podcamp Nashville
Podcamp NashvillePodcamp Nashville
Podcamp Nashville
 

Similar to RateMyArea - interesting rails bits

Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Esri Nederland
 
Web enabling your survey business ppt version
Web enabling your survey business ppt versionWeb enabling your survey business ppt version
Web enabling your survey business ppt version
rudy_stricklan
 
Html5 and beyond the next generation of mobile web applications - Touch Tou...
Html5 and beyond   the next generation of mobile web applications - Touch Tou...Html5 and beyond   the next generation of mobile web applications - Touch Tou...
Html5 and beyond the next generation of mobile web applications - Touch Tou...
RIA RUI Society
 

Similar to RateMyArea - interesting rails bits (20)

3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.
 
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
 
Creating Rajanikant Powered Site
Creating Rajanikant Powered SiteCreating Rajanikant Powered Site
Creating Rajanikant Powered Site
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Intro To Django
Intro To DjangoIntro To Django
Intro To Django
 
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
 
Web enabling your survey business ppt version
Web enabling your survey business ppt versionWeb enabling your survey business ppt version
Web enabling your survey business ppt version
 
phonegap with angular js for freshers
phonegap with angular js for freshers    phonegap with angular js for freshers
phonegap with angular js for freshers
 
Building great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to knowBuilding great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to know
 
Building WebApp with HTML5
Building WebApp with HTML5Building WebApp with HTML5
Building WebApp with HTML5
 
Html5 and beyond the next generation of mobile web applications - Touch Tou...
Html5 and beyond   the next generation of mobile web applications - Touch Tou...Html5 and beyond   the next generation of mobile web applications - Touch Tou...
Html5 and beyond the next generation of mobile web applications - Touch Tou...
 
Primefaces mobile users_guide_0_9
Primefaces mobile users_guide_0_9Primefaces mobile users_guide_0_9
Primefaces mobile users_guide_0_9
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5
 
Always on! Or not?
Always on! Or not?Always on! Or not?
Always on! Or not?
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
 
RESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web DesignRESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web Design
 
Always on! ... or not?
Always on! ... or not?Always on! ... or not?
Always on! ... or not?
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)
 

Recently uploaded

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

RateMyArea - interesting rails bits

  • 2.
  • 3. RateMyArea.com • Local-Social-Search • Starting off in Dublin • Launched 7 November • Rails app
  • 4. Interesting things we have done • Search • Caching • iPhone web app
  • 6. Search = sphinx • moving from ultrasphinx to thinking_sphinx • more actively developed • nice syntax • we are overhauling search
  • 7. geo-search • sphinx does this very well • insists on radians • ultrasphinx provides a nice interface # CREATE AN INDEX define_index do indexes :name has quot;RADIANS(latitude)quot;, :as => :latitude, :type => :float has quot;RADIANS(longitude)quot;, :as => :longitude, :type => :float end # RUN A SEARCH for popular bars nearby @bars = Listing.search(quot;barquot;, :per_page => 10, :page => 1, :geo => [deg2rad(@where.latitude), deg2rad(@where.longitude)], :order => average_rating DESC, :with => {quot;@geodistquot; => 0.0..2000})
  • 8. caching - in order of preference 1. Page caching 2. Action caching 3. Fragment caching
  • 9. Caching Page caching not possible if content changes for ANY user * Action caching can be used conditionally - for logged out users caches_action :show , :if => Proc.new { |controller| controller.send(:logged_out?) } * unless server side includes (SSI) are used
  • 10. 20,000 action cached places But... the footer is dynamic How to keep the action cache but change the footer?
  • 11. Server Side Includes Wikipedia: “As its name implies, its primary use is including the contents of one file into another one dynamically when the latter is served by a web server.” <!--# include virtual=quot;/ssi/footerquot; --> The webserver inserts the contents of the include before sending the response to the client http://blog.kovyrin.net/2007/08/05/using-nginx-ssi-and-memcache-to-make-your-web-applications-faster/ http://www.jkraemer.net/tags/nginx
  • 12. also... • Object caching can be handy for expensive queries • these objects can be fetched out of request/ response cycle (we use workling for this) • don’t keep page cache in RAILS_ROOT/public - this will preserve it through redeploys http://blog.hasmanythrough.com/2008/1/30/segregated-page-cache-storage
  • 13. RateMyArea on your mobile (if you have an iPhone) • We like MobileSafari! • iUi used for the interface • development has stalled • good starting point... • Flickr agree with copied us :) http://code.flickr.com/blog/2008/10/27/lessons-learned-while-building-an-iphone-site/
  • 14. RateMyArea on your mobile (if you have an iPhone) • No access to CoreLocation through the browser :( • phonegap can fix this • native iPhone app • wraps a web-app • really is a site specific browser • http://github.com/sintaxi/phonegap/tree/master
  • 15. Maps on the iPhone • Native app is really nice • can render kml • different firmware versions have different capabilities :(
  • 16.