Click Below to Get the Code

Browse, clone, and build from real-world templates powered by Harper.
Blog
GitHub Logo

Strict Schema Enforcement vs. Schemaless vs. Dynamic Schema

This post covers strict schema enforcement, schemaless, and dynamic schema, including the pros and cons of each one.
Blog

Strict Schema Enforcement vs. Schemaless vs. Dynamic Schema

By
David Cockerill
December 15, 2020
By
David Cockerill
December 15, 2020
By
David Cockerill
December 15, 2020
December 15, 2020
This post covers strict schema enforcement, schemaless, and dynamic schema, including the pros and cons of each one.
David Cockerill
Platform Software Engineer

The debate over whether to use a schema or not has passionate support on both sides. One side appreciates data integrity constraints and predictability, while the other prefers more flexibility (or “agility”) and time effectiveness. The ultimate answer as to which is “better” most likely depends on the specific project, data used, and associated skill set. 
‍
In this post I will cover strict schema enforcement, schemaless, and dynamic schema, including the pros and cons of each one.

Strict Schema

A schema is a blueprint of how a database is constructed. It doesn’t actually hold the data, but instead describes the shape of the data and how it might relate to other tables in the database. Schema’s contain information on all the objects in a database such as tables, attributes, data types and relationships, it can also include triggers, views, indexes and so on. Some common databases that use strict schemas are Oracle, MS SQL Server and PostgreSQL.

Pros: 

  • Gives a high level view of the structure and relationship of the tables in your database. Can make it easier to keep track of what information is and is not in the database. 
  • Enforces data integrity constraints, these are a set of rules that maintain consistent formatting of all entries. 
  • More predictable, which can provide a more efficient storage and indexing structure.

Cons:

  • Takes time to design and build when starting a new project. Modifying the schema can be tricky. Can be a lot of work to maintain.
  • Rigid limits, not flexible.

Schemaless

As the name implies, schemaless does not use a schema. It means the database does not have any fixed structure. A schemaless database does not enforce any data type limitations and can store structured and unstructured data. Some common schemaless databases are MongoDB, CouchDB, and Google Cloud Datastore.

Pros:

  • Quick and easy to setup because there is no schema to model or additional layers required, so the complexity is greatly reduced. With just a few clicks a developer can have a working database.
  • Updates can be made on the fly without having to make changes to a schema or shutting the database down.
  • More flexibility when storing data. You don’t need to decide up front what you’re going to store, how it’s structured or related to other information in the database.
  • Less overhead, which can lead to better performance and scalability.

Cons:

  • No columns means the application has to parse every document to find requested data.
  • No unified metadata, you end up looking at the application to understand the data rather than having that information.
  • No control over the data, you may be receiving garbage, but you don’t have any filters so bad data gets loaded either way. Data filters are pushed out to the application layer.

Dynamic Schema

What many claim as the best of both worlds, a dynamic schema is one that changes as you add data. There is no need to define the schema beforehand. When data is inserted, updated, or removed, the database builds a schema dynamically. Popular dynamic schema databases include Harper and MongoDB.

Pros:

  • Easy to set up, requires no input from the user.
  • Provides the structure that comes with a schema, which equals a more efficient storage and indexing model. 
  • Doesn’t force data constraints, can ingest unstructured data.
  • Flexible to develop with as the data model can easily evolve over time.
  • Can handle semistructured data.

Cons:

  • No data enforcement means developers must ensure data adheres to the data model.
  • Data model can get messy if proper processes are not followed

As you can see, there are valid points on each side of the argument and numerous factors to considering when choosing which is right for your specific project. At the end of the day, this decision has a lot to do with the preference of the user and long term project goals. For example, at Harper, we are big fans of the dynamic schema, which enables us to ingest any type of data at scale. Harper frees you from the hassle of defining data types, providing unlimited flexibility as your applications evolve and scale over time. Which type of schema do you prefer?

While it may not be top of mind, it’s important to get your schema right upfront to avoid unnecessary headaches and additional time and costs later on. Foundation is key, and it’s much more difficult to go back and change that foundation once you’ve actually built on top of it. Take the time to weigh the pros and cons of strict schema enforcement vs. schemaless vs. dynamic schema before you start building, you won’t regret it.  

You can leave comments or feedback on the original post here

The debate over whether to use a schema or not has passionate support on both sides. One side appreciates data integrity constraints and predictability, while the other prefers more flexibility (or “agility”) and time effectiveness. The ultimate answer as to which is “better” most likely depends on the specific project, data used, and associated skill set. 
‍
In this post I will cover strict schema enforcement, schemaless, and dynamic schema, including the pros and cons of each one.

