Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
The Fool
Oct 16, 2003


Well, at minimum you could probably just take any one of a million JavaScript table libraries and plug it in and it would be fine.

Beyond that you could cache your queries in a storage that persists across reloads and have some method of invalidating the cache and reloading it when needed.

The approach du jour is to have a client side SPA that talks to a server component through a rest-like api interface. The server component would handle the database interface running the queries and caching data.

Adbot
ADBOT LOVES YOU

Ape Fist
Feb 23, 2007

Nowadays, you can do anything that you want; anal, oral, fisting, but you need to be wearing gloves, condoms, protection.
Can someone please explain to me what problem Graph QL solves? Its not an ORM, and I can already define the structure of API objects with typescript interfaces on top of something like Nestjs? Is there some fundamental huge advantage in not seeing here?

Da Mott Man
Aug 3, 2012


Ape Fist posted:

Can someone please explain to me what problem Graph QL solves? Its not an ORM, and I can already define the structure of API objects with typescript interfaces on top of something like Nestjs? Is there some fundamental huge advantage in not seeing here?

GraphQL's biggest thing is the api is a request want you want, leave what you don't. If you don't need a specific data structure at the time you just don't request it. Now you can do that with a REST api but the way you do it is defining a bunch of endpoints that returns data in a predefined schema, adding complexity to the client and server. GQL does everything through a single endpoint so the backend is cleaner and easier to maintain.

marumaru
May 20, 2013



Ape Fist posted:

Can someone please explain to me what problem Graph QL solves?

makes life better for front end developers, shittier for back end developers (in my experience)
that or im just used to rest

prom candy
Dec 16, 2005

Only I may dance

Ape Fist posted:

Can someone please explain to me what problem Graph QL solves? Its not an ORM, and I can already define the structure of API objects with typescript interfaces on top of something like Nestjs? Is there some fundamental huge advantage in not seeing here?

I can make new pages/components/sections in my app without having to make new rest endpoints.

Agrikk
Oct 17, 2003

Take care with that! We have not fully ascertained its function, and the ticking is accelerating.

The Fool posted:

JavaScript table libraries

Imma start with this, then play with Elasticache.

Thanks!

minato
Jun 7, 2004

