How to Choose a Database for a B2B SaaS Product

Choose a database technology (SQL, NoSQL, etc.) that matches your product requirements for consistency, scale, query patterns, and operational simplicity.

PlayersCTO, Engineering Lead
Initial Effort21 SP
Ongoing5 SP
FrequencyAs Needed
StagePre-Revenue

With a process in place to ensure your dev team is building the thing right, attention now needs to be paid to ensuring your company is utilizing the proper technology. Database selection is a key technical decision. The database is foundational to your technology and can cause serious issues if not chosen well.

The Goal: Systematically decide which database best serves your company's needs and priorities.

How can Golden Section Assist?

Background

Best Practices in Database Management:

  • Allow Multi-tenant Architecture at the database level
  • Do not allow multiple databases on a single customer (opposite of Multitenancy)
  • Streamlined Database Schema to simplify each release
  • Locate business logics on Web Services layer (i.e. code level) instead of Database level to reduce complexity in version updates.
  • Prioritize reducing Technical Debt in the Database Level. This improves the database performance and prevents data from being accumulated in the wrong structure, which would make future clean-up and migration extremely difficult

Golden Section's Pros and Cons for Popular Databases:

Oracle 12c

Ideal for: Large organizations that handle enormous databases and need a variety of features.

Pros

  • You'll find the latest innovations and features coming from their products since Oracle tends to set the bar for other database management tools.
  • Oracle database management tools are also incredibly robust, and you can find one that can do just about anything you can possibly think of.

Cons

  • The cost of Oracle can be prohibitive, especially for smaller organizations.
  • The system can require significant resources once installed, so hardware upgrades may be required to even implement Oracle.

MySQL

MySQL is one of the most popular databases for web-based applications. It's freeware, but it is frequently updated with features and security improvements.

Ideal for: Organizations that need a robust database management tool but are on a budget.

This database engine allows you to select from a variety of storage engines that enable you to change the functionality of the tool and handle data from different table types. It also has an easy to use interface, and batch commands let you process enormous amounts of data. The system is also incredibly reliable and doesn't tend to hog resources.

Pros

  • It's free.
  • It offers a lot of functionality even for a free database engine.
  • There are a variety of user interfaces that can be implemented.
  • It can be made to work with other databases, including DB2 and Oracle.

Cons

  • You may spend a lot of time and effort to get MySQL to do things that other systems do automatically, like create incremental backups.
  • There is no built-in support for XML or OLAP.
  • Support is available for the free version, but you'll need to pay for it.

Microsoft SQL Server

Ideal for: Large organizations that use a number of Microsoft products.

Pros

  • It is very fast and stable.
  • The engine offers the ability to adjust and track performance levels, which can reduce resource use.
  • You are able to access visualizations on mobile devices.
  • It works very well with other Microsoft products.

Cons

  • Enterprise pricing may be beyond what many organizations can afford.
  • Even with performance tuning, Microsoft SQL Server can gobble resources.
  • Many individuals have issues using the SQL Server Integration Services to import files.

PostgreSQL

Ideal for: Organizations with a limited budget that want the ability to select their interface and use JSON.

This database management engine can be hosted in a number of environments, including virtual, physical and cloud-based environments. The latest version, PostgreSQL 9.5, offers larger data volumes and an increase in the number of concurrent users. Security has also been improved thanks to support for both DBMS\_SESSION and expanded password profiles.

Pros

  • This database management engine is scalable and can handle terabytes of data.
  • It supports JSON.
  • There are a variety of predefined functions.
  • A number of interfaces are available.

Cons

  • Documentation can be spotty, so you may find yourself searching online in an effort to figure out how to do something.
  • Configuration can be confusing.
  • Speed may suffer during large bulk operations or read queries.

MongoDB

MongoDB is designed for applications that use both structured and unstructured data. The database engine is very versatile. There is a comprehensive selection of drivers available, so it's easy to find a driver that will work with the programming language being used.

Since MongoDB wasn't designed to handle relational data models, even though it can, performance issues are likely to crop up if you attempt to use it this way.

Pros

  • It's fast and easy to use.
  • The engine supports JSON and other NoSQL documents.
  • Data of any structure can be stored and accessed quickly and easily.
  • Schema can be written without downtime.

Cons

  • SQL is not used as a query language.
  • Tools to translate SQL to MongoDB queries are available, but they add an extra step to using the engine.
  • Setup can be a lengthy process.
  • Default settings are not secure.

Steps

  1. Identify selection criteria. Use the template provided to identify the 5-6 factors that are most important to your company. It is unlikely one database can answer all your needs, so the priorities
  2. Identify a database shortlist. Using Golden Section's list of popular databases above, choose 3-4 databases you want to evaluate.
  1. Enter your identified selection criteria and database shortlist into the template provided.
  2. Research whether each database on your shortlist meets the selection factor. For factors that don't lend themselves to a simple "meet" or "does not meet," you can rank to what degree the factor meets your needs (i.e. 5 = closely meets, 1 = does not meet).
  3. Upon completion of your decision matrix, choose the database that best meets your needs and priorities.
  4. Technical Debt: Work with your dev team to identify and then mitigate sources of Technical Debt in your Database Level.
Mistakes this play prevents: #2 #9 #12

Questions this play answers

Should I use a SQL or NoSQL database?

) that matches your product requirements for consistency, scale, query patterns, and operational simplicity.

What databases work best for SaaS?

) that matches your product requirements for consistency, scale, query patterns, and operational simplicity.

How do I evaluate database performance?

Prioritize reducing Technical Debt in the Database Level.

How do I plan for database scaling?

) that matches your product requirements for consistency, scale, query patterns, and operational simplicity.

What's the cost impact of database choice?

) that matches your product requirements for consistency, scale, query patterns, and operational simplicity.