Jeffrey Erickson | Content Strategist | October 29, 2024
A lesser-known data type, vectors, has seized the spotlight recently as an enabler of generative AI. But vectors—and databases tuned to store and analyze them—have been toiling backstage for many years. They’re used in geospatial mapping and analysis for city planning, transportation logistics, and environmental analysis. More recently, vectors have been used in recommendation engines for retail products as well as music and video streaming sites.
Generative AI builds on these use cases and opens the door to new innovations using vectors and vector databases along with companion technologies, including retrieval-augmented generation (RAG).
A vector is simply a set of numbers that represents the features of an object—whether that object is a word, a sentence, a document, an image, or a video or audio file. Vectors are needed because comparing or searching this type of unstructured content is difficult for computers. Comparing or searching vectors, on the other hand, is much easier and is based on well-understood math.
Vectors are stored in a database with the data objects on which they are based. Vectors that are mathematically close to one another tend to describe objects with similar features, so you can quickly compare or search them and return objects that are alike. You might also form a query vector with only certain features identified. A search will return objects with features similar to those specified in the query vector.
A vector database is any database that can natively store and manage vector embeddings and handle the unstructured data they describe, such as documents, images, video, or audio.
With the importance of vector search for generative AI, the tech industry has spawned many specialized, standalone vector databases, which companies can add to their data infrastructures. Meanwhile, versions of established favorites, such as the open-source MySQL database and commercial Oracle Database, have incorporated vectors as a native data type alongside many other data types. The argument there is that searches on a combination of business and semantic data can be faster and more precise if both data types are available in a single database. This approach also avoids the data consistency problems introduced when using a separate, specialized vector database in addition to the business’s primary database.
Vector indexes and vector databases are both designed to efficiently store and retrieve vectors, that is, sets of numbers that represent the features of an object, like a document, image, or video or audio file. However, they have different characteristics and use cases. Vector indexes are primarily used for “nearest neighbor” search, which involves finding the closest vector to a given query vector. Indexes are great for applications that require fast and accurate similarity searches, such as a recommendation engine. In contrast, vector databases are where organizations store vectors for retrieval and analysis. An enterprise-class vector database delivers useful features beyond nearest neighbor search, such as metadata storage, data versioning, and integration with other systems.
The key difference between a vector index and a vector database is that vector indexes store information about the attributes of unstructured data, such as text, images, or audio files. This information is represented by a set of numbers called a vector. The vector index holds this data and “indexes” it in a way that helps a database quickly identify and match objects.
A vector database houses these indexes and the objects they describe. However, how a database arranges the vector indexes and data objects varies. Vector-enabled databases, such as Oracle Database, separate the storage of data objects from how the data and vectors are searched. This allows them to combine the mature querying power of SQL for metadata and up-to-date business data with the speed and contextual relevancy of vector search. That approach means, for example, that a vector search for relevant retail products can also deliver up-to-date pricing and availability.
Key Takeaways
Instead of taking on the cost and effort to fine-tune generative AI models, companies are curating the data that LLMs use to generate their outputs. They’re using vector databases that contain up-to-date information from their storehouses of enterprise information. This architectural approach, called retrieval-augmented generation, lets an LLM that was trained on vast amounts of generalized data enhance its response by using local data found in a vector database.
For example, if an LLM-powered chatbot could access a retailer’s customer records and email communications instead of generic messages, it could provide more useful and personalized responses to queries such as, “Has my order shipped?”
RAG can also boost the reliability and trustworthiness of generative AI models by citing which documents in the vector database informed its output.
Unsurprisingly, the use of databases optimized for storing and analyzing vectors is rising. Once used primarily for mapping and data analysis, vector databases have become a critical cornerstone technology of the recommendation engines commonly used by the most popular retailers and music and video streaming providers. And now, vector databases have found a new and spectacular use: Storing large volumes of unstructured data in special indexes that can be accessed to inform the outputs of generative AI models.
A growing trend is for established databases, such as MySQL and Oracle Database, to incorporate vector data as a native data type alongside the rest of an organization’s data types, such as JSON, graph, spatial, and relational. This convergence negates the need to move data to a separate database for generative AI operations, which both simplifies the process and leaves valuable data in trusted repositories.
The growth of generative AI use cases means there are many new vector databases on the market, in addition to the established NoSQL and relational databases that have added vector data type management.
Vector databases work by storing and processing data as vectors, which are mathematical representations of features of objects in multidimensional space. This allows complex data types, such as images, audio, video, and sensor data, to be stored and queried efficiently, making vectors ideal for use cases like recommendation systems, natural language processing, and image recognition.
Operations happen in several steps:
Vector databases can be categorized into various types, either by storage structure, such as columnar, or classified based on their implementation, such as in-memory databases. Each type has advantages; which type you select should be based on your specific requirements and use cases.
A columnar database stores data in columns and groups them on a disk. This arrangement speeds up data analytics because the analysis usually involves filtering and combining data from table columns. Databases can also store records in row format, which is helpful for transactions where you’re updating a single item in the record. For data analysis, however, a columnar database lets analysts scan any column of thousands or millions of records very quickly.
A document store database, or document-oriented database, is a program and data storage system that manages, retrieves, and stores document-oriented information. Document databases store data in flexible, JSON-like documents, which are suitable for varied and dynamic data structures. They differ from relational databases, which use tables to organize data with a fixed schema.
Graph analytics is the process of analyzing data in a graph format, using data points as nodes and relationships as edges. Looking at data this way can help you discover connections and relationships that weren’t obvious before. Graph analytics requires a database that can support graph formats. This could be a dedicated graph database or a converged database that supports multiple data models, including graph.
In-memory databases store and manipulate data in the memory tier of an application rather than on a storage disk. This type of structure is often matched with columnar store functionality and vectorized query plans to accelerate analytic queries. This type of data store is good at supporting lightning-fast operations in global telecommunications and businesses that need to make decisions based on real-time data.
Key-value stores, sometimes also called key-value databases, are a quick way to store and query data that is often changing, such as items in an online store. The key-value store is a NoSQL-type database that uses a key value to pinpoint a specific record for querying or updating.
A spatial database stores and manages spatial data, which represents information about the physical location and geometric properties of objects in space. They do this with indexing techniques and query operations. Spatial databases are used for online mapping and analytics as well as in shipping logistics operations.
A time series database is used to efficiently store and analyze time-stamped data, where each data point is associated with a specific time stamp or time interval. These databases are commonly used in IT monitoring systems that depend on log analysis and in finance.
Vector databases enhance commercial or open-source large language models by giving them access to up-to-date information supplied by a local organization or business. This helps make the LLM’s output more relevant and personalized for people associated with that organization.
Vector databases are used by various applications and organizations that deal with large amounts of spatial and geometric data, such as in the retail and logistics industries and for systems that pilot autonomous vehicles. Vector databases are particularly useful for businesses that require real-time location-based data analysis and visualization because they can efficiently handle complex queries and calculations.
And now, companies exploring advanced AI and machine learning are adopting vector databases, too. Generative AI models, for example, depend on vector databases to improve their outputs by using local, up-to-date data stores.
Other specific use cases include the following:
The use cases for vector databases are as varied as the organizations and applications that depend on them. In addition to real-time data analytics, financial systems, and recommendation engines, vector databases are optimized to handle the complex data structures commonly required for tasks such as image recognition and natural language processing.
By storing and processing data efficiently, vector databases enable companies to leverage complex data structures for a wide range of applications, including the following:
Vector databases offer many advantages over traditional databases, such as faster processing speeds and data retrieval and improved scalability. This makes them ideal for applications and industries that require real-time processing and analysis and for emerging generative AI use cases.
Other advantages include the following:
Whether you’re using generative AI or nearly any other operation using vectors, Oracle can help.
Oracle’s MySQL HeatWave database service handles vectors natively to support vector search and other use cases. For example, you can use it together with retrieval augmented generation (RAG) in Oracle Cloud Infrastructure (OCI) to bring a generative AI interface to your proprietary documents, giving you an AI that’s an expert in your organization’s operational data.
In addition, Oracle Database, the world’s most popular enterprise database, provides a single data platform for vectors and all your data types. By combining SQL, JSON documents, graphs, geospatial data, text, and vectors in a single database, you’ll be able to rapidly build new features in your applications.
Whether you’re using vectors for data analysis, geospatial applications, product recommendations, or as an enabling technology for generative AI, Oracle can help. Both Oracle MySQL HeatWave and Oracle’s flagship Autonomous Database manage vectors as a native data type alongside many other data types for a simpler development experience. Both databases run on Oracle Cloud Infrastructure. OCI is designed with the latest processors and supercluster architecture to handle the most demanding AI workloads faster, including generative AI, computer vision, and predictive analytics. Whether you build with Oracle Database or open source MySQL database, you can start taking advantage of vector search today.
Effortlessly harness the capability of similarity search for your company's data without the need to oversee and synchronize various databases. AI Vector Search allows you to conduct searches on both structured and unstructured data by understanding its semantics or meaning, as well as its values.
In the age of generative AI, vector databases have become more important to businesses than ever before. As more development teams look to store and manage the vector data type, they’ll have a decision to make: Bring in a specialized, purpose-built vector database or use multimodel databases, such as MySQL or Oracle Database, which support not only vectors but many other data types as well.
Vector databases are pivotal to exciting AI use cases, including chatbots that revolutionize customer service and algorithms that transform healthcare. See how companies are putting the power of vectors to work now.
When should you use a vector database?
A vector database can be used for a wide variety of use cases, including geospatial applications, such as shipping logistics or environmental research, recommendations for retail or online entertainment options, or, more recently, as a primary storehouse for data that supports generative AI by individual organizations.
Does Netflix use vector databases?
Netflix announced it uses vector databases to support its popular recommendation engines. It applies vector embeddings to every piece of entertainment in its catalog and the vector database enables real-time search for similar titles.