Earlier quoted context omitted.
client = (APIcall) => redis.get(sha1(APIcall)) || { res = api(APIcall); redis.set(sha1(APIcall),res) return res } Not that hard. Like 10 lines of code to get a decentish cache going.
Assuming you have Redis
Show HN: Using Google Sheets as the back end/APIs of your app
81–90 of 171 posts
Re: Show HN: Using Google Sheets as the back end/APIs of your app
#82Re: Show HN: Using Google Sheets as the back end/APIs of your app
#83Re: Show HN: Using Google Sheets as the back end/APIs of your app
#84Re: Show HN: Using Google Sheets as the back end/APIs of your app
#85It's a community association membership management thing, and I wanted the (non-technical) association board members to be able to easily inspect the data and do something useful with it if I moved away. It has mostly been successful, except that sometimes someone will manually edit the sheet and break something.
Re: Show HN: Using Google Sheets as the back end/APIs of your app
#86Funny story. Before pivoting my startup to Loom, we were a user testing company named Opentest. Instead of spinning up a DB and creating a dashboard for my co-founders to look at who requested certain user tests, I just dumped everything into a Google Sheet. It was so good. No downtime. Open access. Only 3 people looking/editing, so no conflict. Didn't have to deal with database upgrades or maintenance. I often think…
Sounds neat, let me ask permission first before I put company data into Google Sheets.
Re: Show HN: Using Google Sheets as the back end/APIs of your app
#87I rather use Google Sheets as the front end of my app. Have it call endpoints in my backend and populate the sheet with the data, and auto-generate charts based on that data. Easy, no-nonsense dashboard. Add in some dropdown menus and inputs and you got yourself a good enuff frontend
Re: Show HN: Using Google Sheets as the back end/APIs of your app
#88Couple of suggestions/questions from using Google sheets to put enter some data that changed manually via back office admin which we then showed in a website that was accessed by thousands.
1. Will I hit rate limits if I access this API often via say GET requests from a public facing site? (What we did was used Redis as an intermediate cache)
2. Let's say the data on the sheet is changed, is there a webhook to notify the change? (What we did incorrectly initially was to rely on polling for change detection. Which was a bad idea especially as we grew increasingly reliant on this. Instead, the better way to do this is to put an 'Update' button in the sheet which then triggers an API call to an intermediate server to bust the cache I mentioned in the previous point. This also initiated a new fetch of the sheet data. A more user-friendly/better UX way to do this would be to use the Appscript Sheet APIs sheet change event handlers which can be leveraged for this if you don't want to enforce an update button on users though I haven't used this myself. [1])
In your case, I guess the way to do 2 would be to ask users to clone a sheet that has this Appscript code embedded in it when they create a new sheet that must be served with your API. No sure if the UX of that is acceptable though.
Wish your product success.
[1] https://developers.google.com/apps-script/reference/script/s...
Re: Show HN: Using Google Sheets as the back end/APIs of your app
#89Didn't https://www.glideapps.com famously start with Google Sheets backend?
Re: Show HN: Using Google Sheets as the back end/APIs of your app
#90Funny story. Before pivoting my startup to Loom, we were a user testing company named Opentest. Instead of spinning up a DB and creating a dashboard for my co-founders to look at who requested certain user tests, I just dumped everything into a Google Sheet. It was so good. No downtime. Open access. Only 3 people looking/editing, so no conflict. Didn't have to deal with database upgrades or maintenance. I often think…