I'm stuck with this. I would appreciate some help from you guys.
I'm building a blogging platform as SaaS. Something similar to ghost.org.
Users can sign up and create a blog instantly. They can connect to their own domain.
Each blog will have its own database.
Should I go for multi-tenancy or should I create an instance of the software for every user?
The problem I want to figure out is how can I create an instance of the blog for every user.
What server should I use to do that? Can I do it on was?
Thanks in advance
Why do you need multi-tenancy / separate databases? Unless it's important to you for some reason I'd stay away since it adds a lot of complexity, especially in the beginning.
Completely agree. Unless you have some enterprise type of SaaS with a minimum price of $1000 per month, I’d stick with just one DB.
It’s very easy to have multiple tenants, but still in the same DB.
I think you need to create a shell script which will execute series of commands if you need to do inside same server. If you want to do in container/separate vm instances then check terraform.
I'm not sure why many says no point in it. You (others) could think of cloud over shared hosting.
I will assume that "instance" is from a user's perspective.
Here is how I would do it:
it’s actually super easy. just check if the user is == name then create a url, database with that name and show things whenever user is equals to that name
I am not sure why this cannot be done within single schema so i am assuming you have your reasons of doing so.
If you want separate db's you can use 1 sqlite file per customer and interaction with any customer would start from opening customer specific file.
If you don't want to use sqlite you can have container based architecture with the associated setting up of clusters and kubernete etc.
If you are using postgres you can enable RLS as mentioned here https://aws.amazon.com/blogs/database/multi-tenant-data-isolation-with-postgresql-row-level-security/
Can you elaborate more on why you want to have a single instance of the blog per user?
Multi database apps are really hard to setup, to maintain and the needs for those are very specific.
I’d go with the classical SQL table with relationship between blog, user and post. It’s simpler to setup and easier to run.
Not sure why you need a separate db instance for each user. Why not go with a traditional relational database with a mapping of user_id -> blog_post_id? You could model this easily with a nosql database as well. Maybe understanding the problem a bit more could help understand why you need additional complexity.
I've just completed a full dedicated setup (a whole system from load balancers, web servers, workers server, database, cache servers, etc) for a big customer. The whole cluster costs about $100, and I charge $1000 for the setup fee and then $1000/month.
It's sweet money, but I'm not going to do this again. It won't scale well. The added complexity and maintenance may bite me back in the future.
I'd rather spend that time on improving the main website so everyone can benefit.
of course you can, try deta.sh deta space
This comment was deleted 4 years ago
This comment was deleted 3 years ago
This comment was deleted 4 years ago