Tag: interesting

  • Node.js or PHP for a large-scale web platform?

    Node.js or PHP for a large-scale web platform?

    A couple of months ago, we were at the final step of teaming up with Uncoated.

    The company is a danish-based digital marketing agency, helping brands drive business and customer relationships. We were looking at building a SaaS solution from the ground up. This digital product was to be aiding marketing specialists from McDonald’s in various locations worldwide, giving them the opportunity to create gamification campaigns and thus drive more business. We were looking at a blank page and we had the freedom to choose whatever appropriate technologies we wanted and felt comfortable with.

    Fast forward to today,

    the task we have at hand is to build an API that will be consumed mostly by 2 front-end applications. The API has to be prepared for a huge amount of requests and will be processing a lot of user interaction event and building insights reports based on them.

    The platform will be serving the execution of key marketing activities – the creation of campaigns, based on gamification, which will be gathering many users all at once. Our prognosis is that we will have at least 100 000 active users per day during a running campaign. This may go up to 500 000 or even more per day, which makes a good amount of requests while the users are actively playing. Of course, the platform will have common functionalities like authentication, roles and permissions, real-time, mailing, CRUD operations on different resources, etc.

    Each team at Lab08 is dedicated to one particular product.

    As a Tech Lead of this team, I had the opportunity to research and propose the tech stack and approach for building this solution. Considering what technologies to use, we sat down with the team and laid down our options. What tools do we have on the table for executing this task?

    • As a company, Lab08 has a lot of experience with PHP 7.x  and lately with 8, together with Laravel from version 5 to the latest one (8). Back in the day, we have also had our close interaction with Symfony, Zend, and CakePHP. We have used and still use some of those technologies for building various web solutions.
    • Most of the senior developers/tech leads in the company have a strongly typed technology background – Java, tools like GWT (deprecated), TypeScript.
    • We do have a lot of experience with AWS as a cloud services provider
    • And almost all of the tech guys in the team have experience with JavaScript in all kind of forms — Vanilla JS, React with Redux, Angular, Vue.js with Vuex and Node.js with Express 

    Both PHP (with Laravel) and Node.js (with NestJS) will do the job, but there are a few things we took into account that helped us make our decision:  

    • PHP is great, especially with the latest releases, it offers great performance and a lot of improvements, but still, Node.js shows better performance thanks to the async approach
    • The well-known advantage of using JavaScript for the back end and front end also gives us a lot more flexibility in the development team – this means that more developers can contribute to both the front and back end and collaborate more on different components of the product we will be building
    • NestJS enforces good DDD architecture and separation of concerns, so one can  invite an Angular Front-End developer to work on the back end and he/she would manage with ease
    • Node.js is better when it comes to building a JSON API – it is not messing up with HTML (separation of concerns), while with PHP you may have the temptation to serve HTML right from the monolith
    • Node.js and especially the NestJS communities feel more conversant. In the PHP world, it takes more time to filter out the noise, there is a lot of information for every potential problem you have in PHP, but most of the solutions are far from the best
    • With the rapidly growing ecosystem around JavaScript, which has its pros and cons, comes NestJS which gives the promise of LTS and relies on proven architecture and principles
    • A lot of popular programming languages like Python, Java, C and Ruby can be compiled to JavaScript – see here
    • npm/yarn have a large pool of dependencies and they require more wise picking and double-checking when it comes to installing yet another dependency in the project. Personally, I don’t think the composer world is much different. you always have to think twice and verify when you invite someone else to contribute to the code inside a project
    • TypeScript is way better than PHP’s native types of “warning” support. Of course, it comes with a learning curve for people who have never used a strongly typed language and it has drawbacks when you want to use some npm dependency that doesn’t have TypeScript support, but the truth is that almost all of the popular packages already have it

    In the end, based on all of the above, we chose Node.js and so far everything looks promising in terms of performance, development speed, unit testing. We will be happy to share another update after a couple of months, where we will cover the biggest challenges we have faced and essentially provide an answer to the question “Would it be better if we were doing this with PHP?”

    Dimitar is a Tech Lead for one of the teams at Lab08. He has 7 years of professional experience in product and outsourcing companies. He has domain experience in areas like marketing, social networks and e-commerce. Dimitar speaks PHP, NodeJS and is a certified Java 7 specialist. In his work, he used databases such as MySQL, PostgreSQL, MongoDB, as well as the following cloud solutions: AWS, Google Cloud, DigitalOcean. Mitko has experience in the design and architecture of systems and databases. He will be one of the main contributors to our future tech blog posts. Stay tuned!

    Be sure to follow us on social media to receive updates about other similar content!


  • The Hows and Whys of Machine Learning

    The Hows and Whys of Machine Learning

    *This article was written by a former Software Developer at Lab08 – Sophia Peneva*

    Machine learning (ML) and Artificial intelligence (AI) are two terms that, due to their futuristic undertone, have earned themselves huge popularity. Both of them have the attractive quality of making people who use them sound smart and are thus widely used despite not being widely understood. What I hope to achieve with this article is to shed some light on ML while simultaneously trying to avoid the usage of greek letters to the best of my abilities.

    So what is ML actually used for?

    Think about your YouTube recommendation section. The more videos you watch the more it will give you suggestions that will fit your taste. In other words, the more you interact with the platform the more it LEARNS. This faces us with the key ingredient that makes machine learning possible – data. In addition to data, we also need a pattern and the lack of a mathematical formula that would solve our problem but the two latter elements we can do without whereas without structured and relevant information, learning, unfortunately, is not possible. Why is that?

    Well let me put it this way: if there is no pattern, you can try to learn as much as you want but the only knowledge you will acquire is that there is no pattern. On the other hand, if there is a magical mathematical formula that gives an answer to your question, machine learning will do the trick but you would have been better off just using the formula. So for both of the cases, ML can help but in the case of the latter, it would quite frankly just be a waste of time. And lastly, what would happen if we have no data? Well, that’s a dead end. How do we learn without having anything to learn from? See? It’s simply not possible.

    Okay, enough beating around the bush. Let’s assume we have data. What do we do with it? 

    Let’s go back to the YouTube example. You, as a user, can be represented as a vector of characteristics such as [0.4, 0.67, 0.25, … ] where each value in the vector represents how much you like something in percent (ex. You only like 40% of commentary videos, 67% of funny videos, 25% of science-related videos and so on). Similarly, videos can be represented as a vector. For example, the vector [0.7, 0.9, 0.16, … ] would tell us that this video is 70% of the video content is made up of commentary and so on. The match factor between the two vectors will give the user rating for the particular video. Sounds great, but that’s not learning. In this case, we already have knowledge about both the user’s likes and dislikes and the video’s content. But how did we get to that stage? We fill the vectors with completely random values and then the machine will try to extract the real values using the ratings we already have.

    Let’s go throught how this ‘learning’ process happens with a model that classifies images.

    To illustrate the basics of linear image classification we will use the CIFAR-10 dataset as an example. The CIFAR-10 dataset consists of 60000 32×32 colour images in 10 classes, with 6000 images per class. There are 50000 training images and 10000 test images.

    Sample image from the CIFAR-10 dataset

    What we are aiming for is to train a model that upon receiving an image that is a representation of one of these 10 classes would be able to correctly classify it. We can build the image f: X → Y where X is the vector representation of the image and Y ∈ (0;9) (where the value of y corresponds to one of the 10 classes in the dataset).

    First things first, how do we get the vector from an image?

    An image is just a grid of numbers between 0 and 255 e.g 32x32x3 for the 3 RGB channels. This matrix can then be reshaped into becoming a 3072-dimensional vector. Since we are describing a linear classifier, as the name suggests, we are going to use some linear function to classify our images. So the image f: X → Y would look like this: Y = g(WX + b). The values in the W matrix are called weights, the ‘b’ in the vector stands for bias and g is some sort of function.

    Multiplying this 1×3072 matrix with a 3072×10 matrix and adding a 1×10 would result in a 10-dimensional ‘scores’ vector. The goal is to generate this 3072×10 matrix in such a way that the biggest value in the 1×10 vector would be located at the index corresponding to the image’s class. So the ‘g’ function would get the index of the maximum value from the scores vector.  

    But how do we produce the matrix and the bias that apparently hold the key to our linear classifier?

    As mentioned above, initially our matrices are created by generating random values which then have to be optimized. This, however, brings up another question.

    How do we grade how well our model performed in order for any optimization to take place? What we are looking for here is a  loss function. A loss function maps decisions to their associated costs and it can also be thought of as an error function. 


    Let’s define the function as:

    where i is the index of the current image, j is the current class, s is the scores vector, and yi is the index of the correct class for the current image.

    Let’s look at an example where a vector representing a ship multiplied with the weights resulted in a [3.2, 5.1, -1.7] scores vector. This incorrectly classified our image as a horse. Now let’s calculate the loss for this image.

    Loss = max(0, 5.1 – 3.2 + 1) + max(0, -1.7 – 3.2 + 1) = 2.9

    We do this for all images we want to classify.

    What we want to do is to minimize the loss function. In order to understand how to do that, one can imagine being in the mountains. The peaks and valleys represent the local maximums and minimums of our loss function and in order to minimize our costs, we have to go down the slope to our local minimum. This is accomplished with the gradient descent algorithm. The gradient of a weights vector is a vector of partial derivatives with respect to the weights. This vector tells us the direction of the steepest slope. Therefore taking steps in the direction of this negative gradient will minimize our loss function. 

    It is important to note that depending on the starting position, and the step size, the global minimum of the loss function may never be reached. This is owed to the fact that our weights are always moving down the biggest slope when the deepest valley can be located just behind the adjacent peak.

    Nowadays, image classifiers are widely used with a state of the art accuracy of around 95%. Of course, a lot more goes into training a model in order to achieve such results. In our example, we based our output only on one set of weights but in reality, convolutional neural networks( CNNs) have a lot of layers, each one searching for some specific feature in the image. For example, one layer could check if there are any ears in the image, another one can look for a head with ears and so on. 

    A great example of an image classification use case could be found in UserTribe’s emotion recognition. UserTribe is a platform that helps businesses gather customers intel about their projects. Lab08 has been working on UserTribe’s platform for almost 2 years now – developing new features and making sure this product is placed ahead of its competitors. Through video recorder product tests, companies can understand how their users feel about them and what they create. In order to create an automated report on someone’s opinion based on a video, UserTribe uses ML to extract sentiment from what is said but also takes it a step further and analyses the customer’s facial expressions while they interact with the product by adding social anthropology experts into the mix.

    Similarly, to our ten class example from the CIFER-10 dataset, UserTribe recognizes 7 different emotions. Their model has been trained on 30000 images and has achieved the 95% SOTA accuracy when tested on the CK+ dataset. Every video is converted into 1 fps (frames per second) as detecting facial emotion at each frame would both be redundant and very inefficient. After that, every frame is classified by the model which consists of 19 convolutional networks with a softmax activation function. Activation functions in CNN are what transforms our model into a non-linear classifier and essentially allowing it to perform more complex tasks. But this is a step too deep for the purposes of this article. So deep in fact, that it enters realms, not of Machine learning but those of Deep Learning which is a whole new conversation.

    Sophia Peneva used to work as a Software Developer at Lab08, contributing to the growth of the Usertribe (now GetWhy) platform. Previously, she has worked for SAP and is currently a part of Google’s team, starting as an intern, working on a Youtube algorithm project, while she was a part of Lab08. She has experience with C++, PHP, Python, Java, MySQL, MongoDB and others. When it comes to deep learning, Sophie now has Tensorflow experience in her pocket. Sophie has been interested in ML for quite some time, showing great passion and engagement in getting her hands dirty. We hope you’ve enjoyed the product of her enthusiasm!

    Be sure to follow us on social media to receive updates about other similar content!


  • Lab08’s strengths and ambitions presented to DEV.BG

    Lab08’s strengths and ambitions presented to DEV.BG

    This blog post is a translation of DEV.BG’s article about Lab08 in 2020 and beyond as a place to work, presented by our Talent Community Manager Diliana Beeva. You can find the original article in Bulgarian here.

    Diliana Beeva, Talent Community Manager at Lab08

    Lab08: the company that knows how to develop software products

    Diliana Beeva is the Talent Community Manager at Lab08. Thanks to her experience in the field of human resources and her diverse interests, she holds the responsible task of taking care of Lab08’s team, the brand and its presence in the digital and physical space. Diliana is experienced in the recruitment of IT specialists – from system administrators through workplace services consultants to software developers using different programming languages. Today, she introduces Lab08’s special powers and shares what makes this growing company different from others in the industry.

    Smart and steady growth, together with our customers

    We are a Bulgarian-Danish company that has been building successful products for partners from the Scandinavian market for over two years. Our story is related to Komfo and the eponymous successful social media management product. Now, our management team is transferring its many years of experience from building a world-class quality solution to Lab08. Our business is in the technical implementation of the products we develop but also in quality product management. We are happy to have the opportunity to educate our customers on the right strategy for developing a software product. We strive to give the maximum added value with the services we offer.

    We are dedicated to long-term partnerships with our clients. In this way, every employee of Lab08 has the opportunity to deepen his/her knowledge in a given field. On the other hand, the products we work on are diverse, and when someone feels like it’s time for a change, he/she has the opportunity to start working on new challenges and with different technologies. We create solutions in the field of marketing through gamification, the issuance of digital and verifiable education credentials, as well as the provision of high-quality behavioural analysis with the help of artificial intelligence and social anthropology.

    We have our ambitions and potential for growth but for us, this is not the most important part. It is much more important that this happens with the right people and we have always been careful, both in choosing partners and clients and in hiring good professionals. In both cases, the involved parties must be in good sync with each other.

    Lab08 in 2020

    This year surprised everyone. However, Lab08’s team has many reasons to be happy – mostly because we have the opportunity to continue with our development, achieving stability. Our reaction to the changing circumstances was rapid and we managed to keep our customers “healthy” by implementing crisis plans with deferred payments and discounts. Our task and a key priority during this turbulent period were to avoid major shocks in both our and our customers’ business.

    We are currently as active as possible in order to achieve our goals, and we are about to start work on building and maintaining a platform that connects companies with the right influencers for them. This domain is extremely interesting, as in recent years it has proven to be one of the most effective methods for businesses to reach the proper audience.

    During the crisis period, we felt a serious lack of physical events for the IT community. At Lab08 we enjoy personal contact and overtime on such events, we have created many quality acquaintances with good professionals. In late summer and early fall, we visited key events for the IT industry, which were held entirely or partially online. Lab08 supported DEV.BG All in One in the digital space and QA Challenge Accepted 6.0 – in Sofia Tech Park and online. Although in a digital environment – we managed to get the most out of the events, offering the audience a similar experience to a physical event. We support a number of initiatives in the software industry and continued to do so during the crisis.

    New horizons

    One of Lab08’s short-term goals is to build a mobile development team. More and more of our partners share that their strategy is to enable their users to access their products through a mobile application in a quality and professional way and without compromising the user experience. One of the first exciting tasks for the team will be to build an application that is in addition to a platform for conducting user surveys, including video and audio recording, as well as screen recording. Through the application, each participant will have the opportunity to take part in the surveys in a quick, easy and convenient way.

    We offer two positions – for iOS and Android developer who will lay the grounds for the new team. Our plan is to grow this department in the coming months – both with new colleagues and with new interesting applications.

    Peek into the future

    Perhaps contrary to most expectations, we decided to expand our office space, so that our employees feel more comfortable working together. There is also an increasing desire for people to visit the Lab08 office, despite the pandemic, and we are currently combining this with working from home, taking into account the preferences of employees. We have always been flexible and this helps us to react quickly to changing circumstances so that we are ready when the situation becomes more serious. Our strategy is not to be a remote organization but to maintain good teamwork, which happens most successfully when we have the opportunity to be together.

    We have recently gone through a process of renewing our vision and overall communication strategy. Our position is that during a crisis, investments should not be limited for the purpose of business progress and infusion of energy into the development of the company. Through the new brand, we show more clearly our strength, vision, strategy and advantages.

    On the 10th of December this year, you will be able to meet our Senior Front-End Developer Martin, who will share how to build a design system with Vue, Sass & Storybook as a guest speaker for the Javascript user group of DEV.BG. Learn how we develop big ideas at Lab08! 

    Lab08’s team is growing! More information about our open positions can be found here: https://lab08.com/careers/

  • The most valuable lesson you have learned in software development

    The most valuable lesson you have learned in software development

    Many lessons are being offered to each and every one of us along the way. We asked some of our colleagues to share the most valuable ones they’ve learned since diving into the depths of software development. You may recognize yourself by reading some of the below lessons or you may encounter a useful piece of information, especially if you are just starting your career in software development.

    We hope this is as curious to you, as it was for us.

    Lessons #1 and #2

    Be open to collaboration and keep your focus on the task at hand


    It’s not just you.

    You are not the one-man show. Collaboration is the foundation of a good product and its essential ingredient. The lack of sense for teamwork leads to unnecessary, human-based, obstacles. 
    The conclusion: Depth knowledge is more valuable than broad knowledge when you act as a unit in a team. 


    Don’t overthink it.

    If you have a specific task to perform, around which you see potential opportunities to expand functionality and improve it – now is not the time for the big code, no matter how much it is itching you to do something
    The bottom line: Don’t put the cart before the horse.

    Martin Metodiev, Senior Front End Developer
    A book enthusiast, passionate about politics, Vue.js advocate 

    Lesson #3 – Communicate

    Don’t be afraid to ask for help when you can’t handle a task or when you are unsure about something. You are not alone.
    Communication is the key. Even if you just share the problem and the ideas you have in mind – it’s always good to hear a second opinion.

    Stefan Spasov, Software Developer
    Warcraft fan, casual Udemy user, novice cloudspotter

    Lesson #4 – Be brave 

    I learned that getting in deep waters, in addition to being somewhat scary, is also extremely exciting. Every moment I come across something unfamiliar to me is exciting because I am about to learn something new.

    Stefan Romanov, Junior Software Developer
    A heavy metal fan with a soft spot for Real Madrid

    Lesson #5 – Don’t give up 

    The most valuable lesson I have learned since I started programming is that there is nothing is impossible to be done. If something doesn’t work out, I’ve either used the wrong technology or I just don’t have enough knowledge. The most valuable lesson I have learned since working in the IT field is how important teamwork is and how with a good team, the work becomes much easier and more enjoyable.

    Atanas Dimitrov, Software Developer
    AUBG Alumni, really into swimming, can’t wait to start on our new project with .NET

    Teamwork

    Lessons #6 and #7 – Don’t forget your social skills at home and be flexible when trying to find a solution to a problem

    Programming is a technical representation of digital solutions to various problems. Unfortunately, technical knowledge alone is not enough to solve problems, and in general, building solutions involves more than one person. For a programmer to be successful and to develop in his career – in addition to the mandatory good technical training, good social and communication skills are required.

    Almost always – a problem can have many solutions. It’s the same with programming. The most important lesson for me is that the first solution that comes to mind is not always the best and it is better to iterate and try different ideas in diverse phases of the process so that one can conclude that there is a better solution, does not require a start over and the amount of work that is ‘in vain’ is as little as possible.

    Teodor Nikolov, Tech Lead 
    An IoT enthusiast and a salsa-dancing hobbyist

    Lesson #8 – Take your tim

    I’ve learned that it’s much better to take enough time to do something right than to take the time to redo it later on. 

    Nikolay Manchev, Front End Developer
    Casual gamer, novice Swift developer, claims to be a Front End impostor

    Lessons #9, #10 and #11 – Don’t stop moving, don’t stop learning and don’t forget how powerful teamwork can be

    1. “Life is like riding a bike: we have to move forward so we don’t lose our balance.” Albert Einstein
    Develop constantly. This applies to all areas but is especially important in programming. A person who does not move forward is falling behind.

    2.“Self-education is, I firmly believe, the only kind of education there is.” Isaac Asimov
    Don’t just rely on school/university/courses, etc. to learn. Some of the most important things I know I have learned myself. Search, read, try and you will succeed.

    3. “If you want to get fast, go alone. If you want to get far, go together.”
    Do not underestimate teamwork. Do not underestimate personal qualities at the expense of professional ones. I would rather work with a person with little or no experience but serious and willing to learn than with a person who knows a lot but does not work in a team and does not try.

    Georgi Todorov, Front End Developer
    A newlywed man, somewhere in between fitness and philosophy 

    Lesson #12 – Diversity of opinions is what organizations should be striving for

    Each company has its own culture and set of formal and non-formal rules and habits. The individuals an organization hires can share the same general mindset and same work ethic. But these people can come from different backgrounds, cultures, interests, leading them to their passion of working for given company. Thus, an organization can benefit from a richer perception of things and better products and services can emerge on the market. 

    Dinko Tanev, Managing Partner at Lab08
    A.k.a. The Boss, enjoys Italian music and asking challenging questions on interviews

    Shared vision for the future

    We look forward to the future and the many new lessons to come!