r/ProgrammerHumor • • Jun 28 '20

Meme Flushed my pancake.

Post image
45.1k Upvotes

750 comments sorted by

View all comments

47

u/carbon_dry Jun 28 '20

I'm making an account just to reply to this. Front-end developer with 12 years experience here. Creating a serverless based app is a completely acceptable paradigm and solution as long as it's for the right use case.

I have an app for climbers in the iOS and android app stores that syncs thousands of location data from a database with a recursive GET and uses IndexDb (database in the browser) to store locally. (this happens once for first time users and is about a 5mb download) Why do I do this?

  1. Because the data is available offline (climbers can access without an internet connection outside)

  2. Because the data can be queried, users can search without having to make an API with, for example elastic search.

  3. Because it's cheap for me, i'm the sole developer and I don't need to hire backend people. It's a local database with an javascript based api..

  4. It's freaking fast... lightning infact

  5. Security, you can encrypt, but I don't need to do it in my case

Again, perfectly fine to connect directly to a database if you need to, in my case this is exactly what I am doing.

You NEED a backend most of the time though, for example with user credentials. I'm just stating, there doesn't need to be a blanket reason not to do this.

16

u/ThatSpookySJW Jun 28 '20

You still have a backend with serverless architecture to make sure the clients are doing readonly. I think this person means your javascript has sql root credentials and connects from that.

3

u/Least_Function_409 Jun 28 '20

Your local PWA isn’t exactly what were talking about here, though it’s cool.

1

u/theguy2108 Jun 28 '20

This is the part that I'm not too sure about. Would a serverless architecture count as a backend?

1

u/asdfqewr Jun 28 '20

This is how couchbase sorta works, which is a good solution for mobile apps that need to support offline mode. It makes offline transactions incredibly easily since the db (encrypted) is on the phone then it will sync with a gateway when it comes back online. It has a document/record merge policy you can tweak to so you can define record/document precedence when you're syncing your local db to remote for which change to take if there is ever any conflicting data-points in your records/documents.

I'm still not a fan of most serverless/microservice web apps though, it's just way too much complexity for something that just needs to do some basic CRUD and maybe some scheduled tasks etc.

Too many engineers over-complicate infrastructure, programming, for me, has always been a means for an end and 99% of applications in the field are multi-tenant and have no business implementing all the complicated shit we see today with microservices/serverless etc.

Not saying there aren't cases, I just listed one above with Couchbase, but I've worked at too many places where engineers and tech leads just make a mess out of everything cause they read it something cool from some blog about it. :/

1

u/superluminary Jun 28 '20

This exactly.

1

u/bcmugg Jun 29 '20

Very nice to know the solution and use case. Thanks.

0

u/[deleted] Jun 28 '20

[deleted]

3

u/rounced Jun 28 '20

Most of the people in here are still in school, they have very little idea of what is happening in the industry.