Your SlideShare is downloading. ×
0
NoSQL matters inCatchoom Recognition Service                                                    David Arcos               ...
1) Introduction         2) What did we need?         3) How we build it         4) Advantages of NoSQL         5) Cool use...
Hi! Im David Arcos     - Python/Django developer (>4yr)     - Web backend, distributed systems,     databases, scalability...
Catchoom technology recognizes an      object by searching through a large      collection of images in a fraction of a   ...
Our customers are leaders in Augmented RealityDavid Arcos | @DZPM                             catchoom.com | @catchoom
Visual Recognition:      “Identify an object in front of the camera by comparing it      to a huge collection of reference...
Examples of recognized objects:      - CD/DVD and book covers      - Newspapers and magazines      - Logos and brands     ...
Catchoom Recognition Service:       - Cloud-based Visual Recognition (SaaS)       - RESTful API to integrate       - “Add ...
- Small team of 4 developers, doing SCRUMDavid Arcos | @DZPM                            catchoom.com | @catchoom
1) Introduction         2) What did we need?         3) How we build it         4) Advantages of NoSQL         5) Cool use...
Minimum requirements:      - a public API for the final users to perform Visual      Recognition      - a private API for ...
Must be flexible:      - A customer who does Augmented Reality, and      needs a 3D model (binary format) in the item     ...
Must be reliable:      - Images or data should never be lost      - Avoid single points of failure      - We need redundan...
Must be very fast:      “Layar has been using Catchoom’s Visual Search technology since the      launch of Layar Vision, a...
1) Introduction         2) What did we need?         3) How we built it         4) Advantages of NoSQL         5) Cool use...
Technology stack:       - Development: Python, Django, Tornado, Gevent       - Deployed using: Supervisord, Nginx, gunicor...
The Panel:      - typical customer portal:          - manage your Collections, run Visual Recognition          - get usage...
David Arcos | @DZPM   catchoom.com | @catchoom
David Arcos | @DZPM   catchoom.com | @catchoom
Mobile apps:      - for Android, iOS      - use the Visual Recognition API      - the code will be publishedDavid Arcos | ...
Data models:      - Collection: a set of items. Has at least one token.      - Item: has at least one Image. Has metadata....
Components:      - the platform is highly modular      - “Do one thing, and do it well”      - they pass json messages    ...
- Frontend:      gets the API request      - Extractor:      extracts the visual points      - Collector:      message exc...
Required NoSQL features:      - key-value storage      - cache      - message lists      - message pub/sub      - real-tim...
Required NoSQL features:      - key-value storage      - cache      - message lists      - message pub/sub      - real-tim...
Required NoSQL features:      - key-value storage      - cache      - message lists      - message pub/sub      - real-tim...
1) Introduction         2) What did we need?         3) How we build it         4) Advantages of NoSQL         5) Cool use...
Performance:      - Cant afford writing to disk, or querying slow databases      - Using Redis, everything stays on memory...
Scalability:      - Need to scale different components, separately      - Load balancing using Redis Lists:         BLPOP:...
Unstructured data: query      - A query object has many optional parameters         - each component can add/remove fields...
Unstructured data: metadata      - Metadata is optional and unstructed, can be from a json to a      binary blob      - Ca...
Availability:      - Avoid single points of failure. Replicate everything!      - Replicating a SQL server is painful     ...
1) Introduction         2) What did we need?         3) How we build it         4) Advantages of NoSQL         5) Cool use...
Do real-time calculations:      - Usage statistics         - total, monthly, daily, hourly         - per image, item or co...
Sorted Sets:      - To create indexes and filters      - In example, “Most recognized images” (sorted by hits)      - Upda...
Cache:      - Redis is compatible with memcached API      - Cache everything:         - Sessions, metadata, etc      - ......
Volatile data:      - Redis can set an expiration time for a value      - Very easy for:         - implementing timeouts  ...
Messages:      - Redis implements pub/sub and lists.          - Publish/Subscribe to a channel             - all component...
1) Introduction         2) What did we need?         3) How we build it         4) Advantages of NoSQL         5) Cool use...
Django apps compatibility:      - we use Django and several contrib and external apps.         - (“Standing in the shoulde...
1) Introduction         2) What did we need?         3) How we build it         4) Advantages of NoSQL         5) Cool use...
Summary:      - We use a combination of SQL and NoSQL      - Using NoSQL was necessary to meet the requirements      - The...
Recommendations:      - There is no silver bullet      - Use the best tool for each task      - But avoid unneeded complex...
Thanks for attending!      - Our beta will be ready soon.      Get a free trial at http://catchoom.com      - Contact me a...
Upcoming SlideShare
Loading in...5
×

NoSQL matters in Catchoom Recognition Service

735

Published on

