{"id":10889,"date":"2025-09-17T11:07:05","date_gmt":"2025-09-17T18:07:05","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=10889"},"modified":"2025-09-17T11:07:05","modified_gmt":"2025-09-17T18:07:05","slug":"record-scanner-for-vinyl-collectors-cuts-costs-with-azure-cosmos-db-vector-search","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/record-scanner-for-vinyl-collectors-cuts-costs-with-azure-cosmos-db-vector-search\/","title":{"rendered":"Record Scanner for vinyl collectors cuts costs with Azure Cosmos DB vector search"},"content":{"rendered":"<p><em>by Artur Drozdz, Founder of Record Scanner (<a href=\"https:\/\/recordscanner.com\">recordscanner.com<\/a>)<\/em><\/p>\n<p>If you\u2019re like me, there\u2019s at least one room in your home with an entire cabinet dedicated to your growing vinyl collection. At this point, you\u2019ve probably heard that vinyl is making a comeback, it\u2019s not just vintage anymore. In fact, after hitting a low during the 90s and 2000s, sales of records <a href=\"https:\/\/www.musicweek.com\/labels\/read\/vinyl-alliance-says-gen-z-is-now-the-driving-force-behind-the-format-s-popularity\/091294\">grew by 10 percent in 2024<\/a>, largely driven by Gen Z-ers.<\/p>\n<p>About seven years ago, I looked at my collection and decided it was time to finally organize it. I went searching for an app to help me catalog my treasures, but the solutions I found were not easy to use and they weren\u2019t mobile friendly. That\u2019s when I decided to create a prototype for a cover scanner.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-10890\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-1.jpeg\" alt=\"Black Smart Phone with purple gradient background.\" width=\"1432\" height=\"955\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-1.jpeg 1432w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-1-300x200.jpeg 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-1-1024x683.jpeg 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-1-768x512.jpeg 768w\" sizes=\"(max-width: 1432px) 100vw, 1432px\" \/><\/p>\n<p>What started out as a fun side project for a vinyl enthusiast has grown into an <a href=\"https:\/\/mobiletrends.pl\/aplikacja-record-scanner-vinyl-cd-zwyciezczynia-mobile-trends-awards\/\">award-winning<\/a> app for music lovers that reached a quarter of a million downloads. But to get Record Scanner to where it is today, I had to learn all about vector image scanning, find tools to do embeddings, and prototype with open-source solutions. Our first iteration of our scanner was prohibitively expensive because it required a machine with a huge amount of RAM. That\u2019s when we learned about vector search with <a href=\"https:\/\/azure.microsoft.com\/products\/cosmos-db\">Azure Cosmos DB<\/a>, which was nearly 20 times less expensive than our open source based solution.<\/p>\n<p>In this blog, I\u2019ll discuss how we first developed Record Scanner, what we built with Azure Cosmos DB, and what we learned about vector search.<\/p>\n<h1>Building a vinyl record catalog mobile app with Azure Cosmos DB<\/h1>\n<p>When we set out to build Record Scanner, I wanted it to be as user-friendly as possible. That meant capturing and transforming text instead of having the user manually input characters. It also meant providing a fast, simple way to scan the cover art with a mobile phone. Currently, Record Scanner offers three options for scanning\u2014soon to be four\u2014including:<\/p>\n<ol>\n<li>Barcodes<\/li>\n<li>Catalog numbers<\/li>\n<li>Record cover images<\/li>\n<li>Inner label\u2014coming soon<\/li>\n<\/ol>\n<p>Developing a record scanner for barcodes was straightforward because it\u2019s a universal system. However, many records were released before barcodes became standard and they were marked with catalog numbers instead. For those, we used optical character recognition (OCR) to transform them into text, so users don\u2019t have to input the information. But the capability we\u2019re best known for is our innovative record cover scanner.<\/p>\n<p>Creating the cover scanner was quite a long journey for us, which started with prototyping a reverse image search using APIs available on the market. But it wasn\u2019t reliable in the long run, and we often incurred downtime or changes to rules we had no control over. From there, we decided to build our own using open-source solutions. Although this worked, we found it was very expensive to hold large amounts of images in the cloud, and it required a virtual machine that used a ton of RAM.<\/p>\n<h1>Azure Cosmos DB delivers 20X cheaper vector search<\/h1>\n<p>When we looked around for alternatives to reverse image search, we found Azure Cosmos DB and its vector capabilities. It\u2019s not easy to build that database that performs vector search of images but doesn\u2019t rely on a massive machine. It\u2019s really a complex problem, but it looks like the guys at Microsoft figured it out.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-10891\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-diagram-of-a-blue-sphere-with-arrows-ai-generat.png\" alt=\"A diagram of a blue sphere with arrows\" width=\"1430\" height=\"524\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-diagram-of-a-blue-sphere-with-arrows-ai-generat.png 1430w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-diagram-of-a-blue-sphere-with-arrows-ai-generat-300x110.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-diagram-of-a-blue-sphere-with-arrows-ai-generat-1024x375.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-diagram-of-a-blue-sphere-with-arrows-ai-generat-768x281.png 768w\" sizes=\"(max-width: 1430px) 100vw, 1430px\" \/><\/p>\n<p>We gave Azure Cosmos DB a try and the first thing we noticed was how fast it was. It has a very similar SQL-based query syntax, so we could easily start writing queries and it\u2019s also around 20 times cheaper than our open-source-based solution because it doesn\u2019t require many resources. Consider this cost comparison: Let\u2019s say we have 15M vectors to store in the database. If we want to run the database by ourselves, we need a virtual machine. And in order to have a good performance the whole index needs to be kept in RAM. Let\u2019s pick a memory optimized Ebdsv5 VM with 256GB of RAM. The result is Azure Cosmos DB comes out to $85\/month and the VM option is $1,950\/month. Our investigation showed that storing similar amounts of data\/workload resulted in around 20 times lower cost when comparing a virtual-machine-based solution to Azure Cosmos DB.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-10892\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-comparison-of-cost-comparison-ai-generated-cont.png\" alt=\"A comparison of cost comparison between Ebdsv5 VM vs Azure Cosmos DB\" width=\"1432\" height=\"955\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-comparison-of-cost-comparison-ai-generated-cont.png 1432w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-comparison-of-cost-comparison-ai-generated-cont-300x200.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-comparison-of-cost-comparison-ai-generated-cont-1024x683.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-comparison-of-cost-comparison-ai-generated-cont-768x512.png 768w\" sizes=\"(max-width: 1432px) 100vw, 1432px\" \/><\/p>\n<h1>Endless possibilities with Transformers.js<\/h1>\n<p>As we considered JavaScript-based solutions, the release of <a href=\"https:\/\/huggingface.co\/docs\/transformers.js\/en\/index\">transformers.js<\/a> was a game-changer for us. Since this release, machine learning is no longer mainly a Python thing. There are many models to choose from when it comes to generating embeddings. And the best part is, we can run it in a browser! The sample code below shows how easy it is to extract embeddings from an image using the transfromer.js library.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-10893\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-4.png\" alt=\"Code\" width=\"1414\" height=\"588\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-4.png 1414w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-4-300x125.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-4-1024x426.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-4-768x319.png 768w\" sizes=\"(max-width: 1414px) 100vw, 1414px\" \/><\/p>\n<p>While searching through dozens of vectors is not a heavy task, doing it at scale requires compute power. And here comes Azure Cosmos DB, ready to store and index a huge number of vectors. It\u2019s also pretty simple thanks to official Azure SDK:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-10894\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-5.png\" alt=\"Code\" width=\"1429\" height=\"786\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-5.png 1429w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-5-300x165.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-5-1024x563.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-5-768x422.png 768w\" sizes=\"(max-width: 1429px) 100vw, 1429px\" \/><\/p>\n<p>Since we\u2019re talking about handling vectors on a large scale, it\u2019s worth mentioning that Azure Cosmos DB also <a href=\"https:\/\/learn.microsoft.com\/azure\/cosmos-db\/nosql\/bulk-executor-nodejs\">supports bulk operations<\/a>, which we found really useful. It\u2019s also really straightforward to write queries.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-10895\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-6.png\" alt=\"Code\" width=\"1428\" height=\"398\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-6.png 1428w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-6-300x84.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-6-1024x285.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-6-768x214.png 768w\" sizes=\"(max-width: 1428px) 100vw, 1428px\" \/><\/p>\n<p>Maybe it\u2019s obvious, but the VectorDistance function can be used in the WHERE clause as well as in the SELECT and ORDER BY clauses. Knowing the exact distance for each returned record allows us to further improve the user experience.<\/p>\n<h1>Easy control with autoscaling<\/h1>\n<p>While the RU (Request Units) term on Azure is quite technical and sometimes you have to dig a bit to find the answer related to it, Microsoft technicians came up with a higher-level setting that allows easy control and understanding of usage and its cost. You can easily set the throughput and see the expected maximum cost. Everything else looks familiar if you\u2019ve ever browsed Metrics or Insights in the Azure Portal.<\/p>\n<h1><img decoding=\"async\" class=\"alignnone wp-image-10896\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-7.png\" alt=\"Cosmos DB Autoscaling\" width=\"2148\" height=\"1186\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-7.png 2148w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-7-300x166.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-7-1024x565.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-7-768x424.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-7-1536x848.png 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-7-2048x1131.png 2048w\" sizes=\"(max-width: 2148px) 100vw, 2148px\" \/><\/h1>\n<h1>OCR rounds out our app<\/h1>\n<p>Right now, we\u2019re working on a prototype for Record Scanner\u2019s fourth scanning capability\u2014the inner center label of records. Sometimes records can share the same cover art, but different releases contain different information on the inner label. Our prototype for this scanner uses OCR to recognize the text and numbers and we\u2019ve already picked the best model to extract embeddings.<\/p>\n<p>With Azure Cosmos DB powering our search functions, we\u2019re ready to push <a href=\"https:\/\/recordscanner.com\/\">Record Scanner<\/a> even further.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-10897\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-8.jpeg\" alt=\"Image of Record Scanner App entering a vinyl album cover\" width=\"1432\" height=\"955\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-8.jpeg 1432w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-8-300x200.jpeg 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-8-1024x683.jpeg 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/word-image-10889-8-768x512.jpeg 768w\" sizes=\"(max-width: 1432px) 100vw, 1432px\" \/><\/p>\n<h1>See Record Scanner in action<\/h1>\n<table style=\"border-collapse: collapse; width: 70.01%; height: 44px;\">\n<tbody>\n<tr>\n<td style=\"width: 50%;\"><a href=\"https:\/\/apps.apple.com\/app\/id1507752204\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"aligncenter wp-image-10898\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-black-and-white-sign-with-white-text-ai-generat.png\" alt=\"Download on the App Store - Apple\" width=\"269\" height=\"80\" \/><\/a><\/td>\n<td style=\"width: 50%;\"><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.digdig\"><img decoding=\"async\" class=\"aligncenter wp-image-10899\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-black-and-white-sign-with-white-text-ai-generat-1-scaled.png\" alt=\"A black and white sign with white text\n\nAI-generated content may be incorrect.\" width=\"269\" height=\"80\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-black-and-white-sign-with-white-text-ai-generat-1-scaled.png 2500w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-black-and-white-sign-with-white-text-ai-generat-1-300x89.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-black-and-white-sign-with-white-text-ai-generat-1-1024x304.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-black-and-white-sign-with-white-text-ai-generat-1-768x228.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-black-and-white-sign-with-white-text-ai-generat-1-1536x455.png 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2025\/09\/a-black-and-white-sign-with-white-text-ai-generat-1-2048x607.png 2048w\" sizes=\"(max-width: 269px) 100vw, 269px\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>About Azure Cosmos DB<\/h1>\n<p>Azure Cosmos DB is a fully managed and serverless NoSQL and vector database for modern app development, including AI applications. With its SLA-backed speed and availability as well as instant dynamic scalability, it is ideal for real-time NoSQL and MongoDB applications that require high performance and distributed computing over massive volumes of NoSQL and vector data.<\/p>\n<p>To stay in the loop on Azure Cosmos DB updates, follow Azure Cosmos DB on\u00a0<a href=\"https:\/\/twitter.com\/AzureCosmosDB\" target=\"_blank\" rel=\"noopener\">X<\/a>,\u00a0<a href=\"https:\/\/aka.ms\/AzureCosmosDBYouTube\" target=\"_blank\" rel=\"noopener\">YouTube<\/a>, and\u00a0<a href=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\" target=\"_blank\" rel=\"noopener\">LinkedIn<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>by Artur Drozdz, Founder of Record Scanner (recordscanner.com) If you\u2019re like me, there\u2019s at least one room in your home with an entire cabinet dedicated to your growing vinyl collection. At this point, you\u2019ve probably heard that vinyl is making a comeback, it\u2019s not just vintage anymore. In fact, after hitting a low during the [&hellip;]<\/p>\n","protected":false},"author":179851,"featured_media":10900,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,1809],"tags":[],"class_list":["post-10889","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-sql-api","category-customers"],"acf":[],"blog_post_summary":"<p>by Artur Drozdz, Founder of Record Scanner (recordscanner.com) If you\u2019re like me, there\u2019s at least one room in your home with an entire cabinet dedicated to your growing vinyl collection. At this point, you\u2019ve probably heard that vinyl is making a comeback, it\u2019s not just vintage anymore. In fact, after hitting a low during the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/10889","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/179851"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=10889"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/10889\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/10900"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=10889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=10889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=10889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}