11-28-2020, 06:59 AM
(11-26-2020, 04:48 PM)fitkoh Wrote: From what I've read recently memcached may be better for me at the present. The system requirements to run redis seem a bit steep for a small fry like myself. From the redis docs, 4GB ram is recommended for development; for a production environment start at 15GB and 3 nodes. From your experience, would you say these recommendations are appropriate? Such a set up is unfortunately beyond my means at present.Obviously it'll all depend on your traffic load and the popularity of your WebApp. Indeed, Memcached is more lightweight compared to Redis, given that Redis has more features than Memcached, including data persistence.
Memcached, from what I've read seems a lot more forgiving and flexible in terms of system requirements; I believe I could set up a development environment with the tools I have on hand, which is a big perk for me.
There are pros and cons for both technologies and it all depends on the use case for chosing the best one. Memcached store data in memory and is volatile (no filesystem caching); it's best feature is that it supports clustering while Redis doesn't (it's single machine as of version 4.)
Redis best features is that it has data persistence while functioning in operational memory with blazingly fast performance. It can even be used instead of MongoDB as long as the data model stored is fairly simple.
For development purposes, I would advise you to try to get one of Post4VPS VPS-9 and do your live testing in there; it should have all the resources you would need. If not, a VPS with min. 4GB RAM, 2 vCPUs might get you going...
As a side note, Apache Cassandra is yet another in-memory key-value stores that has clustering capabilities
(11-26-2020, 04:48 PM)fitkoh Wrote: I did a bit of browsing at w3schools and the nodejs web server looks fairly straight forward. I think it would be a relatively simple matter to port my php scripts over to nodejs within a few days or maybe a week.Not so sure about that :-)
You need time to get used to Node.js and its ecosystem including the NPM package manager tool and its library of packages in circulation.
I would imagine that you won't code anything from scratch (as I did 6/8 years ago) and that you'll be using the existing popular NPM packages to get the job done (eg http-server, express, websocket etc...)
You see, the first thing to do is to learn the fundamentals and core concepts of Node.js, once done you need to get used to 'Express' which is the most popular web application framework for Node; or 'Backbone.js' which creates an MVC model around the http-server etc...
In my mind the process has a learning curve, at least, to get used to all the APIs that those packages will provide you to build your own scripts on.
This is why I only use Node.js everything else around it is my own code that I maintain with every iteration of Node.
This is also why, I think, it's better to finish that project in PHP before switching to Node.js (which is an entirely different state of mind.)
(11-26-2020, 04:48 PM)fitkoh Wrote: I'm curious what techniques you used for your node web server; if there are any particular pitfalls or caveats to avoid; or anything you'd specifically recommend. Perhaps that would be a topic for another thread?Not sure if I understand what you meant by 'techniques', but if you meant the use of the old-style based on call-backs vs the more recent one based on Promises, then my response is both. Initially (before the advent of Promises in JavaScript) it was all call-back-based (the famous Callback Hell!), but did some modification when Promises were introduced around 2015.
I'm planning to get a P4V VPS again and maybe I'll be posting more on Web development topics then. Up-till now the majority of my contributions here were done with my SysAdmin hat ON given the audience :-)
(11-26-2020, 04:48 PM)fitkoh Wrote: One thing I'm having some trouble with is finding what I would call a "good" tutorial for either memcached or redis. There's plenty of docs, which is fine, and I'll read them (grudgingly and slowly), but I'd like to find something a little friendlier to the uninformed.I'll check my archives and I'll post few links for reference next week-end - I promise :-) .
I'll also PM you few ebooks for download from my end, if that's ok with you. I'm more of a book type of guy than of an Online reader -Old habits die hard!..
Books have structure and generally are easy to follow if one has the right motivation and matches the book's assumptions for its readership.
Online tutorials quality, on the other hand, varies widely and you need to really trust the source to be an authority on the subject of some kind... The majority are just copy/paste of copy/paste of... of some authority(/or reference doc.)