Coder Social home page Coder Social logo

saas's Introduction

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

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

saas's People

Contributors

goxiaoy avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.