Posts Tagged development
Refactoring code
Hi all,
One of the things we knew when we started Inkzee is that our code was going to be refactored several times. For those not familiar with this term, it means to rewrite part or most of the code so it gets better, cleaner and easier to maintain.
Having no experience about scaling web applications we knew that we would be forced to rewrite parts of the code so the web app could scale and remain responsive under big loads. Until now we had done a couple of big code changes, but just to add new features or to change the way a submodule worked. We though that a big redesign of the code was paramount but not as soon as we expected it. As many first time entrepreneurs, we were very naïve about this and we suddenly found that the application needed a redesign so it could handle the load very early on. It’s funny because Inkzee doesn’t scales with the number of users, but with the number of feeds the system has. Of course there is a correlation, but we have users with 20 subscriptions and users with 800 subscriptions, so it’s not a matter of having 2 users what hurts performance, but a matter of having the system feeds duplicated in weeks.
That said, we started rewriting the web architecture so we could handle a bigger load and so the alpha would go back to a stable state. People have been asking us when is it going to be completed and we truly understand them. There is a growing list of people wanting to test the alpha and development on the alpha is very slow. The reason for this is that, because we are so small, we can only afford one developer that has to handle everything, from server administration to development or unit testing. We’ve been working really hard on the new architecture but it has come with a high price.
We’ve added internal unit testing so we avoid shipping new releases that break previous functionality and to ensure the maximum quality for our code. This has pushed the release date even further. Another big hurdle we encounter is that we found ourselves changing the semantic algorithm due to the way the new architecture works. This has been giving us big headaches as it’s a complex piece of code and testing it isn’t as easy as it sounds.
Finally, we’ve fixed some big character encoding issues the old code had. For starters, characters aren’t codified in the same way across all platforms, depending on the operating system, editor encoding and a myriad of other possibilities, characters can be encoded differently. Our system needs to handle everything with the same encoding, that means we need to decode everything that enters the system before we can work with it. This is something that seems easy, but in fact, is one of the most uncomprehended problems for most developers. Needless to say that it took us 3 days to hunt down a very obscure bug in our backend that broke the parsing of some feeds.
So here we are, about to launch the new scalable architecture of the alpha after a couple of months. We really wanted to thank everyone for their patient and we also wanted everyone to know why it’s talking so long. Hopefully it will be operative in a week or so. Thanks again to everyone!
The Inkzee team
