Skip to content

go-saas/saas

Folders and files

NameName
Last commit message
Last commit date
Oct 2, 2023
Jun 21, 2022
May 21, 2022
Oct 8, 2023
Apr 8, 2024
Oct 2, 2022
Jun 26, 2022
Aug 4, 2023
Jun 26, 2022
Oct 2, 2023
Jun 26, 2022
Jun 26, 2022
Nov 21, 2020
Nov 18, 2020
Oct 2, 2023
Jun 26, 2022
Jun 23, 2022
Jun 26, 2022
Dec 24, 2022
Jun 23, 2022
Oct 8, 2023
Oct 8, 2023
Jun 26, 2022
Jun 23, 2022
Jun 23, 2022
Jun 26, 2022
Nov 1, 2023
Jun 23, 2022
Nov 1, 2023
Jun 23, 2022
Apr 5, 2024
Jun 23, 2022
Jun 23, 2022
Jun 23, 2022
Jun 23, 2022
Jun 23, 2022

Repository files navigation

go-saas

English | 中文文档

headless go framework for saas(multi-tenancy).
go-saas targets to provide saas solution for go this project suits for simple (web) project, which is also called monolithic.

if you are finding complete solution which is microservice compatible, please refer to go-saas-kit

Overview

Feature

  • Different database architecture

    • Single-tenancy: Each database stores data from only one tenant.

    img.png

    • Multi-tenancy: Each database stores data from multiple separate tenants (with mechanisms to protect data privacy).

    img.png

    • Hybrid tenancy models are also available.

    • Implement your own resolver to achieve style like sharding

  • Support multiple web framework

  • Supported orm with data filter, which means all underlying database

  • Customizable tenant resolver

    • Query String
    • Form parameters
    • Header
    • Cookie
    • Domain format
  • Seed and Migration

    • Seed/Migrate tenant database after creation or upgrade to new version
  • Integration with gateway

Install

go get github.com/go-saas/saas

Design

Loading
graph TD
    A(InComming Request) -->|cookie,domain,form,header,query...|B(TenantResolver)
    B --> C(Tenant Context)  --> D(ConnectionString Resolver)
    D --> E(Tenant 1) --> J(Data Filter) -->  H(Shared Database)
    D --> F(Tenant 2) --> J
    D --> G(Tenant 3) --> I(Tenant 3 Database)

Sample Project

  • example-gorm combination of go-saas,gin,gorm(sqlite/mysql)
  • example-ent combination of go-saas,gin,ent(sqlite)
  • go-saas-kit Microservice architecture starter kit for golang sass project

Documentation

Refer to wiki

References

https://docs.microsoft.com/en-us/azure/azure-sql/database/saas-tenancy-app-design-patterns