-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:supertokens/blog into blog/vendor…
…-lockin
- Loading branch information
Showing
28 changed files
with
409 additions
and
21 deletions.
There are no files selected for viewing
Binary file added
BIN
+46.1 KB
content/all-you-need-to-know-about-user-session-security/image153x-p-800.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.2 KB
content/all-you-need-to-know-about-user-session-security/image163x-p-800.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.4 KB
content/all-you-need-to-know-about-user-session-security/image173x-p-800.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56.2 KB
content/all-you-need-to-know-about-user-session-security/image183x-p-800.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+111 KB
content/all-you-need-to-know-about-user-session-security/image193x-p-800.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+419 KB
content/all-you-need-to-know-about-user-session-security/image203x-p-800.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
284 changes: 284 additions & 0 deletions
284
content/all-you-need-to-know-about-user-session-security/index.md
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+3.98 MB
content/all-you-need-to-know-about-user-session-security/manwavinghands.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: How we used multi-tenancy to cut our AWS costs by 50% | ||
date: "2023-10-01" | ||
description: "Part 2 in a series of howe we were able to cut down our AWS infrastructure costs by more than 50%" | ||
cover: "how-we-cut-our-aws-costs-part-2.png" | ||
category: "programming" | ||
author: "Joel Coutinho" | ||
--- | ||
|
||
[**Part 1: How does the SuperTokens managed service work and why does it need to change.**](./how-we-cut-our-aws-costs/) | ||
|
||
**Part 2: Using multi-tenancy to cut our AWS infra costs by by more than 50%** | ||
|
||
In this part we will go over SuperTokens Multi-tenancy feature and how it evolved our deployment cycle to cut our AWS billing by 50%. | ||
|
||
Here's what we covered in our [last post](./how-we-cut-our-aws-costs/): | ||
- SuperTokens infrastructure and deployment cycle. | ||
- Improvements made to the SuperTokens deployment cycle to speed up production deployment times by 30% | ||
- How our infra costs were not sustainable and why it needed to change. | ||
|
||
## What is multi-tenancy? | ||
|
||
As mentioned in Part 1, "We saw multi-tenancy as an opportunity to optimize the utilization of our EC2 instances by consolidating our core instances. This would cut down our costs while also providing the expected performance"... But what does that mean? Lets break it down. Multi-tenancy is a feature, typically used by B2B SaaS companies to allow multiple organizations to sign up to their SaaS app, with the ability for each organization to have their own login methods or SSO configurations. Additionally, user pools can also be segmented. Heres how it helped us. | ||
|
||
## How we implemented SuperTokens Multi-tenancy | ||
|
||
With multi-tenancy we re-architected the way we host and manage our users. Initially whenever a signed up and created an app with SuperTokens, it would trigger the following flow: | ||
|
||
![SuperTokens Old Deployment Process](./supertokens-deployment-process.png) | ||
|
||
In this process each development and production SuperTokens core ran in their own separate EC2 instances. With Multi-tenancy we now treat all SuperTokens customers as tenants. This means that we could now host multiple users on a single SuperTokens instance. Our deployment process now looks like this: | ||
|
||
![SuperTokens New Deployment Process](./supertokens-deployment-process-new.png.png) | ||
|
||
As you can see in the new deployment strategy, when a new user signs up, we now create a new tenant in a SuperTokens instance. These instances run in `T3 large` instances. In our testing, for development mode, up to 100 tenants can be run seamlessly on a single instance and for production mode, up to 50 tenants can be created on single instance. | ||
|
||
![SuperTokens infrastructure](./supertokens-infrastructure.png) | ||
|
||
## What are the benefits of the new architecture? | ||
|
||
### 1. Cost Savings | ||
|
||
Well the biggest difference post this change is the cost savings. | ||
|
||
Heres a bill for the month of July before the multi-tenancy changes kicked-in: | ||
|
||
![SuperTokens AWS bill for July](./supertokens-aws-bill-july.png) | ||
|
||
And heres the bill for September, post the changes going live | ||
|
||
![SuperTokens AWS bill for September](./supertokens-aws-bill-september.png) | ||
|
||
When compared, its **54%** down | ||
|
||
![SuperTokens Pricing comparison](./supertokens-pricing-comparison.png) | ||
|
||
### 2. Improved start up time | ||
|
||
Another improvement was app startup time. In the new architecture, creating a new user is as simple as creating a new tenant. When compared to the old process, the new architecture is about 94% faster and new apps can be crated in seconds. | ||
|
||
|
||
## Conclusion | ||
|
||
Multi-tenancy with SuperTokens is a powerful feature that enables businesses to create unique authentication flows for their customers, segment users into unique user pools and automatically create new new tenants. For SuperTokens, multi-tenancy allowed us to consolidate our user applications to save on resources, but, your use case maybe very different. You can learn more about how multi-tenancy works and the experiences it enables by visiting the [multi-tenancy feature page](https://supertokens.com/features/multi-tenancy) |
Binary file added
BIN
+73.7 KB
content/how-we-cut-our-aws-costs-part-2/supertokens-aws-bill-july.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+80.6 KB
content/how-we-cut-our-aws-costs-part-2/supertokens-aws-bill-september.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.5 KB
content/how-we-cut-our-aws-costs-part-2/supertokens-deployment-process-new.png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33 KB
content/how-we-cut-our-aws-costs-part-2/supertokens-deployment-process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.6 KB
content/how-we-cut-our-aws-costs-part-2/supertokens-infrastructure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+96.8 KB
content/how-we-cut-our-aws-costs-part-2/supertokens-pricing-comparison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-489 Bytes
(97%)
static/card_covers/how-to-create-an-invite-only-auth-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.