arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
database: networking and security
#12
I think I'll leave out the quote so it doesn't turn into a wall of text Smile

In terms of traffic, it's hard to predict - for right now the only users are me and my flatmate, and it runs like a dream just using php files served over http to interact with the database; but I can definitely imagine performance to decrease with a lot of concurrent users. However, as I've said, I designed the client with minimalism in mind. All player interactions are turn based, and database queries are timed; but in a dream scenario of 1000s of concurrent users, it probably wouldn't be enough.

I think there is some wisdom in what you advise: finish it first in php, and then add on what's needed, and change what can be improved. So for now, I think I'll stick with the traditional relational database and php for the backend, and focus on getting just these 2 pieces working as well as possible. If performance demands it, I can work on swapping php for nodejs. If performance demands more I turn to memcache. And if I'm fortunate enough to build a large community of paying users, I can look into redis.

I've already converted a few of the scripts to js - but I can see what you mean about a different mind set. In php, I was very careful with a few things: to sanitize all the inputs, as php is known for injection vulnerabilities.  I made sure to place lots of exits in every script: if at any point anything goes wrong, the connection drops and error returned. None of this was too complicated; it just involved some learning.

But js is proving more difficult. The language and syntax feels much more complex than php. There's uppercase and lowercase and punctuation everywhere. For me, it's quite simply hard to look at and read... but as you said, there is a learning curve. I'm  sure with practice I can improve. Nodejs recommends leaving the connection open and reusing it, as opposed to closing the connection - which in my mindset just seems odd, but I can see how it would get a little performance gain. The methods of sql injection prevention are very different and less well documented (unless I'm just looking in the wrong places - which is very possible). Although I do like that nodejs can run asynchronously, whereas php cannot.

Thus far, I've coded all of the server scripts by hand, and I'll probably do so for the immediate future, until I get my footing. I think it's important, starting out in the learning process, to code from scratch so I can get used to the syntax and structure of the language. At least until I can look at it and trace the flow of information in a script. Perhaps I'm wrong? Also, while it's handy to have ready made tools that do  what I want, it isn't always the most efficient. In my experience, it can lead to bloat and unnecessary complexity, so I'll try and stay away from libraries and packages until I have a better understanding of what they do and how to modify them to my needs.

Regarding your self-coded web server, it's a topic I never considered for myself (until now), and I'm curious why you thought it was necessary/beneficial: what purpose did you have in mind when writing it, and what methods did you use to achieve this purpose? Even your simple explanation has given me a few new terms to look up: while it might seem easy to you with your experience, it could prove an opportunity for learning for me (and others who might view this in the future)

We do have a few nice VPS here with specs that would probably handle live testing; but I'm hesitant to ask for it for a couple reasons:

1. As an app in development, my usage is very low, and I'd feel bad about having one of the best VPS we have and not getting high use out of it.
2. I like posting, and having the freedom to post. If I won a VPS here, and find it useful, then I'm locked in. My choice to post or not is now limited, and with consequences.
3. I feel like I'm still not quite ready for it: both in my knowledge/experience, and in my need. While I hate to admit it, my precious app could completely flop, regardless of the architecture it's running on. Is it really desireable to add on more and more technology/expense/work without any success to warrant it? I think not; but I'm an expert at making mistakes.
4. It's a risk. There is no guarantee that I'll keep the vps, even if I can win it. If someone comes along and makes more quality posts than me one month and asks for it, they might get it - and that would be fair. While currently we have an abundance of vps at the ready, that could change at any time. An influx of high energy posters could mean that our vps wins become highly competitive - much like the old days of freevps. Which would be great for the community,  but it'd suck for me to spend days/weeks/months setting up a redis system that's integral to my apps operation only to have it snagged from underneath me by a superior poster.

I'm not opposed to reading books; I'm fortunate to have an old kindle lying around that should be perfect for reading e-books. I tend to agree with you regarding the quality of web tutorials, which is why I specifically mentioned "good" tutorials. 

The big issue I have with tech docs (although I'll read em if necessary) is they often contain a ton of jargon and explain everything in the most verbose and complicated way possible. It can take forever to get through tech docs when you have to stop every minute and look up a new term, or read through a wall of text to get a concept that should be explained in a few sentences.

I really like the format w3schools is set up with; but it doesn't cover all the topics I'm interested in. It gives simple explanations for the smallest possible code fragments with examples, and demonstrates how those fragments can be assembled to work together with the minimal amount of jargon possible.

That being said, I enjoy learning and reading, so I'll likely examine anything you recommend. I can't guarantee I'll read everything but I will definitely give it a look - I'm going now to see what I can learn about Apache Cassandra and try to find out what an MVC model is Smile


Messages In This Thread
database: networking and security - by fitkoh - 11-19-2020, 06:48 PM
RE: database: networking and security - by fitkoh - 11-20-2020, 08:53 PM
RE: database: networking and security - by fChk - 11-21-2020, 06:48 AM
RE: database: networking and security - by fitkoh - 11-21-2020, 08:40 AM
RE: database: networking and security - by fChk - 11-21-2020, 12:03 PM
RE: database: networking and security - by fitkoh - 11-24-2020, 05:47 PM
RE: database: networking and security - by fChk - 11-26-2020, 10:48 AM
RE: database: networking and security - by fitkoh - 11-26-2020, 04:48 PM
RE: database: networking and security - by fChk - 11-28-2020, 06:59 AM
RE: database: networking and security - by fitkoh - 11-28-2020, 06:49 PM
RE: database: networking and security - by fChk - 12-04-2020, 10:00 AM

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting