Skip to content

Commit 88e75a4

Browse files
committed
Update readmes
1 parent 3e9c394 commit 88e75a4

File tree

2 files changed

+172
-1
lines changed

2 files changed

+172
-1
lines changed

PRICING.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
- [pricingsaas saas pricing models](https://pricingsaas.com/saas-pricing-models.html)
2+
- [reddit r web_design comments x0knh7 subscription_fee_vs_flat_rate](https://www.reddit.com/r/web_design/comments/x0knh7/subscription_fee_vs_flat_rate/)
3+
4+
# No metering
5+
6+
- Infra is expensive and time consuming to build
7+
- Need a lot of requests to gain more profit which for a freelance project probably won't be much
8+
9+
## Monthly Hosting
10+
11+
> This does not include cost for building the website
12+
13+
- $20/month base cost
14+
- Unlimited seats
15+
- Free subdomain
16+
- DIY page management
17+
- Analytics
18+
- Maintenance and security updates
19+
- Lifetime access to new components and features added to our CMS
20+
- Page view usage based pricing:
21+
- $0.0000640 per page view up to 2.5 million visits
22+
- $0.0000420 per page view for 2.5 million visits and above
23+
24+
### Add-ons
25+
26+
- Open AI GPT-3.5 Integration: $10/mo
27+
- Open AI GPT-4 Integration: $20/mo
28+
- Unlimited edits and page management: $100/mo
29+
- Unlimited edits with A/B testing: $200/mo (if we can implement a hands-off approach)
30+
- SEO, Branding, Marketing campaign: Contact Us
31+
- Personalized Recommendations:
32+
- Basic:
33+
- $15 for 10,000 recommendations
34+
- $1 for every 1000 recommendations after
35+
- Pro:
36+
- $60 for 100,000 recommendations
37+
- $1 for every 2000 recommendations after
38+
39+
#### Notes
40+
41+
- Page view: $0.0000320/page view
42+
- cloudrun x2 price as base price including cloudflare
43+
- 10 images (should have thick profits here)
44+
- 10 api requests
45+
- Page view: $0.0000640/page view
46+
- should give enough profit to cover for other infra
47+
- can give discount to big clients up to $.0000320
48+
- 2678400 (seconds in month) results in $171.4176
49+
50+
### Pitch
51+
52+
- Built on biggest cloud providers like Cloudflare, Google, Amazon, and Microsoft that provide enterprise grade security as well as amazing price to performance ratio due to economies of scale that will benefit business of all sizes
53+
- Poor security can be a potential source of headache and costs to address but by following industry best practices, you avoid these potential pitfalls and opportunity costs
54+
- Running our own services and infra on lower level cloud primitives is more difficult and time-consuming but gives us economies of scale which allow us to pass cost saving to users compared to relying Software as a Service companies which becomes exponentially expensive as you scale
55+
- Unparalleled scalability and availability using cutting edge serverless technologies that both scale up thousands of instances to meet demand and down to 0 when no users are using the website or app
56+
- Optimized for e-commerce
57+
- Lots of studies show that slow websites in e-commerce massively increases bounce rate
58+
- Optimal load times for peak conversions ranged from 1.8 to 2.7 seconds across device types
59+
- Just a 100-millisecond delay in load time hurt conversion rates by up to 7%
60+
- Optimal load times for lowest bounce rates ranged from 700ms to 1.2s across all device types
61+
- A two-second delay in load time hurt bounce rates by up to 103%
62+
- Pages with the lowest bounce rates had start render times ranging from 0.9 to 1.5 seconds
63+
- A two-second delay correlated with up to a 51% decrease in session length
64+
- [s3 amazonaws sofist marketing State+of+Online+Retail+Performance+Spring+2017+ +Akamai+and+SOASTA+2017 pdf](https://s3.amazonaws.com/sofist-marketing/State+of+Online+Retail+Performance+Spring+2017+-+Akamai+and+SOASTA+2017.pdf)
65+
- Uses qwik city, a next generation framework which is one of the fastest tools for building e-commerce sites and dynamic web applications
66+
- Runs your code at more than 300 locations across the globe providing the lowest latency possible
67+
- Our noctus image optimization service increase performance of image heavy sites by optimizing quality, converting to next generation formats like Avif and Webp, and serving the smallest image resolution possible based on the user's device. All that for a portion of the cost of other similar service providers like [cloudinary](https://cloudinary.com/pricing) which start out cheap but get crazy expensize as you scale
68+
- Optimized for Search Engine Optimization (SEO)
69+
- High core web vitals provide a good baseline for search engine rankings
70+
- Actual SEO work (marketing campaign, content creation, etc) not included
71+
72+
# Metering more profit
73+
74+
- $5-30/mo for db, devops, portal fee
75+
- try to get atleast $15-20 base to cover for expenses sufficiently
76+
- free unlimited DIY edits
77+
- free unlimited DIY creation of new static pages
78+
- usage based pricing. Pay for resources you use
79+
- Requests: $0.80/million requests or 0.0000008/request
80+
- Duration: 0.00003/second request duration
81+
- Shared CMS:
82+
- Dedicated Website:
83+
- Requests: $0.0000006/request
84+
- CPU Usage: $0.00000004/ms of cpu usage
85+
86+
# Metering
87+
88+
- Have a metering class or something
89+
- add response time middleware to express that adds duration to headers
90+
- we only measure duration and requests. But include the cpu and memory in the pricing (markup)
91+
- this comes out as less than .80/million request which is what I want anyway
92+
- get value from headers in pages then store in class state
93+
- get cloudflare to send it after request
94+
- if we using postgres, use ~pubsub~ cloud tasks api to queue the writes
95+
- [postgresql message id CAKhTGFWrx06KXEzS4K3Z1aCcEsqB3f62pbNdrpyJUOo7QD7k3w%40mail gmail com](https://www.postgresql.org/message-id/CAKhTGFWrx06KXEzS4K3Z1aCcEsqB3f62pbNdrpyJUOo7QD7k3w%40mail.gmail.com)
96+
- [reddit r devops comments oikwu7 comment h4x5znu utm_source share utm_medium web2x context 3](https://www.reddit.com/r/devops/comments/oikwu7/comment/h4x5znu/?utm_source=share&utm_medium=web2x&context=3)
97+
- See [../../../../../vimwiki/TIL/postgresql/Writing sql/Database Design.md#Horizontal partitioning: an example](../../../../../vimwiki/TIL/postgresql/Writing sql/Database Design.md#Horizontal partitioning: an example)
98+
- Then create a task that moves request data into a daily data or move to bigquery
99+
- mongodb is also an option but kinda prefer relational
100+
101+
102+
- $5-30/mo for db, devops, portal fee
103+
- try to get atleast $15-20 base to cover for expenses sufficiently
104+
- free unlimited DIY edits
105+
- free unlimited DIY creation of new static pages
106+
- unlimited number of users
107+
- usage based pricing. Pay for resources you use
108+
- Shared CMS:
109+
- Requests: $0.0000004/request
110+
- Duration: $0.00003/second request duration
111+
- Dedicated Website:
112+
- Requests: $0.0000003/request
113+
- CPU Usage: $0.00000002/ms of cpu usage
114+
- Dedicated Image Service:
115+
- Requests: $0.40/million requests
116+
- CPU: $0.00002400/vCPU-second
117+
- Memory: $0.00000250/GiB-second
118+
- Image storage cost depends on how often images are accessed and what devices your users are using (mobile devices, older browsers vs latest browsers)
119+
- For more info regarding the storage free see [cloud google storage pricing](https://cloud.google.com/storage/pricing)
120+
- Image caching cost: $0.15/GB
121+
- This reduces requests, cpu, memory charges to almost nothing so bulk of costs for images goes to this and storage
122+
- Built on biggest cloud providers like Cloudflare, Google, Amazon, and Microsoft that provide enterprise grade security as well as amazing price to performance ratio due to economies of scale
123+
- And since our pricing is based on the underlying provider, you can benefit from these extremely low prices as well whether you're a small business with a few users per month to a millions of users per month.
124+
- unparalleled performance using cutting edge serverless technologies like:
125+
- cloudflare workers which run your code at more than 300 locations across the globe [cloudflare network](https://www.cloudflare.com/network/) and allow scaling up to thousands of instances back down to 0
126+
- serverless containers which allow our servers to scale up and down to accomodate traffic. Scaling to 0 allows you to only pay for resources you use
127+
- self-hosted imagor service which reduce the costs of optimizing images compared to outsourcing to companies like [cloudinary pricing](https://cloudinary.com/pricing) which start out cheap but get crazy expensive as you scale
128+
- Optimized for e-commerce
129+
- [PUT ECOM STATS]
130+
- Uses qwik city, a next generation framework which is one of the fastest tools for building e-commerce sites
131+
- Optimized for Search Engine Optimization (SEO)
132+
- High core web vitals provide a good baseline for search engine rankings
133+
- Actual SEO work (marketing campaign, content creation, etc) not included
134+
- Add-ons:
135+
- $100/mo for unlimited edits by us
136+
- Open AI Integration:
137+
- $10/mo: GPT-3.5 model
138+
- $20/mo: GPT-4 (open AI's most capable model)
139+
- SEO, Branding, Marketing campaign

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868

6969
- Use timing middleware in addition to our custom utils
7070

71+
# Cloudflare
72+
73+
- Enable crawler hints when it lands on tf
74+
- Enable cloudflare argo routing $5
75+
- Enable reserve cache around $5
7176

7277
# Streaming
7378

@@ -79,11 +84,28 @@
7984
- Better to just rely on current cache config than streaming
8085
- If we have a really **slow** and **private** query, create a dedicated route using file-based routing to stream it or create a dedicated collection so that user can still edit the slug
8186

82-
- Another option is to create a separate collection for streaming like `PersonalizedPages` but we can't duplicate from one collection to another**
87+
- Another option is to create a separate collection for streaming like `PersonalizedPages` but we can't duplicate from one collection to another
8388
- This is a good approach since authed/private pages are usually the one that benefits from streaming as private cache is not useful
8489
- **Note**: For simple auth components like `logged in` in navbar, you can just hydrate it as client component and make it fetch so we still get to cache and save on resources
8590
- You can also stream which might help with core-web vitals but not sure since svelte is fast and with csr, the rest of the page is really fast because of caching even if the nav is slower (have to test)
91+
- **Warning**: Good idea but hard to execute since we can't know whethere a route is a `Page` or `PersonalizedPage`. We can query both I guess
92+
- Hard to optimize querying both. Usual problem of not knowing whether to stream, pull from kv or what.
93+
94+
- If we don't use `PersonalizedPages` collection, add an option in `contentType` called `private` so we can still identify whether to cache on cdn
95+
96+
- It's hard to identify whether to cache in redis/kv unlike with cache control headers because with cache-control headers we already have the data
97+
- What we can do is add an env variable called `ENABLE_KV_CACHING`, this is rough and not granular as even one page with dynamic data will disable caching
98+
- Or just disable clients creating new page and editing the slug. So we can create dedicated routes will specific caching behaviour for each page
99+
100+
### TLDR
86101

102+
- Disable clients creating new page and editing the slug. So we can create dedicated routes will specific caching behaviour for each page
103+
- This gives us the control we need for caching while still enabling the clients to update their page
104+
- ContentType:
105+
- 3 options: `dynamic`, `static`, `personalized`
106+
- Lock and if possible hide from users
107+
- Let it determine which options appear. Eg. Lock inventory count and price to `display: false` when `ContentType: static`. This forces clients to need us to change settings and make necessary adjustments on caching
108+
87109
## Header
88110

89111
- Separate socialMedia and megaMenu components so we can suspend them
@@ -93,3 +115,13 @@
93115
- Might actually be worse for rerenders since state changes causes whole root to rerender
94116
- Plus more messy
95117
-
118+
119+
120+
## Invalidated
121+
122+
- store image count in state
123+
- we only measure requests not duration since we assume reqs to be fast after the first transformation since we store in gcs
124+
- separate gcs buckets so we can measure storage costs per tenant
125+
- _means we need separate server like rsc or islands for secret_
126+
- **on second thought, just deploy separate imagor instances per client since image count is not a good metric to capture due to caching**
127+
- also you can only set one result storage url per imagor instances so sharing imagor instances will also share the result storage resulting in losing the ability to bill storage granularly

0 commit comments

Comments
 (0)