fly-atc 0.0.8-x86_64-darwin → 0.1.0-x86_64-darwin
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/exe/x86_64-darwin/fly-atc +0 -0
- 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: bd8823145ba563360f9cc1fac635024beff602a710c5011bf1f5a6197737973b
|
4
|
+
data.tar.gz: 1773340329b4de8961f1dbf003e01e278abd1be78897e0426a452155e10d1530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 848656baa452dc6a94d63e4b56bf4c27a85654172193fb79c66b5bedac64331c7c63ebc7bbe08cfe932d0fccf73f00ba1eb3e8ef77f11346a658f199c083ad4f
|
7
|
+
data.tar.gz: e26b80bde7d8b212cbc5a1f353f4a2afd445177e34ab4aad721b49796e945729ffb00a01ac6ef48ef0c0ebde0e97a3fbae3d19d679633d0b7aebca53c74ebdd3
|
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/exe/x86_64-darwin/fly-atc
CHANGED
Binary file
|
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: x86_64-darwin
|
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
|