Having played with nginx both as a simple file server and a reverse proxy, it's time to explore another way it can easily improve your application. Using it as a load balancer can give your application a boost in the terms of availability, while not requiring that much of the configuration. Just take a look.
I've been around the language for over 18 months now and I'm still very excited about it and keep learning new things that can be done and how they can be done. But what is it that makes Go so great exactly? Let me share some thoughts as I'm flying back from my first Go conference, GoLab 2017.
It's often assumed, that if you split a web application into a back-end API and front-end static files, you should have two separate servers for them. While this might be a good idea from an architectural point of view, you might want your end users to see the product as a whole. Fortunately, with nginx you can easily set up just that by making it act as a reverse proxy.
Whenever you are building a web application, you can generally divide it into two parts: a backend API, which is hosted on some specific application server and a front-end website that consists of static resources like HTML, Java Script and CSS. But how should you serve those files to make them accessible to the end user? One of more popular solutions is use nginx.
In software development, everything seems to be easy until something goes terribly wrong. It might be a major crash of the database server, unexpected interaction with 3rd party service, or our main application getting really slow. How can we monitor and measure the last issue? Take a look at the ways to profile Go application.
Once your forms grow a little bit, it's getting more and more complicated to manage it as a whole. With the latest (6.2.0) version of redux-form, we have a way to split it into multiple parts that can be managed on their own. Take a look on how form sections can help you (and how they won't).
Managing React forms with redux-form package is awesome, as long as you follow the path described in the docs. One thing that is missing there is the ability to have more than one way to validate a form. This post explains a little trick I used to achieve that in my current project.
One of the features that redux-form provides is to have a complex field composed of multiple elements of the same kind. This way, we can easily set up eg. a list of values which each one having its separate input. However, if we want to add some more logic behind the scenes, the whole process gets a bit trickier. Let's take a look.
Arguably the biggest problem of creating a front-end of a web application is that you cannot be sure in what exact environment your scripts will be executed. Unlike back-end, where you can install given versions of Java SDK, know everything about the host machine and database versions - here you need to support a wide spectrum of browsers, screen resolutions etc. One of the problems I ran across recently is having to support Internet Explorer by my React app - how do you do that?
Handling forms seems to be one of the things that should be extra simple in React, but somehow require a lot of effort. Unlike Angular, you cannot simply create a two-way data binding and expect a value to be updated. How should you deal with it then? Enter redux-form package.