Looking for our logo?
This blog is used to promote a lot of the incredible things Algolia produces. The company's AI-driven search, browse, recommendations, and personalization features and APIs are used by thousands of organizations — so of course they want to to tell everybody about them.
Can I let you in on a little secret though? A lot of Algolia clients and contractors, such as myself, look at those features as just a bonus, something they’ll be glad to have access to when their use case grows. In fact, I actually use Algolia’s search indexes as a simple vector database as-a-service, which is not a use case that Algolia was built for, and yet it ain't too shabby for it.
A vector database is a kind of database that associates pieces of stored data with their vector representations — arrays of numbers chosen by an AI that correlate with some patterns the AI notices in the data. Since the patterns described by the vectors are consistent throughout the database, we can quantify how semantically similar two records are, or how similar a record is with a vectorized search query. This means that while traditional databases could only be searched using exact terms (meaning the search query has to show up exactly in the text of the record), vector databases let us search by vibe. This way, we can search for “pants” in a clothing store’s database and still see results that only include the words “jeans” or “slacks”.
This is how Algolia works, except it has a ton of extra features that make it a great choice even if your project only needs a very simple database right now. Let’s look at a few now.
Algolia maintains client libraries for lots of languages and frameworks so you don’t have to do all the complex API integration work. All you need to do is import the appropriate library and call a function or two. For example, here’s what it looks like to set up the JavaScript library:
import { algoliasearch } from 'algoliasearch';
const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');
To save a record to the database:
const response = await client.addOrUpdateObject({
indexName: 'indexName',
objectID: 'uniqueID',
body: { key: 'value' },
});
And to search through the database with a search query:
const response = await client.searchSingleIndex({ indexName: 'indexName' });
And to just export all the records from the database:
const response = await client.browse({ indexName: 'cts_e2e_browse' });
These straightforward functions just work, so they take away the burden of data management and let you focus on whatever it is you’re actually building. And if this is all you ever use Algolia for, you’ll likely stay on the free tier and not have to worry about where the data is actually stored ever again. Algolia just abstracts all that complexity away, forever.
But there’s so much more. When you have your data stored in Algolia, now you can start making use of the AI-driven features we’ve built with almost no extra effort.
For example, we always encourage developers to send an “event” via the API back to Algolia’s servers whenever something interesting happens, like a user clicks on a specific search result or when a user converts (which for an ecommerce site would look like the user buying something they discovered via a search). You can even set this to happen automatically if you’re using Algolia’s frontend library, InstantSearch. The data about how the individual search results perform is then used to give you more understanding of and control over how searches work.
For one, events power analytics. Here’s what just the overview tab of the Analytics dashboard looks like:
It’s comprehensive, right? Algolia can do that because this database has been collecting information about its own usage, and now the business can tell a lot about how its customers use the site. By the way, you get all of this for free. And if you’re using InstantSearch on the frontend (which is the easiest method anyways), all of this can be enabled at literally the click of a button.
This data can then be used to:
You’re not required to use any of these features, but the moment your prototype starts to turn into a full-fledged app, they’ll all be just a button press away.
If you’re looking for a shortcut to managing all the data for your next prototype or small project so you can focus on business logic, you’ve found it. Sign up here, and get started with loading your data up in just a couple seconds with this guide.
Jaden Baptista
Freelance Writer at Author's Collective