Strict Schema

A schema is a blueprint of how a database is constructed. It doesn’t actually hold the data, but instead describes the shape of the data and how it might relate to other tables in the database. Schema’s contain information on all the objects in a database such as tables, attributes, data types and relationships, it can also include triggers, views, indexes and so on. Some common databases that use strict schemas are Oracle, MS SQL Server and PostgreSQL.

Pros: 

  • Gives a high level view of the structure and relationship of the tables in your database. Can make it easier to keep track of what information is and is not in the database. 
  • Enforces data integrity constraints, these are a set of rules that maintain consistent formatting of all entries. 
  • More predictable, which can provide a more efficient storage and indexing structure.

Cons:

  • Takes time to design and build when starting a new project. Modifying the schema can be tricky. Can be a lot of work to maintain.
  • Rigid limits, not flexible.

Schemaless

As the name implies, schemaless does not use a schema. It means the database does not have any fixed structure. A schemaless database does not enforce any data type limitations and can store structured and unstructured data. Some common schemaless databases are MongoDB, CouchDB, and Google Cloud Datastore.

Pros:

  • Quick and easy to setup because there is no schema to model or additional layers required, so the complexity is greatly reduced. With just a few clicks a developer can have a working database.
  • Updates can be made on the fly without having to make changes to a schema or shutting the database down.
  • More flexibility when storing data. You don’t need to decide up front what you’re going to store, how it’s structured or related to other information in the database.
  • Less overhead, which can lead to better performance and scalability.

Cons:

  • No columns means the application has to parse every document to find requested data.
  • No unified metadata, you end up looking at the application to understand the data rather than having that information.
  • No control over the data, you may be receiving garbage, but you don’t have any filters so bad data gets loaded either way. Data filters are pushed out to the application layer.

Dynamic Schema

What many claim as the best of both worlds, a dynamic schema is one that changes as you add data. There is no need to define the schema beforehand. When data is inserted, updated, or removed, the database builds a schema dynamically. Popular dynamic schema databases include Harper and MongoDB.

Pros:

  • Easy to set up, requires no input from the user.
  • Provides the structure that comes with a schema, which equals a more efficient storage and indexing model. 
  • Doesn’t force data constraints, can ingest unstructured data.
  • Flexible to develop with as the data model can easily evolve over time.
  • Can handle semistructured data.

Cons:

  • No data enforcement means developers must ensure data adheres to the data model.
  • Data model can get messy if proper processes are not followed

As you can see, there are valid points on each side of the argument and numerous factors to considering when choosing which is right for your specific project. At the end of the day, this decision has a lot to do with the preference of the user and long term project goals. For example, at Harper, we are big fans of the dynamic schema, which enables us to ingest any type of data at scale. Harper frees you from the hassle of defining data types, providing unlimited flexibility as your applications evolve and scale over time. Which type of schema do you prefer?

While it may not be top of mind, it’s important to get your schema right upfront to avoid unnecessary headaches and additional time and costs later on. Foundation is key, and it’s much more difficult to go back and change that foundation once you’ve actually built on top of it. Take the time to weigh the pros and cons of strict schema enforcement vs. schemaless vs. dynamic schema before you start building, you won’t regret it.  

You can leave comments or feedback on the original post here

This post covers strict schema enforcement, schemaless, and dynamic schema, including the pros and cons of each one.

Download

White arrow pointing right
This post covers strict schema enforcement, schemaless, and dynamic schema, including the pros and cons of each one.

Download

White arrow pointing right
This post covers strict schema enforcement, schemaless, and dynamic schema, including the pros and cons of each one.

Download

White arrow pointing right

Explore Recent Resources

Blog
GitHub Logo

Why a Multi-Tier Cache Delivers Better ROI Than a CDN Alone

Learn why a multi-tier caching strategy combining a CDN and mid-tier cache delivers better ROI. Discover how deterministic caching, improved origin offload, lower tail latency, and predictable costs outperform a CDN-only architecture for modern applications.
Cache
Blog
Learn why a multi-tier caching strategy combining a CDN and mid-tier cache delivers better ROI. Discover how deterministic caching, improved origin offload, lower tail latency, and predictable costs outperform a CDN-only architecture for modern applications.
Person with short dark hair and moustache, wearing a colorful plaid shirt, smiling outdoors in a forested mountain landscape.
Aleks Haugom
Senior Manager of GTM & Marketing
Blog