cutty cain't hang, say 7-up.
Taco Defender
There's a certain cloud provider who just supports REST and I wish they had GraphQL. To determine if a user (given by email address) is a member of group (given by group name), my client code has to:
- look up the user by email to get all their attributes and pull out their their UUID (even though I don't need the other attributes)
- look up the group to get it's UUID (ditto)
- Pull a list of the 1000s of group members and search client-side for the user's UUID.

With GraphQL that'd all be done in one call with minimal traffic and no client-side searching.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Sorry if I asked this before but I’ve been making WordPress websites and basic bootstrap sites for years as a hobby but I want to expand my skills now. What’s my next step? I’d say I’m pretty good with html and css. JavaScript seems the logical next step? Any recommended resources for learning that?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Empress Brosephine posted:

Sorry if I asked this before but I’ve been making WordPress websites and basic bootstrap sites for years as a hobby but I want to expand my skills now. What’s my next step? I’d say I’m pretty good with html and css. JavaScript seems the logical next step? Any recommended resources for learning that?

If you want to do something similar to CMS backed sites, you could check out Ghost (a WP-like thing done in JS) or if you want to get into React in a static-site generator, check out Gatsby. If you actually need to learn the basics of JS, the resources here are pretty good and have a couple entry points based on your current comfort level.

NotWearingPants
Jan 3, 2006

by Nyc_Tattoo
Nap Ghost

Empress Brosephine posted:

Sorry if I asked this before but I’ve been making WordPress websites and basic bootstrap sites for years as a hobby but I want to expand my skills now. What’s my next step? I’d say I’m pretty good with html and css. JavaScript seems the logical next step? Any recommended resources for learning that?

I like the courses on Udemy.com. You may want to try that ( if you have the time to sit through them, because sometimes they can get a little long)

They are really cheap too. You never have to pay the list price. They will advertise courses for 89.99 or 149.99, but then they always seem to be on sale for $15 or $20.

kedo
Nov 27, 2007

Javascript is definitely a good choice. If you like working with WordPress you should also consider picking up a common server-side language – PHP is a good choice if you think you'd like to continue using WordPress in the future. It gets a bad rap among picky developers, but it's a much loved platform and there's lots of business to be had working with it if you plan on making a career out of web dev.

marumaru
May 20, 2013



If you're learning Javascript might as well learn Node, if nothing else it's pretty fun to do stuff with it.

The Fool
Oct 16, 2003


Javascript in the front, Python in the back.

The Fool
Oct 16, 2003


Javascript in the street, Python in the sheets.

marumaru
May 20, 2013



The Fool posted:

Python in the back.

Isn't Python supposedly really slow for webdev compared to the alternatives? I've heard about it but being a Node boi in the backend I haven't really looked into it

The Fool
Oct 16, 2003


Inacio posted:

.. Python .. slow .. Node

I don't really know what to do with this.

NotWearingPants
Jan 3, 2006

by Nyc_Tattoo
Nap Ghost

Inacio posted:

If you're learning Javascript might as well learn Node, if nothing else it's pretty fun to do stuff with it.

I completely agree with this. I already knew JS but was using an old framework nobody uses anymore. I learned React, but then took a course on Node and I think React would have gone a lot easier for me if I had taken the Node course first.


e: I took this course: https://www.udemy.com/course/the-complete-nodejs-developer-course-2/ (It's listed at 84.99, I paid $11.99)

It was really long (34 hours of video), the guy looks like Pee Wee Herman and speaks with an an odd cadence that can be annoying at times, and yet I thought the course was absolutely awesome.

NotWearingPants fucked around with this message at 18:28 on Oct 17, 2019

marumaru
May 20, 2013



The Fool posted:

I don't really know what to do with this.

I don't get it?

But yeah, did some very shallow googling and it seems to confirm what I thought I'd read:

https://dev.to/wrrnwng/nodejs-vs-python-3-performance-1ok6
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/node-python3.html

Now, synthetic benchmarks are all well and good, but whether that matters in real world applications... highly unlikely.

Data Graham
Dec 28, 2009

📈📊🍪😋



Inacio posted:

I don't get it?

But yeah, did some very shallow googling and it seems to confirm what I thought I'd read:

https://dev.to/wrrnwng/nodejs-vs-python-3-performance-1ok6
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/node-python3.html

Now, synthetic benchmarks are all well and good, but whether that matters in real world applications... highly unlikely.

And if you really care about speed in Python you can use PyPy https://pypy.org .

Though as I often tell interviewers, okay, let's say you get a real-world 10% speed increase in your whole web app written in X language versus Python. Is that speed improvement really worth it over the benefits — namely, a language everybody knows, full of mature frameworks and active development, where you can always staff up and have coders immediately fluent in code that's stylistically opinionated so they'll all write the same way, and you can get to market that much faster and maintain it easily years down the road after staff turnover? You can make up that 10% with a bigger server.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Thanks for all the help folks. I know a little bit of Python and have messed around with Flask in the past so I’ll jump into learning Node I guess. Seems to be more resources out there for learning Node than any form of web version of Python Atleast.

Vincent Valentine
Feb 28, 2006

Murdertime

NotWearingPants posted:

I like the courses on Udemy.com. You may want to try that ( if you have the time to sit through them, because sometimes they can get a little long)

They are really cheap too. You never have to pay the list price. They will advertise courses for 89.99 or 149.99, but then they always seem to be on sale for $15 or $20.

Internet signing up for stuff pro tip:

Udemy, and many companies like it, offer massive discounts for new sign ups.(90% for udemy)

Google Gmail ignores periods ( . ) in email addresses.

Make an email named imjusthereforfreestuff@gmail.com and sign up to get 90% off your first udemy order(multiple courses together counts as one order)

Then when you're done with those if there's no sale up, in incognito mode, sign up again as im.justhereforfreestuff@gmail.com, get the sale price, repeat by moving the period down one place each time.

Funking Giblet
Jun 28, 2004

Jiglightful!
Even better, just use labels.

imjusthereforthefreestuff+udemy@gmail.com will automatically label it.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Inacio posted:

Isn't Python supposedly really slow for webdev compared to the alternatives? I've heard about it but being a Node boi in the backend I haven't really looked into it

Pythons slowness almost never matters for web dev. Your speed constraints are almost always somewhere else...like database access.

That being said, a lot of python land is migrating to async, which is one of the things that makes node servers faster than python servers. For example, Django 3.0 has made the first steps to becoming async-native.

But, anyways, theres a 99.999 percent chance you will never be affected by the speed of python as a web backend.

Hell, Instagram runs on Django. If you need more requests per second (you don't) you just scale horizontally...which is pretty easy in the era of AWS and the like.

marumaru
May 20, 2013



post on my site:

12 year old idiot posted:

I know this sounds crazy, but I have found lots of serious vulnerabilities with SQL injection if you look good. I don't have the sources though.

And I actually need some explaining. So I will give you some context to keep up the story.

So I was at dinner. Thinking, seeing bank accounts. And thought, what if? What IF I could use SQL injection to get into the database of an low ranked bank. But this can be also low ranked

companies. So, right now I don't really know how to use SQL Injection or get into an database. Though if someone could explain to me how I could use it(and if I don't understand it, you can do it in an performance too). Because I think this is really usefull for other people that are into cyber/black/gray hat hacking.

The Fool
Oct 16, 2003


Inacio posted:

Now, synthetic benchmarks are all well and good, but whether that matters in real world applications... highly unlikely.

That's kinda what I was getting at.

Empress Brosephine posted:

Thanks for all the help folks. I know a little bit of Python and have messed around with Flask in the past so I’ll jump into learning Node I guess. Seems to be more resources out there for learning Node than any form of web version of Python Atleast.

Don't confuse quantity for quality.

Prejudice aside, the V8 engine that node uses is pretty good, but it's wrapped around one of the worst package managers in popular use right now.

Python with Django, Flask and others is a very good, mature, and well documented ecosystem and it is absolutely worth giving Python a consideration.

That being said, you're probably still going to be using Javascript on the client-side whatever you do.

kedo
Nov 27, 2007

Inacio posted:

post on my site:

Better watch before Zero Cool hacks your First National Bank of Shelbyville Kentucky website... once he figures out what hacking is and how to do it (!!!))

