Docs Menu

Docs HomeDevelop ApplicationsMongoDB Manual

Identify Application Workload

On this page

  • About this Task
  • Steps
  • Identify the data your application needs
  • Create a workload table with your application's queries
  • Example
  • Next Steps

The first step in the schema design process is to identify the operations that your application runs most frequently. Knowing your application's most common queries helps you create effective indexes and minimize the number of calls the application makes to the database.

When you consider your application's workload, consider the scenarios your application currently supports and scenarios it may support in the future. Design your schema to function in all stages of your application development.

1

To identify the data that your application needs, consider the following factors:

  • Your application's users and the information they need.

  • Your business domain.

  • Application logs and frequently-run queries. To see database commands run on a MongoDB deployment, see Database Profiler.

2

Fill out the following table with the queries that your application needs to run:

Action
Query Type
Information
Frequency
Priority
The action that a user takes to trigger the query.
The type of query (read or write).
The document fields that are either written or returned by the query.

How frequently your application runs the query.

Queries that are run frequently benefit from indexes and should be optimized to avoid lookup operations.

How critical the query is to your application.

The following example shows a workload table for a blog application:

Action
Type
Information
Frequency
Priority
Submit a new article
Write
author, text
10 per day
High
Submit a comment on an article
Write
user, text
1,000 per day (100 per article)
Medium
View an article
Read
article id, text, comments
1,000,000 per day
High
View article analytics
Read
article id, comments, clicks
10 per hour
Low

After you identify your application's workload, the next step in the schema design process is to map related data in your schema. See Map Schema Relationships.

← Schema Design Process