Choosing the Right Backend and Database Structure for a SaaS/Webapp with Webflow

Hi all,

I am new to software development and am creating a SaaS/webapp via Webflow for users to browse through different company market research and I now need to choose my back-end tools and also choose the right type of database type/structure.

Current database structure

My current data structure/layout is as follows (CSV file):

image

  • I expect to have 900 research questions/rows and 8.000 companies/columns so that’s about ~ 7m records.

  • Each record/research question contains only extensive text.

  • On my webflow website, I am planning to have one webpage per company (or database filter) displaying to the user the market research answers of the selected company dynamically on scroll of the page.

  • To fetch the data, I’ll use a Webflow API call to the external database.

  • User must be able to edit the data on the site, and the database then must be updated in the backend.

My questions

Is the above data structure/layout appropriate or do I need to change it?

What kind of database is best suited for my use case and why? (SQL/NonSQL etc.)

What kind of no code backend dev platform/API tool is best suited for my use case (eg. Zapier).

Sorry if I’ve missed anything and I am new to this, any help is much appreciated!


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Hi @Jake_NL your approach is a bit naive due of your lack of knowledge but that’s absolutely fine. Keep in mind that SaaS and DB queries are not easy to set up correctly . As I was lazy to type here is what “4o” generated and I found it as good enough to start with.

The only part I do not understand is

Why a user will have permissions to change content??? I this some “Questionary” or what?

Anyway, here we go.

1. Data Structure/Layout

Your current data structure, as described, is a CSV file with:

  • Rows representing research questions (~900 rows)
  • Columns representing companies (~8,000 columns)
  • Each cell containing extensive text answers

While this flat-file approach works for small datasets, it’s not efficient or scalable for larger datasets like yours. A relational database or a document-based NoSQL database would be more appropriate.### 2. Database Choice

Relational Database (SQL):

  • Pros:
    • Enforces data integrity through schema and relationships.
    • Powerful querying capabilities with SQL.
    • Suitable for structured data with relationships.
    • Examples: PostgreSQL, MySQL, SQLite
  • Cons:
    • Can be complex to scale horizontally.
    • Schema changes can be challenging with very large datasets.

Document-based NoSQL Database (e.g., MongoDB):

  • Pros:
    • Flexible schema design, ideal for unstructured or semi-structured data.
    • Easier horizontal scaling.
    • Good for storing nested data (e.g., JSON documents).
  • Cons:
    • No enforced relationships, which can lead to data inconsistency.
    • Complex querying can be less efficient compared to SQL databases.

Given your use case, a relational database might be more appropriate due to the structured nature of your data (questions and companies).

2. No-Code Backend Development Platforms/API Tools

Several no-code and low-code platforms can help you build and manage your backend without extensive coding:

  1. Airtable:
  • User-friendly interface for database management.
  • API for integration with Webflow.
  • Best for simple to moderately complex databases.
  1. Zapier:
  • Excellent for automating workflows between apps.
  • Can be used to connect Webflow with your database.
  1. Retool:
  • Powerful for building internal tools.
  • Can connect to various databases and APIs.
  • Allows building custom interfaces for data management.
  1. Firebase:
  • Backend-as-a-Service (BaaS) offering real-time databases and APIs.
  • Easy integration with web and mobile apps.
  • Best for real-time data syncing and NoSQL structures.

Recommended Setup

  1. Database: Use PostgreSQL or MySQL for your relational database needs. These databases offer strong support for complex queries and data integrity, which will be beneficial given your structured dataset.
  2. Backend Management: Use Retool for creating internal tools to manage and update your data. Retool can connect directly to your database and provide a user-friendly interface for CRUD operations.
  3. Integration with Webflow: Use Zapier to automate the data fetching and updating process between Webflow and your database. Alternatively, consider using Webflow’s native integrations if they meet your needs.

Example Workflow

  1. Data Entry/Management:
  • Use Retool to create an interface for managing research questions, companies, and answers.
  • This interface will write directly to your PostgreSQL/MySQL database.
  1. Data Fetching:
  • Webflow makes API calls to your database via an intermediary service (e.g., a custom Node.js/Express API hosted on Heroku or AWS Lambda).
  • This service fetches the relevant data for the selected company and returns it to Webflow.
  1. Data Updating:
  • Users edit data on the Webflow site.
  • Webflow triggers an API call (via Zapier or a custom service) to update the database with the new data.

Conclusion