prom candy
Dec 16, 2005

Only I may dance
When I was 10 i used to tell kids I would hack their computers but I really had no idea what that would entail and also most people did not have internet access at that point (if they had computers at all)

Vincent Valentine
Feb 28, 2006

Murdertime

I genuinely thought I could hack any computer at any time. I couldn't, and had no idea what hacking even entailed or how it worked. To be totally honest, I still don't. But I was so sure I could do it. I was so good at video games, hacking a computer should be easy by comparison.

NotWearingPants
Jan 3, 2006

by Nyc_Tattoo
Nap Ghost
One of the first programs I ever wrote simulated a login prompt on terminals at my HS and stored the usernames/passwords in a text file in a hidden directory of a public account.

e: not exactly hacking, but my heart was in the right (wrong?) place.

NotWearingPants fucked around with this message at 17:38 on Oct 19, 2019

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Social engineering is always the right answer, friend.

Vincent Valentine
Feb 28, 2006

Murdertime

Yeah that's been my experience. If you want someone's username and password, just ask. They'll tell you.

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


Inacio posted:

I don't get it?

But yeah, did some very shallow googling and it seems to confirm what I thought I'd read:

https://dev.to/wrrnwng/nodejs-vs-python-3-performance-1ok6
https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/node-python3.html

Now, synthetic benchmarks are all well and good, but whether that matters in real world applications... highly unlikely.

I was a bit surprised by those benchmarks, but reading more about it Node uses a JIT compiler into machine code, so it would make sense. It's still considerably slower than "real" compiled languages like C/C++ or Rust, but surprisingly efficient otherwise.

One thing I'm wondering about is multi-core performance. This is actually fairly important for IoT embedded in terms of performance. Though you'd use something like Tornado with asyncio rather than Django for python on that.

Private Speech fucked around with this message at 13:03 on Oct 20, 2019

marumaru
May 20, 2013



Private Speech posted:

I was a bit surprised by those benchmarks, but reading more about it Node uses a JIT compiler into machine code, so it would make sense. It's still considerably slower than "real" compiled languages like C/C++ or Rust, but surprisingly efficient otherwise.

