Preventing MongoDB Size Growth in SaaS Product for Cost Efficiency

As someone who is just starting out with MongoDB and web application database storage, I'm a little overwhelmed.

I've noticed that as clients continue to add data to their online dashboards on a SaaS platform, the size of the database keeps growing.

This means that hosting fees also increase significantly as the database gets larger, even if the number of clients stays the same.

For example, with mLab, 1GB of storage costs $15 per month.

Is there a way to keep the size and cost of the database steady over time while still allowing clients to access older information?

Answer №1

In order to access data, it must first be stored according to its definition. If you wish to reduce the amount of data being stored, you will have to purge some of it. However, once purged, that data becomes inaccessible.

When you reach a certain threshold, it might be more cost-effective to invest in buying a server and renting space at a colocation facility (usually around 100USD/Mo).

If you require multiple hosts, considering sharding the data based on recency could make sense. Storing new data on fast SSDs (which are costly but provide quick access) and older data on larger, cheaper spinning disks can help optimize storage costs.

However, this kind of setup may not be practical for the scale you are discussing.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Retrieving data from a stored procedure with XSJS and storing it in a variable

I am currently facing a situation where I need to pass a session user as a parameter to a stored procedure in order to retrieve a receiver value. This receiver value needs to be stored in a variable so that I can use it in another function within an xsjs f ...

When using AngularJS in conjunction with Kendo UI, an error may be encountered: "TypeError: Object [object Object] does not possess the method 'each'."

I recently integrated Kendo into my AngularJS project by following a helpful tutorial available at this link. Initially, I didn't encounter any errors in the console when my HTML did not contain any Kendo elements. However, as soon as I implemented t ...

Creating impenetrable div elements with JavaScript or jQuery

I'm currently working on creating solid blocks using DIVs positioned side by side both horizontally and vertically. I've successfully achieved this when the divs have equal heights. However, an issue arises when a div has larger dimensions; it en ...

The Express server is failing to respond to requests

After many POST/GET requests to the server, my server stops responding and in the network tab of the console all the requests are stuck as "pending". Even though I have logged timestamps during the responses, they seem to pass by quickly without running o ...

Testing Angular: Inability to achieve full code coverage for Ternary branch in unit testing

Currently, I am attempting to test a ternary branch that utilizes the window.location property. @Injectable() export class ABCService { private hostUrl = (window.location.host.indexOf('localhost') > -1) ? 'example.com' : window.lo ...

Tips for connecting an input tag within a popover to a Vue Model

I've got an input nested inside a popover content as shown below: JSFiddle Link HTML code snippet: <div id="vue-app"> <div class="btn btn-primary" data-toggle="popover" data-placement="bottom" title="Hello World!" data-html="true" data ...

Using jQuery to populate an array with selected table items

Issue Description: I am working on an HTML page with two add buttons and two tables. Currently, when the add button is clicked, rows are appended to their respective tables. However, in the backend, I need to gather all row elements when a specific "button ...

Using Javascript to send key codes to an HTML <textarea> element

I'm having trouble figuring out how to initiate a keydown event on a textarea element. For example, I have two textarea elements and I want the second box to display whatever is typed in the first one. However, for some reason, I need to do this using ...

Simple steps to access a feature on an AngularJS application

I have my angular application stored in a variable (initialized with:) var app = angular.module('app', [...]); Now, I need to access the $timeout service. How can I retrieve this service from it? I am looking for something like: var timeout ...

Issue with Angular Swiper carousel: Error message pointing to node_modules/swiper/angular/angular/src/swiper-events.d.ts

I am attempting to implement a carousel in Angular using Swiper (). An error message is appearing: Error: node_modules/swiper/angular/angular/src/swiper-events.d.ts:3:50 - error TS2344: Type 'SwiperEvents[Property]' does not meet the constraint ...

Can anyone provide guidance on updating a MongoDB collection with the stepzen schema?

After successfully figuring out the process of reading and creating a MongoDB collection entry using stepzen, I've hit a roadblock when it comes to updating an entry. I'm struggling to understand how to proceed with this. Below is what I think th ...

What is the best way to dynamically set the 'selected' attribute in HTML dropdown options using AngularJS data?

I'm currently in the process of developing an angularJS application. Below is a snippet of my PHP code: <label class="item item-input item-select"> <div class="input-label">Do you possess the right to work in the UK?</div> & ...

What is the best way to set up a monthly node-cron job schedule?

Currently, I am utilizing the node-cron package to handle the scheduling of node-cron jobs. I am looking to schedule a job that runs at the beginning of every new month. For instance, the job should run on September 1, 2020 and then on October 1, 2020, a ...

Create personalized styles for each item within a stack with specific spacing using the @mui library

Is there a way to change both the background color and spacing area when hovering over each item in my list? https://i.stack.imgur.com/87TST.png <Stack spacing={4} divider={<Divider variant={`fullWidth`} orientation={`horizontal`} flexItem/>}> ...

What is the best way to transfer information between two components when working with an edit form?

Presently, I am utilizing a modal material dialog window that prompts the user to input a number and then press search. Upon searching, it retrieves data from an API call and receives a response object. My goal is to utilize this response object to populat ...

What is the best way to integrate Handlebars with Express?

Understanding the question isn't tough, but I'm unsure about integrating handlebars with Express. This is my current code: var express = require('express'); var app = express(); app.get('/', function (req, res, next) { ...

Executing multiple POST requests using JQuery when the form is submitted

I need help submitting my form to two different scripts using JQuery. ScriptA redirects upon submission, while ScriptB simply stores the information provided. Unfortunately, I'm having trouble getting the submission to work properly as I am not very ...

What is the best way to utilize the history prop in conjunction with other props?

I am currently using react-router-dom along with react. My goal is to include additional props along with the history prop import React from 'react'; function MyComponent({ history }) { function redirect() { history.push('/path&ap ...

What is the best way to create a slideshow using an IFrame?

Currently seeking a solution for an iframe slideshow that can smoothly transition between multiple HTML iframes. I have a total of 5 iframes that need to rotate automatically and continuously. Any suggestions on how to build a lively and dynamic iframe sl ...

Contrasting images showcasing Headless vs Non Headless settings in Puppeteer

I'm currently attempting to capture a screenshot or PDF of the content available at this URL. When using the option {headless: false}, the screenshot is generated correctly; however, in headless mode, some images do not render in the screenshot (for e ...