“
What to do? This is not just another quote. In addition to the entertainment component of such sites, it also carries a high goal - helping people solve their problems.
The mechanism of the service is quite simple - visitors ask questions, usually related to solving difficult life situations. Other visitors can vote for the question, depending on whether they consider this problem worthy of discussion or think that there is no problem in this situation as such. Selected questions fall into the main tape and thematic sections.
To each of the questions, visitors can leave their answers. Unlike the questions themselves, which can be asked anonymously, only authorized users can leave answers. Authorization itself is done through OAuth of popular social networks and should not cause difficulties.
')
“What to do?” Tries to keep the answers clean and useful. This means that the answers in the style of “kill yourself against the wall” and others that do not carry a payload or offend the author of the question are ruthlessly deleted, and the authors of such answers are blocked.
And what's under the hood?
V8! Yes, “What should I do?” Works on Node.JS, and MongoDB is used as the DBMS. Such an unusual choice is due to the fact that the site was originally created for self-development. As soon as I ran into Node.JS, I immediately wanted to check it in “combat” conditions. Because various “Hello world” objectively do not reflect the capabilities of the technology and do not show all the pitfalls, it was decided to make a small project. Looking ahead, I will say that I did not regret the choice of technology.
The site was created for a long time. A very long time. It was created with the soul and for the soul. The first lines were written a year ago, and the site itself was launched last August. There was nowhere to hurry, and it was developed in his free time from work and other affairs, which, it turns out, is not so much.
When meeting Node.JS, I began to study popular web-frameworks for this platform. At that time, there were already some interesting solutions, such as
express , but they all did not suit me. And I decided to make my
bike framework with blackjack and everything else.
From the framework, I wanted the following:
- MVC
- Routing
- Work with DBMS
- Template engine
- Multi-language support
- Multithreading support
- Minimum overhead
In short, the life cycle of this framework was: development, debugging, implementation, removal. But it was not a waste of time. He let me know how convenient the modular structure of Node.JS. With the help of a selected set of modules, solving the problem turned out to be much easier, while there is no feeling of a “bare” language. In essence, the frameworks themselves are a set of modules, their configuration and some improvements from themselves. Having got rid of the binding to the framework, it becomes possible to independently update modules (which develop quite quickly) and “bend” the system in a way that is convenient for a specific project. In the version of Node.JS 0.6 there was built-in multithreading for network connections and the need for crutches was completely eliminated.
During the development of the site Node.JS managed to release major updates 2 times. Along with these updates, incomprehensible memory leaks and unexpected drops, which so overshadowed the overall result, disappeared. Now the site is stable and I decided that it was time to show it to people. So,
Wellcome .
It was a pleasant surprise to see “What to do?” In the “
Website of the Day ” section on
www.ferra.ru . At that time, the site was under development and testing, contained errors and was not advertised anywhere. Thanks to the editor of the section for the review.
In conclusion, I want to say that the development of a web project on Node.JS I liked. Node.JS has grown significantly this year. All the experience gained during this time is very difficult to present in one article, therefore I will highlight the main advantages and disadvantages.
Pros:+ One language on the server and on the client.
+ Low threshold for entry into development (JavaScript is more or less familiar to most web developers).
+ Asynchronous IO.
+ A large number of
modules .
+ Lack of overhead to initialize configurations, load application modules, since it is initialized once at startup.
Minuses:- In case of a fatal error, the entire application crashes, not just a single request.
- It is necessary to strictly control memory leaks, because The application works “for a long time” and not within the framework of a single request.
- There is a chance to get a huge number of functions nested in each other, if you don’t initially approach the structure of the code correctly.
The drawbacks go away with the experience of developing and developing the Node.JS itself, so I believe in its future.
I deliberately did not mention the speed, because It depends on many factors and objectively evaluate it and compare it with other languages only on two applications with the same functionality, loaded with the same data and on the same hardware. I don’t have such an opportunity, so I’ll just say that I’m satisfied with the speed of Node.JS.
PS The site is optimized for modern mobile browsers.