Why a Multi-Tier Cache Delivers Better ROI Than a CDN Alone

Learn why a multi-tier caching strategy combining a CDN and mid-tier cache delivers better ROI. Discover how deterministic caching, improved origin offload, lower tail latency, and predictable costs outperform a CDN-only architecture for modern applications.
Aleks Haugom
Jan 2026
Blog

Why a Multi-Tier Cache Delivers Better ROI Than a CDN Alone

Learn why a multi-tier caching strategy combining a CDN and mid-tier cache delivers better ROI. Discover how deterministic caching, improved origin offload, lower tail latency, and predictable costs outperform a CDN-only architecture for modern applications.
Aleks Haugom
Blog

Why a Multi-Tier Cache Delivers Better ROI Than a CDN Alone

Learn why a multi-tier caching strategy combining a CDN and mid-tier cache delivers better ROI. Discover how deterministic caching, improved origin offload, lower tail latency, and predictable costs outperform a CDN-only architecture for modern applications.
Aleks Haugom
Tutorial
GitHub Logo

Real-Time Pub/Sub Without the "Stack"

Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
Harper Learn
Tutorial
Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
A man with short dark hair, glasses, and a goatee smiles slightly, wearing a black shirt in front of a nature background.
Ivan R. Judson, Ph.D.
Distinguished Solution Architect
Tutorial

Real-Time Pub/Sub Without the "Stack"

Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
Ivan R. Judson, Ph.D.
Jan 2026
Tutorial

Real-Time Pub/Sub Without the "Stack"

Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
Ivan R. Judson, Ph.D.
Tutorial

Real-Time Pub/Sub Without the "Stack"

Explore a real-time pub/sub architecture where MQTT, WebSockets, Server-Sent Events, and REST work together with persistent data storage in one end-to-end system, enabling real-time interoperability, stateful messaging, and simplified service-to-device and browser communication.
Ivan R. Judson, Ph.D.
News
GitHub Logo

Harper Recognized on Built In’s 2026 Best Places to Work in Colorado Lists

Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Announcement
News
Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Colorful geometric illustration of a dog's head resembling folded paper art in shades of teal and pink.
Harper
News

Harper Recognized on Built In’s 2026 Best Places to Work in Colorado Lists

Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Harper
Jan 2026
News

Harper Recognized on Built In’s 2026 Best Places to Work in Colorado Lists

Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Harper
News

Harper Recognized on Built In’s 2026 Best Places to Work in Colorado Lists

Harper is honored as a Built In 2026 Best Startup to Work For and Best Place to Work in Colorado, recognizing its people-first culture, strong employee experience, and values of accountability, authenticity, empowerment, focus, and transparency that help teams thrive and grow together.
Harper
Comparison
GitHub Logo

Harper vs. Standard Microservices: Performance Comparison Benchmark

A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
Comparison
A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
Person with short dark hair and moustache, wearing a colorful plaid shirt, smiling outdoors in a forested mountain landscape.
Aleks Haugom
Senior Manager of GTM & Marketing
Comparison

Harper vs. Standard Microservices: Performance Comparison Benchmark

A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
Aleks Haugom
Dec 2025
Comparison

Harper vs. Standard Microservices: Performance Comparison Benchmark

A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
Aleks Haugom
Comparison

Harper vs. Standard Microservices: Performance Comparison Benchmark

A detailed performance benchmark comparing a traditional microservices architecture with Harper’s unified runtime. Using a real, fully functional e-commerce application, this report examines latency, scalability, and architectural overhead across homepage, category, and product pages, highlighting the real-world performance implications between two different styles of distributed systems.
Aleks Haugom
Tutorial
GitHub Logo

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Harper Learn
Tutorial
Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
A man with short dark hair, glasses, and a goatee smiles slightly, wearing a black shirt in front of a nature background.
Ivan R. Judson, Ph.D.
Distinguished Solution Architect
Tutorial

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Ivan R. Judson, Ph.D.
Dec 2025
Tutorial

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Ivan R. Judson, Ph.D.
Tutorial

A Simpler Real-Time Messaging Architecture with MQTT, WebSockets, and SSE

Learn how to build a unified real-time backbone using Harper with MQTT, WebSockets, and Server-Sent Events. This guide shows how to broker messages, fan out real-time data, and persist events in one runtime—simplifying real-time system architecture for IoT, dashboards, and event-driven applications.
Ivan R. Judson, Ph.D.