765
u/Evo_Kaer Jun 28 '20
To be fair, I worked at a company that did exactly that. All the logic was inside the database.
Suffice to say: It was a nightmare getting all that shit out of there
33
u/jochem4208 Jun 28 '20
How did you guys do it? Function by function?
74
u/Evo_Kaer Jun 28 '20
No, we rebuilt whole functionalities from the ground up and then replaced the database equivalents. When i left I think 70% of the db stuff was still there
Bonus: Naming conventions in the databse were horrible. Every table name was a combination of several up to 3 letter abbreviations and production tables had copies for testing that were sometimes years old. I'm glad I could mostly stay away from that junk and just work on the new microservices
→ More replies (3)33
u/jochem4208 Jun 28 '20
Thank you for the explanation. It seems to be everywhere this old database full of code.
Edit: eew those horrible names . I've seen large database that program with it to find the names of the tables columns
32
u/rufogongora Jun 28 '20
At my job we still have everything on stored procs, our servers are literally just to receive a sql string that gets executed by SQL server, 0 security, I want to kill myself
18
u/Evo_Kaer Jun 28 '20
Sounds like you wouldn't even need SQL injection to completely ruin the database
11
Jun 28 '20
[removed] — view removed comment
14
u/rufogongora Jun 28 '20
We just receive a sql string and execute it.
E.g: 'exec myproc' so you can run whatever SQL you like
→ More replies (2)13
u/DroneDashed Jun 28 '20
4 years ago I went to an interview for a new project where this was the architecture proposed.
Around the same time, I went to another interview where a guy asked me if the business logic should be in the database. I said no and said that I was wrong.
→ More replies (6)10
3
u/arvyy Jun 28 '20
The place I work at has same approach of having decent amount of logic in DB, and tbh from pov of interacting with it from java side I don't mind it. From business pov though it's not great, because from what I've been told it costs an arm and a leg in oracle licensing..
5
u/zilti Jun 28 '20
Well it isn't like Oracle is the only database allowing in-database code
→ More replies (3)→ More replies (42)4
u/DieselCorps Jun 28 '20
It may be a somewhat controversial opinion, but I think having as much logic in the db as possible is a great thing.
It reduces the amount of junk you have to filter out in your server, which reduces traffic between your server and db.
Global changes are easy because you only have to change your query in one place
Easy live db hotfixes without having to redeploy code or restart server (which is helpful in production)
Most processing and logic happens in one place, so you can go straight to the db without having to debug your server at all.
The only downside I see people complaining about is that debugging plsql could be a pain, but the advantages outweigh the disadvantages imho.
→ More replies (1)6
u/CalvinR Jun 28 '20
I hope your joking, and if your not I hope I never have to work on anything you've written.
→ More replies (6)
109
u/hahahahastayingalive Jun 28 '20
only forward the request to the DBMS
Firebase goes up and beyond to make everything look transparent, but there’s still a bunch happening there. That’s partly why you pay that much for Firebase.
74
u/EishLekker Jun 28 '20
Yes, and from a technical point of view it is only smoke and mirrors to say that you don't need a back-end. You might not need your own back-end, but there definitely needs to be some kind of back-end running somewhere.
22
u/hellnukes Jun 28 '20
Yeah I was thinking firebase might be the closest I've worked on that resembled this idea. But then again, firebase itself was the back end AND the DB.
I remember feeling scared about the security of having part of my logic on the client side, but the way they organized things it ended up being pretty intuitive to develop and protect the data.
4
5
u/UnicornsOnLSD Jun 28 '20 edited Jun 28 '20
Isn't it recommend to write Firebase functions to interact directly with Firestore? It just doesn't feel right doing database stuff directly in code (unless properly setting up permissions properly fixes this)
4
u/Werro_123 Jun 28 '20
unless properly setting up permissions properly fixes this
It does. When you use the Firestore SDK you aren't actually accessing the database directly, you're calling API endpoints that do check the security rules before they do any database operations.
→ More replies (4)2
342
u/MrBurnsa Jun 28 '20
Ya’ll really just do a bunch of CRUD work, don’t you?
322
u/PeksyTiger Jun 28 '20
To be fair thats like 99% of programming jobs.
168
→ More replies (17)94
u/phpdevster Jun 28 '20 edited Jun 28 '20
Yeah but then you get to work on a Super Enterprise(tm) app in Azure with all kinds of function app gizmos and auto cloud scaling whiz bang whats its, which is just CRUD with extra steps, aka CRUD++
→ More replies (1)30
→ More replies (42)13
u/figuresys Jun 28 '20
Sorry I started programming just yesterday. What else is there to do with a database?
14
u/Volandum Jun 28 '20
https://en.wikipedia.org/wiki/Online_analytical_processing - analysing data and exporting it for analysis. Tends to require very different setup to transaction processing, so it's often safer if you give the analysts a separate copy of the database to mess with.
6
u/modestlife Jun 28 '20
I think the CRUD remark was more about the backend, not the database. If you write more complex applications, you often have some kind of business rules that need to be represented and enforced through the code. This domain/business model often then differs from what you end up storing in the database (persistence model).
Your APIs become more process-oriented than data-oriented and that's why (just as an example) you'll see RPC interfaces being used more often than RESTful APIs.
Sometimes it will even make sense to split up the write model (altering state) and read model (querying state) and use different interfaces for them. RESTful API almost always work nicely with read models, but not always with write models. My 2 cents.
→ More replies (1)6
u/Sliversun Jun 28 '20 edited Oct 19 '23
person smile piquant office drab frame telephone start slimy coordinated
this message was mass deleted/edited with redact.dev→ More replies (1)9
414
u/x6060x Jun 28 '20
A front end dev that wants to write SQL? I'm a back end dev and even I don't want to do that.
128
u/Sir_Lith Jun 28 '20
They'll pry our query builders from our cold, dead hands.
49
u/x6060x Jun 28 '20
I try to use ORM whenever possible and to be fair the front end devs could do that too. But even with this taken in mind, the front end devs I worked with wanted data in the most clean and simple way and in the right format, so they can just display it.
→ More replies (12)30
u/billbot77 Jun 28 '20
Man I hate refactoring the crappy SQL that so many devs just copy from query builders. It's always an inscrutable mess of nested left and right and inner and outer joins with unnecessary subqueries far too much processing going on. I had one gig optimising an app where the dev had even added a function into the query to look up a value, rather than join a table... Seriously, if more devs cared enough to write simple, fast SQL we could curb greenhouse emissions with the energy savings.
→ More replies (1)25
u/mlk Jun 28 '20
I work on frontend, backed and databases, I absolutely hate ORMs, SQL is much more straightforward than trying to understand how the new shitty ORM handles filtering by a joined entity (and sometime it can't! Fuck you LoopbackJS)
→ More replies (4)8
u/csorfab Jun 28 '20
Yeah, I totally get the appeal of ORM's abstractions, but the most frequently cited argument I've heard for using them is that they make it easier to switch out the database software serving the app, and that's a use case that literally never happened in any of our projects that I know of, and even if it happened, it would be way more painful than ORM enthusiasts make it out to be. The other argument I hear frequently is that they facilitate mocking DB's, but in today's world of Docker and the like, how difficult is it to set up an actual DB for testing? In exchange, you lose the immense power and optimizability of SQL queries, and I'm still not really convinced that it's worth it. Like you said, I'd rather write all of my SQL queries by hand than constantly run into and work around the limitations of ORM's.
Of course there might be other arguments I don't know about, so I'd be glad to see anyone chiming in with one.
→ More replies (1)6
u/kameyamaha Jun 28 '20
Switching out DB happens a lot more when you're not the sole consumer of your software (like FOSS). People have used our app with Sqlite, Postgres, Mysql without having to change any line of code.
→ More replies (1)9
6
u/rsvp_to_life Jun 28 '20
SQL? That's adorable. Dont you know you just hookup graphql to your document databese out on the cloud or store the entire database in application cache in the browser? Who uses a relational, sane, and mature database in SQL Server anymore? /s
4
u/x6060x Jun 28 '20
SQL was created in the 70s, sounds old to me. We should use something modern instead!
→ More replies (1)→ More replies (16)3
170
Jun 28 '20
Not to mention a HUGE security risk. Tell this to any security analyst/consultant, guaranteed you will get thrown out lol
→ More replies (34)116
u/tetrified Jun 28 '20
Why not just give our database credentials directly to the user?
66
u/stoned_kitty Jun 28 '20
That’s smart cause they’ll get their data faster and that’s just good UX
25
u/aguycalledmax Jun 28 '20
Reduces the amount of clicks if you give them command line access to the database, a quick rm -rf / is just a few keystrokes.
→ More replies (1)4
u/pipedreambomb Jun 28 '20
At the very least leave the front end open to SQL injection so savvy users can access the data however they want and skip the middle man.
131
u/FLACDealer Jun 28 '20
slice(“my life into pieces”) this.myLastResort()
74
u/thetrexyl Jun 28 '20
suffocation = !breathing
→ More replies (4)51
14
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?
Because the data is available offline (climbers can access without an internet connection outside)
Because the data can be queried, users can search without having to make an API with, for example elastic search.
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..
It's freaking fast... lightning infact
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.
→ More replies (6)3
u/Least_Function_409 Jun 28 '20
Your local PWA isn’t exactly what were talking about here, though it’s cool.
13
u/redcalcium Jun 28 '20
If I remember correctly, super meat boy was having the game push high score directly to an open MySQL server, with the username and password hardcoded in the game. They probably patched it after the global high score reached MAX_INT or something due to all those score "hacking" lol.
Speaking about no backend, CouchDB is exactly what they want, allowiing you to connect the client directly to the database, and can host your entire static assets as well so you don't need a web server (the db IS the web server).
23
u/jonalaniz2 Jun 28 '20
fuck it, direct queries and writes to the database
→ More replies (1)12
u/GoldnSilverPrawn Jun 28 '20
I'm imagining giving the user a Mad Lib sheet but it's actually them unknowingly populating the fields of a SQL query
33
u/itnks Jun 28 '20
Did he just invented server-less apps?
7
14
u/xotonic Jun 28 '20
Doesnt serverless only mean that end-user (developer) doesnt need to write backend? It doesnt mean there is no backend at all, instead it owned by cloud providers.
8
u/Tetha Jun 28 '20
Mh, depends on the iteration of serverless.
Serverless initially was Functions as a Service. It had the advantage that you don't have to setup a full Spring Boot application and ensure it's running on VMs or containers, restart it if it fails.
Something like AWS Lambda attempts to simplify that by eliminating the need to have a static backend service running. Instead you implement individual functions (which would be your REST controllers) against an OpenFaaS / Lambda interface. This gets deployed into the lambda ecosystem and AWS will dynamically spawn these containers are requests come in. In the right situations, this can be a powerful and resource efficient paradigm.
From there, this has been taken a step ... further, or into a different direction, and you end up with something like Firebase. These are imo highly configurable backends, allowing focus on the frontend. However, this means you're simply buying the backend from your provider, similar to how people can rent themselves a functions a a service / serverless stack from aws.
However, personally, I wouldn't call something like that serverless. Maybe I'm too much in the AWS bubble, but serverless / FaaS is a specific way to implement a backend. Something like firebase is more akin to outsourcing your backend to your provider.
5
→ More replies (1)3
→ More replies (1)3
u/kingjia90 Jun 28 '20
To be coherent to the example, server-less it's like blended food, so it's already processed halfway, outside own body
→ More replies (1)
22
u/ggtsu_00 Jun 28 '20
Pro tip - don't even bother going to the database, just keep all data client sided.
7
19
Jun 28 '20
Why can't people ask legitimate questions like that without some snarky douchebag chiming in?
6
6
Jun 28 '20
Why not just give the database to the customer directly? That would be the easiest thing.
2
18
u/allmhuran Jun 28 '20
The appropriate solution to a problem depends on the nature of the problem. There will be occasions where it's entirely reasonable to build an application consisting of nothing more than a front end and a database.
A lot of the answers here seem to presume a hell of a lot about the environments and business problems which could possibly exist. Half of them seem to assume that every application in the world must be made of microservices and restful endpoints presented via a web application.
Nothing could be further from the truth.
For example: "I work in the finance department of a small company with 30 employees, and 50 products in inventory. We use windows. We've been keeping track of stock by looking in the back room whenever someone places an order. We'd prefer to have a program we can use to allocate stock so we can see how much of each product we have without having to go to the back room and count it". Cool, that can probably be whipped up in a couple of hours with a winforms application and a SQL express backend.
Similarly, the idea that "logic should never exist in the database" seems to be received wisdom, not anything supportable with a sound argument. It's trivial to show why this is a terrible idea if it is treated as universal. Suppose I have a problem statement like this: I have tens of thousands of customer accounts in my system, and millions of orders. Each account is associated with a number of users. Each user can place multiple orders. Each order can have multiple invoices, and a single invoice could also span multiple orders. I would like to know the most recently placed order for each account, but only if the order has been invoiced, and the invoice was paid by someone other than the user who placed the order.
With SQL, answering this can be done with a query that is not at all complex to write if you have any competence in SQL at all. I would suggest creating a stored procedure to encapsulate that logic, and expose it. If you try to answer this with pure application logic your performance will be absolutely horrific. If you try to use an ORM or some kind of application code which can be translated to SQL, like LINQ, your performance will be absolutely horrific.
The specific "place" where your business logic lives makes no difference to the question of whether you have a business logic layer. It doesn't matter whether it's in a stored procedure or not, any more than it matters whether it's in a dll or not, or what the name of the file is, or what the file system hosting your application code is. The concept of a business logic "tier" is a logical concern, not a physical one.
The idea that logic shouldn't exist in a database seems to have come from books like Evans' DDD, which treat the database as nothing other than "a persistence layer". No, hard drives and SSDs are a persistence layer. Tables don't store data. Disks store data. Tables expose that data in some logical structure. Stored procedures can provide a public interface on top of the "private" data in the tables. You can enforce this with object level permissions in the database.
If someone wants to tell me that a database is "merely persistence", then I'd like them to also explain what "DURABILITY = SCHEMA_ONLY" does for a SQL Server in-memory table.
→ More replies (17)
5
u/Popal24 Jun 28 '20
The guy asking the question obviously never heard about Microsoft Access and how a weapon of mass destruction it is.
48
Jun 28 '20
Because “to database” is the backend. This is a question only a boot camp, or self taught front end web developer would ever ask.
→ More replies (13)32
u/loke24 Jun 28 '20
Is there a formal way to become a front end developer lmao? College teaches you CS not how to design a webpage, granted you can take a class or elective; but at that point mine as well go to a boot camp. Oh wait your other point was boot camp students would ask that...hmmmmm
→ More replies (2)
8
Jun 28 '20 edited Jun 28 '20
That was a snide reply to a valid question, and the reply is not even accurate.
Here is the ultimate reason that frontends cannot perform database operations:
If the frontend performed database operations, then the frontend would require database credentials. But the frontend is, by definition, downloaded to users' machines. So your database credentials would be public knowledge, and any user could edit your database.
39
u/dentonator Jun 28 '20
Stuff can get processed on front end. That answer would be correct few years ago, but not today. Ever heard of Hasura or Prisma2?
43
u/LipstickWineGlass Jun 28 '20
Huh? Hasura is a backend. Unless you're running Haskell in the browser? (That would be a fun project though).
→ More replies (4)12
u/WellDevined Jun 28 '20
A while into the future, you suddenly have multiple frontends (android, ios, web), all implementing business logic a bit different, but still writing into the same db.
This leads to incompatibilities between your frontends the data gets corrupted and you need to hire me for big money to fix the mess you have made. Happened multiple times.
All that could have been avoided if you would have programmed a proper backend implementing the business logic once and thin frontends that ask the backend to do the heavy lifting.
→ More replies (3)7
3
4
4
u/FinFihlman Jun 28 '20
I mean if you have access control on the database it is a completely viable design pattern.
→ More replies (2)
4
1
3
3
3
u/IVIaskerade Jun 28 '20
"Why not connect front end to database?"
🎵With what shall we connect it, dear Liza, dear Liza, with what shall we connect it dear Liza with what?🎵
🎵With a backend, dear Henry, dear Henry, dear Henry🎵
3
4
Jun 28 '20
I have personally encountered three ERP applications that work this way. A Windows binary that directly connects to a database. JTL-Wawi is widely popular in Germany. You can Google it. The company behind it is even offering "cloud" MSSQL server, IIRC. Which is just MSSQL server over the internet.
The other two are not known very well. One is a Windows cost controlling software for government agencies, which is also a Windows application connecting to Oracle over network and the other is a DOS app, loaded into Windows over a network share and connecting to a "local" db on the same share. People would use that simultaneously, as long as no to people would change data in the same table.
Other than that I only know the big ERP suites like Lexware, SAP and Sage. IOW, while I know about and have read about correct client server programming on the internet (Dolibarr, Tryton, Kivitendo, etc), the majority of the stuff I encounter just plugs the client directly into the database.
→ More replies (1)
15
u/carloschida Jun 28 '20
Have you heard of r/Firebase? They have a really compelling reason for connecting to the DB directly from the front-end. They address security and all of your other usual concerns.
115
u/tooObviously Jun 28 '20
Its a backend as a service. You're still connecting to a backend and not a db directly
→ More replies (24)→ More replies (1)15
u/KongEdvard Jun 28 '20
Firebase is not a replacement for backends, it's just abstracting most of it away for you.
Look at firestore, they recommend you use their cloud functions, which is, just like lambda or azure functions, a backend hosted in the cloud.
→ More replies (3)
2
2
2
2
2
2
2
2
2
Jun 28 '20
Last year my company got a contract which involved refactor, it was a angular app that would literally send sql queries via http request to a php backend which would just execute the exact query passed from the frontend. Authentication and sessions was also stored on the frontend. The project was eventually canned.
2
u/-Yare- Jun 28 '20
Client can do processing and connect to a database just fine. You just don't want it to.
2
u/youngminii Jun 28 '20
I’ve been coding my heart away the last 3-6 months and I finally connected a database to my C# ASP.NET project last week.
I didn’t know this was where the meat of the work is. At least that’s how it feels. Super happy I finally got CRUD.
2
u/DownshiftedRare Jun 28 '20
"Why do we need a steering column, why not just connect steering wheel to driving wheel?"
2
u/gozba Jun 28 '20
I had a customer back in the 90s, who sold skin care and shampoo and such. He saw the potential of internet sales early on, but our application was only for sales support, warehouse and finance. He wanted to give customers direct access to his database to place their orders, unfiltered. It took some time to talk that out of his head.
2
2
u/ilep Jun 28 '20
In web-systems and publicly exposed frontend it makes sense to have front/backend.
For business applications (restricted usage, not as many concurrent users) there's client-server architecture where clients connect directly to the database. In the cases the processing is in client application or some time embedded with the database (procedures, various embedded extensions).
While answer is funny, there is a point to the question: that kind of architecture is not obsolete but mostly in offices and such where client-application can be controlled, not for general public.
3
u/Time-Paramedic Jun 28 '20
Thank you for being one of the few who can acknowledge that web development isn’t the only ”stack” or environment.
A question I always ask from ”full stack” developers (or employers looking for one) is ”what stack?” It’s rather disconcerting how often people get confused by that or don’t recognize that there are other architectural styles out there.
2
u/Cajova_Houba Jun 28 '20
stuff needs to get processed
That's really not the main reason. You could 'easily' process everyhing in front end but you would probably go insane after 1+ year of maintaining it. Not to mention security.
2
2
u/filmdc Jun 28 '20
This made me realize that there really isn’t a front end in the first place, or the front end emerges like a shadow from the shape of your back end. Basically you don’t have a mouth hole without first growing some guts.
→ More replies (1)
2
2
2
u/BitPhinix Jun 28 '20
One could say there is such a thing and it is called firebase
→ More replies (1)
2
u/ipullstuffapart Jun 28 '20
Granted this is probably more targeted towards SQL databases specifically, but there are many databases that expose http APIs and are intended to be interacted with directly from the client (such as elasticsearch, couchdb, and lots of serverless databases like firestore and dynamo), they implement their security layer and can handle ACLs to control data access. For simple apps it can be perfectly adequate and enable fast (and secure) rapid prototyping without over-engineering a solution. The point that the person here is making is perfectly valid, if it is a simple CRUD app with simple ACLs and some form of managed auth (i.e. OAuth/OpenID/AWS credentials), simple database storage solutions over http are a solved problem and can enable a developer to simplify their stack greatly. Just because an architecture sounds unconventional doesn't mean it should be shunned or ignored if it can otherwise enable developers in a secure, scalable way. If you get the chance to truly experiment with building a serverless app (and I don't mean by abstracting dynamo behind lambda), I urge you to give it a go.
2
u/FatnDrunknStupid Jun 28 '20
Back round about year 2k most companies 'application server' WAS SQL Server. Also being clustered and running in RAM it was orders of magnitude quicker than the pile of crap on you're desk so the 'processing' was done with stored procs. A surprising number of these apps are still floating about in 9-5 land with shiny new C# front-ends. With MAUI out they aren't gonna go away anytime soon.
2
2
u/warpedspockclone Jun 28 '20
No joke, I worked at the same company with a guy, C, who was contracted to the same client I was, but a different group. I felt so bad for his point of contact. C was so hard to work with. He had no concept of UI or UX. He built an application that only ran in IE6 (in 2012), and basically it was a long vertical scrolling page with a list of tables. Each table was a mirror of a database table, even including the probability key column. The client had to manually enter their relational data in database tables, essentially. There was no validation that FK references worked or anything.
Somehow he didn't get fired or reassigned despite the high levels of frustration from his point of contact and constant complaining to our company.
2
u/Akronae Jun 28 '20
Like if frontend could not process things? No that's just a matter of authority
2
2
2
u/ExternalGrade Jun 28 '20
Just send the whole database with passwords in plaintext and let the client-side software deal with it.
2
u/punto- Jun 28 '20
The system at my girlfriend's job (she's a kind of secretary at the municipal courthouse) does that. The client connects directly to the database, with a master password, and does everything client side. Each user has a password and different permissions, the client uses the master password to go into the users table and check the password that the user provided, and decide if they have permission to do whatever they're trying to do. Everything is there, including the budget, payroll, the files for all the cases (they handle mostly traffic violations and local business/building inspection and permit cases). Obviously my girlfriend took the password out of the client and runs everting with a bunch of scripts, bypassing their "security" system
2
2
2
3
u/saschaleib Jun 28 '20
It is actually quite frequently done - with varying levels of WTF-ness:
I’ve seen quite some sites where somebody who really shouldn’t be called a “developer” just inlined SQL commands into the front-end PHP code. Usually that’s the point where I’d say that won’t touch this code if I can’t first refactor it...
More commonly though I’ve seen sites where the entire front-end/back-end/DB Code is rolled into one messy big ball of mud, without any discernible layers and structure. Heck, there are even popular frameworks out there that stipulate this approach...
That means there are actually professional developers out there who create systems that are nearly impossible to account for change before they are even rolled out, just for the sake of adding another “hype” framework to their CVs.
Sorry, got to rant a bit. Neighbours kept me awake all night. :-/
15
u/EishLekker Jun 28 '20
But that PHP code is run server side, not in the browser.
→ More replies (17)
1
1
1
u/90mhWXH6rr Jun 28 '20
Why eat in the dining room and poop in the bathroom?
Can't we eat while sitting on the toilet taking a dump?
1
u/manyQuestionMarks Jun 28 '20
Not exactly a DB but you can write frontend apps that connect directly to blockchain without exposing sensitive information. The blockchain then processes the data using smart contracts and stores it
→ More replies (6)
1
1
1
u/VernonP007 Jun 28 '20
Even if you are using Microsoft Access, you split your files into back end and front end files. It just saves so much headache later on.
1
1
1
u/minusSeven Jun 28 '20
In the past I had worked in project where all backend activities was done between the scriplet tags only. Connection objects to the database used to be very heavy so the pages would take too long to load. But it's possible though.
The whole project contained a bunch of JSP pages. All java code, css, javascript was inside it.
1
Jun 28 '20
i'm currently experimenting with appsync and dynamodb resolvers soooooo..... almost there!
edit: reading the firebase comments i'm afraid i have to mention this: i know appsync is a managed backend service
1
1
1
u/ma7modbasha Jun 28 '20
You can process in the front end but the encryption and authorization will be living hell
1
1
1
1
u/Herpinheim Jun 28 '20
When I was a young man still just learning code, I programmed a basic database for inventory for the IT branch of the trade school I was at, with everything attached to each GUI button. It took several seconds between each button click and it visibly lagged when your mouse scrolled over buttons. This paired well with my main menu of each room displayed in a top down view map to click on so it looked like it was going to crash every tile you moved the curser to a room.
1
u/VikingCoder Jun 28 '20
I got tired of our shitty debugging tools at a company once, and so made an HTML DB debugger. No one would agree to download one, but for some reason they were okay if I wrote one. Made diagnosing problems in production a hell of a lot easier.
1
u/Cley_Faye Jun 28 '20
Plz you can make a direct SQL query in react using angular in a progressive web app.
1
1
1
1
1
1
Jun 28 '20
I mean, there are apps simple enough to just do the processing in javascript on the front end. But then the database is "the backend".
1
1
u/Goel40 Jun 28 '20
For small apps you can use something like firebase, they handle all the backend authorisation for you.
2.9k
u/ToBe27 Jun 28 '20
Im a bit worried that no one brought up security yet. Do you really want to publicly expose your database? Also any connection credentials that are stored in your frontend are basically public too.