SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

Tendances (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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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”)
 

Dernier

Dernier (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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...
 
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)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
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...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

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.