David Arcos from Catchoom presented at NoSQLMatters Barcelona (6 Oct 2012) how Catchoom Recognition Service (a SaaS platform for visual recognition) was implemented using Redis and other deployment tools. David argues about the necessity of NoSQL for critical components of the service.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
735
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Looks easy?
  • (timestamps, the image index, debug info...)
  • Efficiency Totals, per month, per day, per image, per item, per collection Response times, queue size Redis is compatible with memcached API Avoid hitting the db
  • Efficiency No need to consolidate
  • Efficiency No need to consolidate
  • Efficiency No need to consolidate
  • Efficiency No need to consolidate
  • Efficiency No need to consolidate
  • Efficiency No need to consolidate
  • Efficiency No need to consolidate
  • Efficiency No need to consolidate
  • Transcript of "NoSQL matters in Catchoom Recognition Service"

    1. 1. NoSQL matters inCatchoom Recognition Service David Arcos david.arcos@catchoom.com | @DZPM catchoom.com | @catchoom catchoom.com | @catchoom
    2. 2. 1) Introduction 2) What did we need? 3) How we build it 4) Advantages of NoSQL 5) Cool uses of NoSQL 6) Limits 7) ConclusionDavid Arcos | @DZPM catchoom.com | @catchoom
    3. 3. Hi! Im David Arcos - Python/Django developer (>4yr) - Web backend, distributed systems, databases, scalability, security - Team leader at Catchoom - You can follow me at @DZPMDavid Arcos | @DZPM catchoom.com | @catchoom
    4. 4. Catchoom technology recognizes an object by searching through a large collection of images in a fraction of a second. Catchoom targets application developers and integrators.David Arcos | @DZPM catchoom.com | @catchoom
    5. 5. Our customers are leaders in Augmented RealityDavid Arcos | @DZPM catchoom.com | @catchoom
    6. 6. Visual Recognition: “Identify an object in front of the camera by comparing it to a huge collection of reference images”David Arcos | @DZPM catchoom.com | @catchoom
    7. 7. Examples of recognized objects: - CD/DVD and book covers - Newspapers and magazines - Logos and brands - Posters - Packaged goods - Monuments and placesDavid Arcos | @DZPM catchoom.com | @catchoom
    8. 8. Catchoom Recognition Service: - Cloud-based Visual Recognition (SaaS) - RESTful API to integrate - “Add VR features to your app/platform”David Arcos | @DZPM catchoom.com | @catchoom
    9. 9. - Small team of 4 developers, doing SCRUMDavid Arcos | @DZPM catchoom.com | @catchoom
    10. 10. 1) Introduction 2) What did we need? 3) How we build it 4) Advantages of NoSQL 5) Cool uses of NoSQL 6) Limits 7) ConclusionDavid Arcos | @DZPM catchoom.com | @catchoom
    11. 11. Minimum requirements: - a public API for the final users to perform Visual Recognition - a private API for the customer to manage the Collections and get statistics - a nice website for the customer, providing the functionality of both APIsDavid Arcos | @DZPM catchoom.com | @catchoom
    12. 12. Must be flexible: - A customer who does Augmented Reality, and needs a 3D model (binary format) in the item - Another one who needs just the item id - Our data model needs to allow everything (structured and unstructured data)David Arcos | @DZPM catchoom.com | @catchoom
    13. 13. Must be reliable: - Images or data should never be lost - Avoid single points of failure - We need redundancyDavid Arcos | @DZPM catchoom.com | @catchoom
    14. 14. Must be very fast: “Layar has been using Catchoom’s Visual Search technology since the launch of Layar Vision, allowing users to quickly view the AR content placed on top of images by just pointing their camera to the image. We’ve benchmarked Catchoom’s technology in 2011 against 3 of their main competitors and found they had the best results both on speed and on successful matches (including lowest false positives)” Dirk Groten – CTO of LayarDavid Arcos | @DZPM catchoom.com | @catchoom
    15. 15. 1) Introduction 2) What did we need? 3) How we built it 4) Advantages of NoSQL 5) Cool uses of NoSQL 6) Limits 7) ConclusionDavid Arcos | @DZPM catchoom.com | @catchoom
    16. 16. Technology stack: - Development: Python, Django, Tornado, Gevent - Deployed using: Supervisord, Nginx, gunicorn, Fabric - AWS: EC2, S3, ELBDavid Arcos | @DZPM catchoom.com | @catchoom
    17. 17. The Panel: - typical customer portal: - manage your Collections, run Visual Recognition - get usage statistics - and configure the payment method :)David Arcos | @DZPM catchoom.com | @catchoom
    18. 18. David Arcos | @DZPM catchoom.com | @catchoom
    19. 19. David Arcos | @DZPM catchoom.com | @catchoom
    20. 20. Mobile apps: - for Android, iOS - use the Visual Recognition API - the code will be publishedDavid Arcos | @DZPM catchoom.com | @catchoom
    21. 21. Data models: - Collection: a set of items. Has at least one token. - Item: has at least one Image. Has metadata. - Image: you want several images if the item has different sides, logos, flavours... - Token: for authenticating the requests.David Arcos | @DZPM catchoom.com | @catchoom
    22. 22. Components: - the platform is highly modular - “Do one thing, and do it well” - they pass json messages - optimized hardware settingsDavid Arcos | @DZPM catchoom.com | @catchoom
    23. 23. - Frontend: gets the API request - Extractor: extracts the visual points - Collector: message exchange - Searcher: looks for matchesDavid Arcos | @DZPM catchoom.com | @catchoom
    24. 24. Required NoSQL features: - key-value storage - cache - message lists - message pub/sub - real-time analysis What servers have we chosen?David Arcos | @DZPM catchoom.com | @catchoom
    25. 25. Required NoSQL features: - key-value storage - cache - message lists - message pub/sub - real-time analysisDavid Arcos | @DZPM catchoom.com | @catchoom
    26. 26. Required NoSQL features: - key-value storage - cache - message lists - message pub/sub - real-time analysis - and Filesystem:David Arcos | @DZPM catchoom.com | @catchoom
    27. 27. 1) Introduction 2) What did we need? 3) How we build it 4) Advantages of NoSQL 5) Cool uses of NoSQL 6) Limits 7) ConclusionDavid Arcos | @DZPM catchoom.com | @catchoom
    28. 28. Performance: - Cant afford writing to disk, or querying slow databases - Using Redis, everything stays on memory - One V.R. query takes just 300 msDavid Arcos | @DZPM catchoom.com | @catchoom
    29. 29. Scalability: - Need to scale different components, separately - Load balancing using Redis Lists: BLPOP: Remove and get the first element in a list, or block until one is available - But focus on the bottlenecks!David Arcos | @DZPM catchoom.com | @catchoom
    30. 30. Unstructured data: query - A query object has many optional parameters - each component can add/remove fields dynamically - schema change between versions - Cant fit in a SQL table - We model the query in Redis as a jsonDavid Arcos | @DZPM catchoom.com | @catchoom
    31. 31. Unstructured data: metadata - Metadata is optional and unstructed, can be from a json to a binary blob - Cant fit in a SQL table, and would be too slow - Serve the data from Redis, and use S3 as a backup - Warning: in the future, if we have huge metadata files, Redis will get out of memory. Well improve this approachDavid Arcos | @DZPM catchoom.com | @catchoom
    32. 32. Availability: - Avoid single points of failure. Replicate everything! - Replicating a SQL server is painful - Redis instances configured as Master/Slave - When the master dies: - promote a slave to be the new master - reconfigure the other slaves to use this new master - Redis Sentinel does this (beta)David Arcos | @DZPM catchoom.com | @catchoom
    33. 33. 1) Introduction 2) What did we need? 3) How we build it 4) Advantages of NoSQL 5) Cool uses of NoSQL 6) Limits 7) ConclusionDavid Arcos | @DZPM catchoom.com | @catchoom
    34. 34. Do real-time calculations: - Usage statistics - total, monthly, daily, hourly - per image, item or collection - Metric monitoring for internal use - response times, queue size, etc - QoS: enforce rate limiting - max hits per minuteDavid Arcos | @DZPM catchoom.com | @catchoom
    35. 35. Sorted Sets: - To create indexes and filters - In example, “Most recognized images” (sorted by hits) - Updating the Sorted Set, no need to reconsolidate: ZADD Add one or more members to a sorted set, or update its score if it already existsDavid Arcos | @DZPM catchoom.com | @catchoom
    36. 36. Cache: - Redis is compatible with memcached API - Cache everything: - Sessions, metadata, etc - ...although the website is internal: no bottleneck here - Better focus on optimizing other stuff!David Arcos | @DZPM catchoom.com | @catchoom
    37. 37. Volatile data: - Redis can set an expiration time for a value - Very easy for: - implementing timeouts - removing old queries - adding temporary cappingDavid Arcos | @DZPM catchoom.com | @catchoom
    38. 38. Messages: - Redis implements pub/sub and lists. - Publish/Subscribe to a channel - all components get the message - use it for monitoring - List: push/pop messages - only one component gets the message - use the blocking versions for load balancingDavid Arcos | @DZPM catchoom.com | @catchoom
    39. 39. 1) Introduction 2) What did we need? 3) How we build it 4) Advantages of NoSQL 5) Cool uses of NoSQL 6) Limits 7) ConclusionDavid Arcos | @DZPM catchoom.com | @catchoom
    40. 40. Django apps compatibility: - we use Django and several contrib and external apps. - (“Standing in the shoulder of giants”) - but no support for NoSQL in Django ORM - dropping SQL is not an option! - we use MySQL. South migrations.David Arcos | @DZPM catchoom.com | @catchoom
    41. 41. 1) Introduction 2) What did we need? 3) How we build it 4) Advantages of NoSQL 5) Cool uses of NoSQL 6) Limits 7) ConclusionDavid Arcos | @DZPM catchoom.com | @catchoom
    42. 42. Summary: - We use a combination of SQL and NoSQL - Using NoSQL was necessary to meet the requirements - There are a lot of different uses for NoSQLDavid Arcos | @DZPM catchoom.com | @catchoom
    43. 43. Recommendations: - There is no silver bullet - Use the best tool for each task - But avoid unneeded complexity! - Try Redis. Dont do a migration, just add it to your stackDavid Arcos | @DZPM catchoom.com | @catchoom
    44. 44. Thanks for attending! - Our beta will be ready soon. Get a free trial at http://catchoom.com - Contact me at david.arcos@catchoom.com - Questions?David Arcos | @DZPM catchoom.com | @catchoom
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×