One thing I'm wondering about is multi-core performance. This is actually fairly important for IoT embedded in terms of performance. Though you'd use something like Tornado with asyncio rather than Django for python on that.

I don't know if it counts, but I do use "multithreaded" Node on my site and it seems to scale pretty well. But I wouldn't really use Node (or Python for that matter) for IoT anyway.

NotWearingPants
Jan 3, 2006

by Nyc_Tattoo
Nap Ghost
I'm new to node.js, and am find hosting to be a bit more confusing than I expected. I've been used to the CPanel/PHP/MySql world where there are a plethora of hosts that let you host unlimited domains with unlimited databases, along with basic email accounts, for a small monthly fee. I pay for one of these myself, and I still have access to two others through a friend and an old job.

None of these hosts support Node.js or MongoDB, and maybe I'm looking in the wrong places but I'm not seeing similar cheap all-in-one type hosts for node.js apps. Netlify and Heroku wipe everything every time you deploy so there's no permanent storage for things like image uploads. It seems like cloud MongoDB can get expensive (though now I don't remember exactly what my blocker was here)

So, I've been thinking I'd try deploying my app using AWS's elastic beanstalk, AWS s3 for image uploads/storage, and switching back to MySql using Sequelize and a DB on one of the standard webhosts I have access to.

Is there a better way, particularly is there anything like the shared hosting world where I can deploy node.js apps, create unlimited mongoDB databases, limited only by high storage/bandwidth limits, for under $10 a month? And also some basic email hosting would be nice too.

marumaru
May 20, 2013



I just use a DigitalOcean droplet and throw my poo poo in there.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Private Speech posted:

Though you'd use something like Tornado with asyncio rather than Django for python on that.

No I wouldn't! I'd use FastAPI or Starlette.

Or I'd travel into the future a year or two and bring Django with it's currently-in-progress async refactoring into the present.

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


Thermopyle posted:

No I wouldn't! I'd use FastAPI or Starlette.

Oh, those are neat! I think I've seen Starlette before, but not FastAPI.

e: Maybe the bit I had here was sharing a bit too much.

Private Speech fucked around with this message at 21:57 on Oct 20, 2019

Roadie
Jun 30, 2013

NotWearingPants posted:

but I'm not seeing similar cheap all-in-one type hosts for node.js apps

The key thing you're missing here is that PHP is designed around every page access being a one-time script access that's also silently passing stuff through Apache or nginx, while Node servers stay active and handle responses. The latter does not at all lend itself to shared hosting.

NotWearingPants posted:

Netlify and Heroku wipe everything every time you deploy so there's no permanent storage for things like image uploads.

The Node world expects you to have your server separate from your data, using services like S3 for uploads, CDNs like Cloudflare for unchanging static files, or even stuff like PostgreSQL Large Object support. See the gigantic list of Heroku addons, for example.

NotWearingPants posted:

Is there a better way, particularly is there anything like the shared hosting world where I can deploy node.js apps, create unlimited mongoDB databases, limited only by high storage/bandwidth limits, for under $10 a month? And also some basic email hosting would be nice too.

Heroku hobby tier is $7/month fully pro-rated, so that's $0.0000027 per second per instance. Assuming you properly optimize stuff around the server shutting down when inactive and spinning up again on new requests, that's going to be dirt cheap. Adding mLab MongoDB with a max of 496 MB storage is $0/month on top of that.

NotWearingPants posted:

And also some basic email hosting would be nice too.

Any Node hosting that bundles email service is almost certainly junk that should be avoided.

Roadie fucked around with this message at 05:32 on Oct 23, 2019

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Inacio posted:

I just use a DigitalOcean droplet and throw my poo poo in there.

This is a good solution for cheap hosting if you're ok with admining stuff yourself. I've got several sites on their hosting.

Adbot
ADBOT LOVES YOU

Ape Fist
Feb 23, 2007

Nowadays, you can do anything that you want; anal, oral, fisting, but you need to be wearing gloves, condoms, protection.
Interacting with Docker for the first time is as unpleasant or perhaps more unpleasant than interacting with Git.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply