A searchable database is an organized collection of records that can be queried or retrieved based on a specific field. By inserting the field, the database should allow end-users to pull out all relevant information. For example, a customer searchable database can include each customer’s name, email, phone number, job title, job company, and so on. You can simply search for a customer’s name to obtain the rest of the information.

In short, the purpose of searchable databases is to centralize all relatable data in a single place and allow end-users to get the information they need without having to compile complex queries or build technical infrastructure.

Quick view of a searchable database

Choose a tool to build one

There are a variety of options that you can choose from on the market. Before diving into the available solutions, you can think of the following questions to help you make a better decision:

  • Does your data come from multiple sources, such as spreadsheets, databases, or APIs?
  • How large is your database? If it’s small now (like less than 100k rows), will it become larger and larger in the future?
  • Does your database need to be updated at a certain time?
  • In addition to simple keyword search, do you need more advanced search functionalities?
  • Do you need to share the database with other people?

Spreadsheets

Basically, if you don’t have too much data (maybe less than 1M rows) and you are proficient in Excel or Google Sheets, you can consider using spreadsheet programs to create a searchable database. All you need to do is to create several input boxes and set up VLOOKUP functions to return the matching values based on the inputs.

Although spreadsheets allow you to create a search system with complex logic, they are not databases. They are not built for storing and processing large amounts of data. When your database grows to a certain extent, your Excel may take a very long time to return the results. Moreover, spreadsheets are easy to edit, so anyone may change the formula or data unintendedly. Consequently, your database may get errors, and missing values due to the easily editable nature of a spreadsheet program.

Relational database systems

Relational database systems, such as MySQL, PostgreSQL, are common and scalable methods to build a database. No matter how large your data is, it can be stored in a structured format. The problem is that you need to have enough database knowledge and coding skills to set up the entire system. The knowledge includes designing the schemas, defining relationships between tables, and building the connection between data source and database. Once the database is constructed, you need to know how to write SQL queries to retrieve the data you need. Moreover, most of the relational databases are running on your local server. If your database is too large, it may take several minutes to return the search results depending on your computer’s performance.

Data app development platforms

Data app development platforms, such as Acho, are more ideal when it comes to creating a searchable database. First, they generally have a data infrastructure that can store and process big data, but they have a user-friendly GUI that allows you to do searches with no codes. In addition, they can utilize cloud computing to speed up data processing. Even if your database has more than 10 million rows, you can still get the search results instantly. Second, in addition to spreadsheets, they support importing data from various sources, such as relational databases, third-party apps, and APIs. You can put all data in a single place and use them to enrich your database. Third, they have built-in features that allow you to transform and clean data without writing codes. Thus, you can customize the database into any table you want.

Create a searchable database

In this article, I will use Acho to demonstrate how to build a searchable customer database.

1. Import data from various data sources

Your business may use several different tools to manage your customer data. For example, you may use MySQL to record customer information, Google Sheets to manage CRM, and Stripe to deal with customer payments. The first step is to import all data that your database needs.

acho_add_resources
Acho - Add resources

2. Combine your data to enrich your database

Once all data is imported to Acho, you can create a new project and import all datasets to the project. Within the project, you can combine these datasets into a single table by using Join or Union.

acho_join_action
Acho - Join action

3. Set up schedulers to automate data sync

You can create schedulers to update your database. The schedulers will retrieve the latest data from your data sources and run all actions that you have applied. Thus, you don’t need to recreate the database whenever you get new data.

acho_data_sync
Acho - Data Sync

Explore your database

If you want to do a quick search, you can simply type a keyword in the search bar at the top of the headers. It will return all of the results that include the keyword in the given column.

acho_search_bar
Acho - Search bar

2. Create a complex search by using the Filter action

Alternatively, you can set up a set of filters to narrow the search results. Based on each column’s data type, the filter will provide different logics such as “is or after” for dates, “contains” for texts, “larger than” for numbers, etc.

After applying your filters, you can even store them as your favorites so you can revisit them later on.

acho_filter
Acho - Filter

Create a searchable database with Acho App Builder

If you want to present your data in a more customizable format and share it with lots of people, you can use Acho App Builder to build it. The App Builder allows you to customize filters and build a full-text search bar. Moreover, the content can be drilled in more detail by clicking any row.

1. Navigate to App Builder and create a new app

After successfully setting up your data source, you can navigate to the “App Builder” page and create a new app. You can create a blank app and follow the instructions to create a web app database. Alternatively, you can save time by choosing the "Searchable Car Database" template and replacing the existing database with your own.

Create an app

Once the app is created, you'll be taken to a canvas where you can modify both the data source and page layout to your liking. To preview your web app and see how it operates, simply click the preview button located in the top right corner.

2. Construct your interface

Let's move on to constructing the front-end interface for your app. If you've created an app from a template, you likely already have an interface and can skip this step. However, if you're building an app from scratch, navigate to Create > Elements on the left and drag visual components to your page. (Note that you can double-click the page to enter editing mode and start constructing your page.)

For this particular app, we'll need a table element, a pagination element, and a search bar. You can also add other elements, such as a text element to title your app or provide instructions. To learn more about the available elements and styling, visit this link.

3. Create a data source for your table

To import a data source to your app, navigate to Create > Data on the left panel and drag the “Acho Resource” data node to the canvas. Then, double-click on the data node and write a query below to retrieve all the data:

SELECT  *
FROM car_database

Then, click the “Run” button to preview the result. If the result is right, click the “Save” button to save the query results.

4. Connect the interface to the data source

Now that we have both a data source and an interface, we need to connect them to make the app work. To do this, simply double-click the page to enter editing mode and select the table element. Then, change the data source to the one we just created.

5. Add a search bar for your table

We now have a table and pagination that allow users to browse the data. Let's add a search bar to enable deeper interaction with the database.

First, open your data node and create a string parameter named search. Then, add a search statement to your query as shown below, which allows users to search for any ticker's price:

SELECT *
FROM car_database
WHERE CONCAT(make, ' ', model, ' ', year::text) ILIKE '%{{search}}%'
LIMIT 10

Next, create an interaction for the search bar to send the search term to the data node.

6. Preview and publish your app

Now, you can preview your app to check the search functionality and the interface. Once everything is working correctly, you can click the Publish button to make your searchable database public.

Embed the searchable database on your website

If you have your own website, you can embed the searchable database on your webpage using an "iframe" tag. Here is a sample HTML code that you can use:

 style="width: 100%; height: 500px; padding: 0; overflow: hidden">
    
      src="https://publish.acho.io/f6250e75-06dc-4336-97a2-f5b7eea851d6/home"
      style="
        width: 200%;
        height: 1000px;
        border: 0;
        -ms-transform: scale(0.5);
        -moz-transform: scale(0.5);
        -o-transform: scale(0.5);
        -webkit-transform: scale(0.5);
        transform: scale(0.5);
        -ms-transform-origin: 0 0;
        -moz-transform-origin: 0 0;
        -o-transform-origin: 0 0;
        -webkit-transform-origin: 0 0;
        transform-origin: 0 0;
      "
    >