This article discusses performance and reliability best practices for Express applications deployed to production.
For a high-traffic website in production, the best way to put compression in place is to implement it at a reverse proxy level (see Use a reverse proxy). In that case, you do not need to use compression middleware. For details on enabling gzip compression in Nginx, see Module ngx_http_gzip_module in the Nginx documentation.
Before diving into these topics, you should have a basic understanding of Node/Express error handling: using error-first callbacks, and propagating errors in middleware. Node uses an “error-first callback” convention for returning errors from asynchronous functions, where the first parameter to the callback function is the error object, followed by result data in succeeding parameters. To indicate no error, pass null as the first parameter. The callback function must correspondingly follow the error-first callback convention to meaningfully handle the error. And in Express, the best practice is to use the next() function to propagate errors through the middleware chain.
One thing you should not do is to listen for the uncaughtException event, emitted when an exception bubbles all the way back to the event loop. Adding an event listener for uncaughtException will change the default behavior of the process that is encountering an exception; the process will continue to run despite the exception. This might sound like a good way of preventing your app from crashing, but continuing to run the app after an uncaught exception is a dangerous practice and is not recommended, because the state of the process becomes unreliable and unpredictable.
Node applications crash if they encounter an uncaught exception. The foremost thing you need to do is to ensure your app is well?tested and handles all exceptions (see handle exceptions properly for details). But as a fail-safe, put a mechanism in place to ensure that if and when your app crashes, it will automatically restart.
Lena, our guide in Moscow was excellent. She was very knowledgable and could answer any question we had for her. We liked that she could pick up on our interests and take us places we might not have thought of to go. When we realized that one of the places we had chosen to see would probably not be that interesting to us, she was able to arrange entry to the Diamond Fund and the Armoury for us. Riding the Metro with Lena was a real adventure and a lot of fun. In Saint Petersburg we found Anna well versed in the history of the Tsars and in the Hermitage collection. Arkady in Veliky Novgorod was a very good guide and answered all of our questions with ease. Novgorod was perhaps a long way to go for a day trip, but we did enjoy it. Vasily was a great driver to have and kept us safe with good humour and skill. We enjoyed ourselves so much, my daughter says she is already planning to return. We would both have no hesistation to recommend ExpresstoRussia to anyone we know.
Moscow has a long and interesting history and has been the capital of Russia in many of its different iterations – capital of the Grand Duchy of Moscow, the Russian Empire and of course the Soviet Union (who could ever forget the Soviet Union?). Moscow, was founded in the 12th century by Prince Yuri Dolgaruki (Yuri of the long arms – he really did have long arms!). From that time on, it was home to the Russian Tsars until Peter the Great moved the capital to St. Petersburg in 1703. The city has survived invasions and sieges from the Mongols, the Tartars, the Poles, Lithuanians and Napoleon but has always persevered. Our Moscow tours will enlighten you on this great history and give you insights into Muscovites and their unique culture. Our Moscow tours show you what the city is like today but also brings to life the past. Moscow never seems to sleep and is bursting with energy. A Moscow tour with Express to Russia is truly the best way of getting to know Russia`s largest and most vibrant city.
Any time of year is fine depending on what you plan to do. Summertime is pleasantly warm, ideal for exploring the city and its vibrant atmosphere, but Moscow will be much busier and accommodation is more expensive. Winter can be quite cold but beautiful nonetheless, and this is unproblematic if you intend to spend most of your trip in museums and galleries. There are also various festivals and events organised throughout the year. For more information about the best time to visit, read our guide.
If you plan your itinerary strategically and aren’t averse to a packed schedule, you can cover Moscow`s main sights over a long weekend. Most popular attractions are in the city centre, and the Moscow Metro allows you to cover much ground in a small amount of time. Ensure that your accommodation is fairly central and book tickets in advance, so that you can make the most of your days. For an informative and well?organised day out, check out our Moscow day tours with options to suit all interests.
As Russia`s capital city, tourists are well accommodated in Moscow. There should be English-speaking staff in restaurants, bars, hotels, shops and attractions in tourist hotspots, and there are also English-speaking tourist police. Transport services have English translations on their maps and English announcements via intercom; alternatively, order taxis from the Yandex Taxi app (Russian Uber), though it`s unlikely that your taxi driver will speak English. If you get stuck and cannot communicate, it`s fine to use Google Translate.
We offer best express
best express, best, express,