2
votes

First of all, GIVE IT A CHANCE. I know that spreadsheets and databases are not the same thing. However, Google Sheets may be an anomaly.

In Google Sheets, a single file can contain multiple sheets. For example, I can create the file Spreadsheet, and then within it I can create Sheet 1, Sheet 2, and Sheet 3. Spreadsheet has its own unique access ID used for sharing and access, but each sheet within must be accessed differently.

In Google Apps Script, one can access Spreadsheet with the following code:

var spreadsheet = SpreadsheetApp.openById('id');

Now, the reason I ask whether or not Google Sheets could be considered a database service is that in order to read/write data, one must first access a specific sheet within that file. That is done with the following code:

var sheet1 = spreadsheet.getSheets()[0];

That call would retrieve the first sheet in the file, getSheets()[1] would retrieve the second, etc.

Like a database, a GS file contains multiple sheets, just like a database would contain multiple tables. Accessing data in the file is similar to accessing data in a database.

In the case of accessing data by JavaScript or Google Apps Script, is Google Sheets a pseudo-database?

3
This looks like a primarily opinion-based question which are off-topic on this site. Questions should be about specific programming questions. Reference How to Ask. - Rubén
@Rubén I don't see how it's opinion at all. - glotchimo
Be warned of the non ACID compliance of GSpreadsheets. This may or may not be a problem for your use case though. I would say instead of a DB, GSpreadsheets are a good data store (with all its cons and pros). - mTorres
@organism.exe it's opinion based because the question doesn't define the criteria to qualify an answer as correct. What is the definition of database / pseudo-database for this context? Is it compliance to criteria like ACID (mentioned by mTorres ) relevant or not? Are Google Sheets limitations relevant? - Rubén

3 Answers

2
votes

I would say that Google Spread sheets is better than a database for the early mock up of a simple apps. Because it removes the complexity of setting up things like MySQL or Mongo etc. But best of all it allows you to easily see where your data is at and how it is going to be joined etc.

But it has it's limitation. At 10,000 rows things work reasonably okay. But at 100,000 rows or more then opening and using a sheet becomes increasingly sluggish.

2
votes

With the Merge Sheets addon, I've actually used Google Sheets to replace a database. I have 5000 products. I added columns to my main sheet with various information about each product. Then I merge it with new data from my offline system. I define a key column and the addon is smart enough to update the changes and add new records at the end, yet leave the new columns intact and in their right place.

0
votes

Yes you can use it like database but it will like NoSQL database.

if you want to use that in GAS so you need to play with Arrays or Filter methods,in external with APIs by Get and Post you can handle it with JSON like Firebase database.