fly-atc 0.0.8 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -74
- data/lib/fly-atc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 056352f3a183ece8cc3cdbc17834d76ed9120895593f249aacf98a04debb2141
|
4
|
+
data.tar.gz: a0057e9884a727fcc73fb69bc8d7753c4c46532a12c771555341c41cc5b01483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c362b8693c15917982851986cd2c6185c89d56e961b909c97fefa45913a5ecff830236d1bddf100388b0ace42cebd9123a072fa77c18bd6962042df0f0c31fe5
|
7
|
+
data.tar.gz: 9737d9704d44bd8345113e2b2cd1594983be801f7dce4b8b78878369bcf0b56911e9f1c7909672d2bd2cd6367a41bd73ac9f03314a5b16fe2955fcdf9eb42fb9
|
data/README.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
A SaaS toolkit for converting a personal application into a efficient, siloed, multi-tenant application, where each user of your application is assigned a dedicated virtual machine.
|
4
4
|
|
5
|
-
**
|
5
|
+
*** **Work in Progress** ***
|
6
|
+
|
7
|
+
Do not use in production just yet.
|
6
8
|
|
7
9
|
## Usage
|
8
10
|
|
@@ -24,79 +26,13 @@ bin/rails generate atc
|
|
24
26
|
|
25
27
|
Edit `config/atc.yml` as needed.
|
26
28
|
|
27
|
-
For approximately $1 US per month, you can run:
|
28
|
-
* [1 performance machine with 2Gb of RAM, 10GB of bandwidth, and 5GB of storage for 15 hours/month](https://fly.io/calculator?m=0_0_0_0_0&f=c&b=iad.10&a=no_none&r=shared_0_1_iad&t=10_100_5&u=0_1_100&g=1_performance_15_1_2048_iad_1024_0).
|
29
|
-
* [1 shared machine with 1Gb of RAM, 10GB of bandwidth, and 5GB of storage for 80 hours/month](https://fly.io/calculator?m=0_0_0_0_0&f=c&b=iad.10&a=no_none&r=shared_0_1_iad&t=10_100_5&u=0_1_100&g=1_shared_80_1_1048_iad_1024_0).
|
30
|
-
|
31
29
|
Vertical scaling can be achieved by adding more machines.
|
32
30
|
|
33
|
-
##
|
34
|
-
|
35
|
-
I've been running my [Showcase](https://github.com/rubys/showcase?tab=readme-ov-file#showcase) software for nearly three years. Things have changed over time that I now want to take advantage of. I want take the opportunity to package those changes in the form of a toolkit that others can take advantage of.
|
36
|
-
|
37
|
-
From Wikipedia description of [SaaS](https://en.wikipedia.org/wiki/Software_as_a_service):
|
38
|
-
|
39
|
-
> SaaS customers have the abstraction of limitless computing resources, while [economy of scale](https://en.wikipedia.org/wiki/Economy_of_scale) drives down the cost. SaaS architectures are typically [multi-tenant](https://en.wikipedia.org/wiki/Multi-tenant); usually they share resources between clients for efficiency, but sometimes they offer a siloed environment for an additional fee.
|
40
|
-
|
41
|
-
The focus of this toolkit is efficient, siloed, multi-tenant applications *with no changes to the application*, taking advantage of:
|
42
|
-
|
43
|
-
* [Auto-suspend](https://community.fly.io/t/autosuspend-is-here-machine-suspension-is-enabled-everywhere/20942) - Virtual Machines that pop into existence when needed and disappear when not in use.
|
44
|
-
* [SQLite ready for production](https://rubyonrails.org/2024/11/7/rails-8-no-paas-required#getting-sqlite-ready-for-production) - raw performance coupled with operational compression of complexity; see [Supercharge the One Person Framework with SQLite: Rails World 2024](https://fractaledmind.github.io/2024/10/16/sqlite-supercharges-rails/).
|
45
|
-
* [Litestream](https://litestream.io/) - No-worry backups. Virtual machines can be literally destroyed and recreated elsewhere and start back up exactly where they left off.
|
46
|
-
* [Tigris Global Storage](https://fly.io/docs/tigris/) - globally caching, S3-compatible object storage.
|
47
|
-
|
48
|
-
That's a lot of moving parts. I've documented my [current architecture](https://github.com/rubys/showcase/blob/main/ARCHITECTURE.md) and published a [blueprint](https://fly.io/docs/blueprints/shared-nothing/).
|
49
|
-
|
50
|
-
The goal of fly-atc is to enable you configure multiple tenants and then not worry about this further, enabling you to focus on your application.
|
51
|
-
|
52
|
-
## Approach
|
53
|
-
|
54
|
-
For illustrative purposes consider a SaaS Calender application implemented in Ruby on Rails using SQLite3 as the database. (My showcase application is a bit more involved than a calendar, but those details aren't important).
|
55
|
-
|
56
|
-
Key concepts:
|
57
|
-
|
58
|
-
* Each user/customer has a primarly location, and is assigned a single machine near that location. Such machines can be accessed from anywhere, but have lower latency near that location.
|
59
|
-
* Each user can have multiple calendars. Each calendar is associated with a single tenant on the user's machine. Each tenant consists a running instance of the web server application with one ([or more](https://rubyonrails.org/2024/11/7/rails-8-no-paas-required#a-solid-reduction-of-dependencies)) databases.
|
60
|
-
|
61
|
-
With that in mind, consider the following URL paths:
|
62
|
-
|
63
|
-
* `/bellevue/2025/winter/`
|
64
|
-
* `/bellevue/2025/summer-medal-ball/`
|
65
|
-
* `/bellevue/2025/summer-showcase/`
|
66
|
-
* `/boston/2025/april/`
|
67
|
-
* `/boston/2025/mini-comp/`
|
68
|
-
* `/boston/2025/october/`
|
69
|
-
* `/livermore/2025/the-music-of-prince/`
|
70
|
-
* `/livermore/2025/james-bond/`
|
71
|
-
* `/raleigh/2025/disney/`
|
72
|
-
* `/raleigh/2025/in-house/`
|
73
|
-
|
74
|
-
The first segment of the path identifies the user, and therefore the machine. The next two segments combined identify the tenant on that machine. This is but a subset of the planned showcases, you can see a [full list](https://smooth.fly.dev/showcase/) or even a [map](https://smooth.fly.dev/showcase/regions/) (click on the arrows under the map to move to different continents).
|
75
|
-
|
76
|
-
`fly-atc`'s responsibilities are to:
|
77
|
-
* Route requests to the correct machine
|
78
|
-
* Ensure databases are present/restored from backup
|
79
|
-
* Start/stop tenants as required
|
80
|
-
* Hand off requests to tenants
|
81
|
-
|
82
|
-
Rails 8 introduces [thruster](https://rubyonrails.org/2024/11/7/rails-8-no-paas-required#enter-kamal-2--thruster). `fly-atc` is a replacement for thruster:
|
83
|
-
* thruster requires no configuration, is limited to a single tenant.
|
84
|
-
* fly-atc enables multiple tenants, based on your configuration.
|
85
|
-
|
86
|
-
## Implementation
|
87
|
-
|
88
|
-
Based on:
|
89
|
-
* [Thruster](https://github.com/basecamp/thruster) ([announcement](https://dev.37signals.com/thruster-released/))
|
90
|
-
* [tinyrp](https://github.com/pgaijin66/tinyrp) ([docs](https://prabeshthapa.medium.com/learn-reverse-proxy-by-creating-one-yourself-using-go-87be2a29d1e))
|
91
|
-
|
92
|
-
Near term plans:
|
93
|
-
|
94
|
-
* Remove certificate/https support
|
95
|
-
* Add launch on request / shutdown on idle
|
96
|
-
* Add [fly-replay](https://fly.io/docs/networking/dynamic-request-routing/)
|
97
|
-
|
98
|
-
On the radar:
|
31
|
+
## More information:
|
99
32
|
|
100
|
-
*
|
101
|
-
*
|
102
|
-
*
|
33
|
+
* [Overview](./docs/overview.md) - why this toolkit was created.
|
34
|
+
* [Demo](./docs/demo.md) - up and running in minutes.
|
35
|
+
* [Config](./docs/config.md) - configuration options
|
36
|
+
* [Iaas vs PaaS vs SaaS](./docs/paas.md) - Rails never needed a PaaS; Rails needs a PaaS now more than ever.
|
37
|
+
* [SQlite3](./docs/sqlite3.md) - perhaps Sqlite3 isn't right for you.
|
38
|
+
* [Todos](./docs/todos.md) - where we go from here.
|
data/lib/fly-atc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fly-atc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|