By transitioning to a relational database structure and leveraging tools like Retool and Zapier, you can create a scalable and efficient backend for your SaaS/webapp. This setup will support dynamic data fetching and updating while maintaining data integrity and performance.

PART TWO

Since you’re developing a SaaS application, you should include a User table to manage user information and permissions. This table will help you track who is accessing the data and control their access rights.

Database Schema

1. Companies Table:

  • company_id (Primary Key)
  • company_name
  • Other company-specific fields

2. Questions Table:

  • question_id (Primary Key)
  • question_text

3. Answers Table:

  • answer_id (Primary Key)
  • company_id (Foreign Key)
  • question_id (Foreign Key)
  • answer_text

4. Users Table:

  • user_id (Primary Key)
  • username
  • email
  • password_hash
  • role (e.g., admin, editor, viewer)
  • Other user-specific fields

5. UserPermissions Table (if you need fine-grained permissions):

  • user_id (Foreign Key)
  • company_id (Foreign Key)
  • permissions (e.g., read, write)

Relational Database Structure

  1. Companies Table:

    • company_id (Primary Key)
    • company_name
  2. Questions Table:

    • question_id (Primary Key)
    • question_text
  3. Answers Table:

    • answer_id (Primary Key)
    • company_id (Foreign Key)
    • question_id (Foreign Key)
    • answer_text
  4. Users Table:

    • user_id (Primary Key)
    • username
    • email
    • password_hash
    • role (e.g., admin, editor, viewer)
  5. UserPermissions Table (Optional):

    • user_id (Foreign Key)
    • company_id (Foreign Key)
    • permissions (e.g., read, write)

Updated Workflow

  1. Data Entry/Management:

    • Use Retool to create an interface for managing research questions, companies, answers, and users.
    • This interface will write directly to your PostgreSQL/MySQL database.
  2. User Authentication and Authorization:

    • Implement user authentication (e.g., using JWT tokens or sessions) and authorization to control access to the data.
    • Use a library like Passport.js for Node.js if you’re using a custom backend.
  3. Data Fetching:

    • Webflow makes API calls to your backend service (e.g., a Node.js/Express API).
    • This service fetches the relevant data for the authenticated user and returns it to Webflow.
  4. Data Updating:

    • Users edit data on the Webflow site.
    • Webflow triggers an API call (via Zapier or a custom service) to update the database with the new data, respecting user permissions.

Example User Table Entry

user_id username email password_hash role
1 john_doe john@example.com $2a$10$CwTycUXWue0Thq9StjUM0u admin
2 jane_doe jane@example.com $2a$10$7VdIHnSxjTmsq3AEZG8LR. editor

Example UserPermissions Table Entry

user_id company_id permissions
1 101 read, write
2 102 read

Backend Platforms and Tools

@Stan note: These following options are just pure base info and you can use other tools as eg. Supabase has comprehensive Authentication and User permissions included etc.

Authentication and Authorization:

  • Auth0: Easy to integrate, supports various authentication methods, and scales well.
  • Firebase Authentication: Simple integration, especially if you use Firebase for other backend services.

Database Management:

  • Retool: For building internal tools and admin panels.
  • Supabase: An open-source alternative to Firebase, with integrated authentication and database management.

Integration with Webflow:

  • Zapier: For simple integration tasks.
  • Custom Backend: A Node.js/Express API hosted on a platform like Heroku or AWS Lambda for more control and flexibility.

By including a User table and handling user authentication and permissions, you can ensure your SaaS application is secure and scalable, providing appropriate access to users based on their roles and permissions.


NOTE: I personally will do not create SaaS in WF

m2c

1 Like

If you’re not a ninja JS developer you could potentially build this using Wized + Xano, with a database like Supabase.

That gives you the tooling you need for the UX work, admin interfaces, query interfaces, reporting interfaces, and authentication ( Wized ), your API layer ( Xano ) and your data layer.

1 Like

thanks all, much appreciated the answers, i will start working on it

why not create saas in WF?

WF is predominately focused on front-end (Design) and do many things on Client site. Because WF struggle with back-end leaves this part to 3-rd party services and your project code will be all over in many different places.

I like to have my code all together in one project and only connect to DB or CMS. Than publish on server (Vercel, Fly, …) and job done easy to maintain. There is for me personally as developer many red flags for creating SaaS in WF.

Like @memetican mentioned these services like Xano can be solution and they have good reputation so you can built your SaaS in WF and see how it will work for you.

Good luck