Commit 2e1a82ca authored by Barnabas Kendall's avatar Barnabas Kendall

added Lightsail

parent d005ad08
Pipeline #160949835 passed with stages
in 1 minute and 24 seconds
......@@ -25,6 +25,11 @@
<td>{{awsPlan.description}} ({{awsPlan.name}})</td>
<td class="price">{{budget | price}}</td>
</tr>
<tr v-if="lightsailPlan.price">
<td>Amazon Lightsail</td>
<td>{{lightsailPlan.description}} ({{lightsailPlan.name}})</td>
<td class="price">{{lightsailPlan.price | price}}</td>
</tr>
<tr v-if="azurePlan.price">
<td>Azure Database</td>
<td>{{azurePlan.description}} ({{azurePlan.name}})</td>
......@@ -59,45 +64,49 @@
</div>
</template>
<script>
import priceFilter from './price.filter'
import {
budgetAWS,
budgetAzure,
budgetDigitalOcean,
budgetElephant,
budgetGCP,
budgetHeroku,
budgetScaleGrid
} from './dbaas'
import priceFilter from './price.filter'
import {
budgetAWS,
budgetAzure,
budgetDigitalOcean,
budgetElephant,
budgetGCP,
budgetHeroku,
budgetLightsail,
budgetScaleGrid
} from './dbaas'
export default {
name: 'DbaasBudgeter',
data () {
return { budget: 50 /* USD*/, presets: [15, 25, 50, 100, 150, 200, 300] }
export default {
name: 'DbaasBudgeter',
data () {
return { budget: 50 /* USD*/, presets: [15, 25, 50, 100, 150, 200, 300] }
},
computed: {
awsPlan () {
return budgetAWS(this.budget)
},
azurePlan () {
return budgetAzure(this.budget)
},
doPlan () {
return budgetDigitalOcean(this.budget)
},
elephantPlan () {
return budgetElephant(this.budget)
},
gcpPlan () {
return budgetGCP(this.budget)
},
herokuPlan () {
return budgetHeroku(this.budget)
},
lightsailPlan () {
return budgetLightsail(this.budget)
},
computed: {
awsPlan () {
return budgetAWS(this.budget)
},
azurePlan () {
return budgetAzure(this.budget)
},
doPlan () {
return budgetDigitalOcean(this.budget)
},
elephantPlan () {
return budgetElephant(this.budget)
},
gcpPlan () {
return budgetGCP(this.budget)
},
herokuPlan () {
return budgetHeroku(this.budget)
},
scaleGridPlan () {
return budgetScaleGrid(this.budget)
},
scaleGridPlan () {
return budgetScaleGrid(this.budget)
},
filters: { price: priceFilter }
}
},
filters: { price: priceFilter }
}
</script>
......@@ -31,7 +31,10 @@
</td>
</tr>
</table>
<div style="float:right">Average: {{averagePrice | price}}</div>
<div style="float:right">
<Badge>Cheapest</Badge>
<Badge type="warning">Median</Badge>
</div>
<h4>Vendor Monthly Price Estimates</h4>
<table>
<thead>
......@@ -41,37 +44,42 @@
<th>Price</th>
</tr>
</thead>
<tr :class="{cheapest: awsTotal === cheapestPrice }">
<tr :class="priceClass(awsTotal)">
<td>Amazon RDS</td>
<td>{{awsPlan.description}} ({{awsPlan.name}})</td>
<td class="price">{{awsTotal | price}}</td>
</tr>
<tr :class="{cheapest: azureTotal === cheapestPrice }">
<tr :class="priceClass(lightsailPlan.price)">
<td>Amazon Lightsail</td>
<td>{{lightsailPlan.description}} ({{lightsailPlan.name}})</td>
<td class="price">{{lightsailPlan.price | price}}</td>
</tr>
<tr :class="priceClass(azureTotal)">
<td>Azure Database</td>
<td>{{azurePlan.description}} ({{azurePlan.name}})</td>
<td class="price">{{azureTotal | price}}</td>
</tr>
<tr :class="{cheapest: doPlan.price === cheapestPrice }">
<tr :class="priceClass(doPlan.price)">
<td>Digital Ocean</td>
<td>{{doPlan.description}}</td>
<td class="price">{{doPlan.price | price}}</td>
</tr>
<tr :class="{cheapest: elephantPlan.price === cheapestPrice }">
<tr :class="priceClass(elephantPlan.price)">
<td>ElephantSQL</td>
<td>{{elephantPlan.description}} ({{elephantPlan.name}})</td>
<td class="price">{{elephantPlan.price | price}}</td>
</tr>
<tr :class="{cheapest: gcpTotal === cheapestPrice }">
<tr :class="priceClass(gcpTotal)">
<td>Google Cloud SQL</td>
<td>{{gcpPlan.description}}</td>
<td class="price">{{gcpTotal | price}}</td>
</tr>
<tr :class="{cheapest: herokuPlan.price === cheapestPrice }">
<tr :class="priceClass(herokuPlan.price)">
<td>Heroku Postgres</td>
<td>{{herokuPlan.description}} ({{herokuPlan.name}})</td>
<td class="price">{{herokuPlan.price | price}}</td>
</tr>
<tr :class="{cheapest: scaleGridPlan.price === cheapestPrice }">
<tr :class="priceClass(scaleGridPlan.price)">
<td>ScaleGrid</td>
<td>{{scaleGridPlan.description}} ({{scaleGridPlan.name}})</td>
<td class="price">{{scaleGridPlan.price | price}}</td>
......@@ -87,6 +95,7 @@ import {
getElephantPlan,
getGCPPlan,
getHerokuPlan,
getLightsailPlan,
getScaleGridPlan
} from './dbaas'
import priceFilter from './price.filter'
......@@ -134,19 +143,33 @@ export default {
herokuPlan () {
return getHerokuPlan(this.memoryGB, this.storageGB)
},
lightsailPlan () {
return getLightsailPlan(this.memoryGB, this.storageGB, this.cores)
},
scaleGridPlan () {
return getScaleGridPlan(this.memoryGB, this.storageGB, this.cores)
},
allPrices () {
const prices = [this.awsTotal, this.azureTotal, this.doPlan.price, this.elephantPlan.price, this.gcpTotal, this.herokuPlan.total, this.scaleGridPlan.total]
const prices = [
this.awsTotal,
this.azureTotal,
this.doPlan.price,
this.elephantPlan.price,
this.gcpTotal,
this.herokuPlan.total,
this.lightsailPlan.total,
this.scaleGridPlan.total
]
return prices.filter(p => p > 0)
.sort((a, b) => a - b)
},
averagePrice () {
medianPrice () {
const prices = this.allPrices
return prices.reduce((a, b) => a + b) / prices.length
if (prices.length < 2) return prices[0]
return prices[Math.floor(prices.length / 2)]
},
cheapestPrice () {
return this.allPrices.reduce((a, b) => Math.min(a, b))
return this.allPrices[0]
}
},
methods: {
......@@ -154,6 +177,12 @@ export default {
this.cores = preset.cores
this.storageGB = preset.storageGB
this.memoryGB = preset.memoryGB
},
priceClass (price) {
return {
cheapest: price === this.cheapestPrice,
median: price === this.medianPrice
}
}
},
filters: { price: priceFilter }
......@@ -161,7 +190,10 @@ export default {
</script>
<style>
.dbaas-calculator .cheapest {
background-color: rgba(66, 185, 131, 0.50);
background-color: rgba(66, 185, 131, 0.33);
font-weight: bolder;
}
.dbaas-calculator .median {
background-color: rgba(231, 192, 0, 0.33);
}
</style>
......@@ -105,6 +105,13 @@ const PLANS_HEROKU = [
{ name: 'Standard 6', memoryGB: 122, storageGB: 1500, price: 2000 },
].map(options => new StaticPlan(options))
const PLANS_LIGHTSAIL = [
{ name: '$15 Standard', memoryGB: 1, cores: 1, storageGB: 40, price: 15 },
{ name: '$30 Standard', memoryGB: 2, cores: 1, storageGB: 80, price: 30 },
{ name: '$60 Standard', memoryGB: 4, cores: 2, storageGB: 120, price: 60 },
{ name: '$115 Standard', memoryGB: 8, cores: 2, storageGB: 240, price: 115 },
].map(options => new StaticPlan(options))
const PLANS_GCP = PLANS_DO.map(plan => getGCPPlan(plan.memoryGB, plan.cores)) // not real offerings, just using DO as model
const PLANS_SCALEGRID = [
......@@ -139,6 +146,8 @@ export function getGCPPlan (memoryGB, cores) {
export const getHerokuPlan = (memoryGB, storageGB) => getPlan(PLANS_HEROKU, { memoryGB, storageGB })
export const getLightsailPlan = (memoryGB, storageGB, cores) => getPlan(PLANS_LIGHTSAIL, { memoryGB, storageGB, cores })
export const getScaleGridPlan = (memoryGB, storageGB, cores) => getPlan(PLANS_SCALEGRID, { memoryGB, storageGB, cores })
function getPlanByBudget (plans, budget) {
......@@ -164,4 +173,6 @@ export const budgetElephant = budget => getPlanByBudget(PLANS_ELEPHANT, budget)
export const budgetHeroku = budget => getPlanByBudget(PLANS_HEROKU, budget) || BLANK_PLAN
export const budgetLightsail = budget => getPlanByBudget(PLANS_LIGHTSAIL, budget) || BLANK_PLAN
export const budgetScaleGrid = budget => getPlanByBudget(PLANS_SCALEGRID, budget) || BLANK_PLAN
......@@ -3,7 +3,7 @@ description: This is a comparison of PostgreSQL DBaaS providers with an interact
---
# PostgreSQL DBaaS Calculator
I recently wanted to start a side-project using the serverless application hosting service [Zeit Now](https://zeit.co/now).
I recently wanted to start a side-project using the serverless application hosting service ~~Zeit Now~~ [Vercel](https://vercel.com/home).
Under "how do I use databases" in their FAQ, they recommend cloud databases such as Azure CosmosDB, MongoDB Atlas, Firebase, and Google Cloud SQL.
Personally, I want a relational database like PostgreSQL, and nowadays there are lots of options.
......@@ -28,6 +28,13 @@ Amazon's [T3 DB instance types use some kind of CPU bursting and CPU credit syst
The calculator assumes a 1-year commitment of reserved instances with no upfront payment in US West (Oregon).
[:moneybag:](https://aws.amazon.com/rds/postgresql/pricing/)
### [Amazon Lightsail](https://aws.amazon.com/lightsail/)
Lightsail is Amazon's simplified version of AWS.
Although at launch only MySQL was available, they quietly added managed PostgreSQL at some point in early 2019 (I think).
It seems that the prices are very similar to what you can get with a 1-year reserved RDS.
Lightsail seems like a good choice early in a project if you're leaning towards AWS but you're not ready for a 1-year reservation.
[:moneybag:](https://aws.amazon.com/lightsail/pricing/)
### [Azure Database for PostgreSQL](https://azure.microsoft.com/en-us/services/postgresql/)
Azure does not break out their pricing for memory; you pick the machine class based on CPU and pay for storage.
This calculator starts applying the 1-year 39% discount once you select General Purpose Compute Gen 5.
......@@ -106,3 +113,4 @@ Standard 1 must have had 6 GB memory and 128 GB storage for $100. That would hav
* 2019-04-01: IBM Cloud
* 2019-10-25: add budget calculator
* 2020-03-08: adjust presets, added ScaleGrid, updated AWS and Azure prices
* 2020-06-28: added Amazon Lightsail
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment