Profiling web applications in Golang

I've been watching the 2017 Gophercon videos from here. There are many good talks that I would recommend watching from that list.

One that I really wanted to try out on my own was the profiling presentation that Peter Bourgon did. I assume for the sake of simplicity, he left some details out. I've been trying to figure them out on my own.

I was inspired to try to profile my own Golang web apps using the method he presented in his talk. So in this post I'll show you a simplified example of how to profile your own web applications in more detail.

The web app

To see a practical example of profiling and to keep it simple, we need to create a web app that when called on a particular route, performs some sort of calculation and returns a result in it's payload.

If we were to mimic real life scenarios, we would be here all day. So just to keep it simple, we will create a single route that calculates the 25th Fibonacci number when it's called and returns it in the response body.

I've written two versions of the Fibonacci function before hand, one that performs recursion (exponential time - very CPU intensive) and one that calculates the number using a vector (linear time - not very CPU intensive).

In order to use the profiling tool, you need to import the net/http/pprof  package and register some routes. In the presentation I mentioned earlier, the speaker mentioned that we could leave this imported even in production environments since it does not affect performance.

package main

import (
	"fmt"
	"log"
	"net/http"
	"net/http/pprof"
)

// O(n) Fibonacci
func linearFibonacci(n int) int {
	// Create an int array of size n + 1
	v := make([]int, n+1)

	// F(0) = 0
	v[0] = 0
	// F(1) = 1
	v[1] = 1

	// F(i) = F(i-1) + F(i-2)
	for i := 2; i <= n; i++ {
		v[i] = v[i-1] + v[i-2]
	}

	// F(n) - return the n-th Fibonacci number
	return v[n]
}

// O(2^n) Fibonacci
func exponentialFibonacci(n int) int {
	// F(0) = 0
	if n == 0 {
		return 0
	}

	// F(1) = 1
	if n == 1 {
		return 1
	}

	// F(n) = F(n-1) + F(n-2) - return the n-th Fibonacci number
	return exponentialFibonacci(n-1) + exponentialFibonacci(n-2)
}

// HTTP request handler
func handler(w http.ResponseWriter, r *http.Request) {
	// return the 25th Fibonacci number in the response payload
	fmt.Fprintf(w, "%d", exponentialFibonacci(25))
}

func main() {
	// Create a new HTTP multiplexer
	mux := http.NewServeMux()

	// Register our handler for the / route
	mux.HandleFunc("/", handler)

	// Add the pprof routes
	mux.HandleFunc("/debug/pprof/", pprof.Index)
	mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
	mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
	mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
	mux.HandleFunc("/debug/pprof/trace", pprof.Trace)

	mux.Handle("/debug/pprof/block", pprof.Handler("block"))
	mux.Handle("/debug/pprof/goroutine", pprof.Handler("goroutine"))
	mux.Handle("/debug/pprof/heap", pprof.Handler("heap"))
	mux.Handle("/debug/pprof/threadcreate", pprof.Handler("threadcreate"))

	// Start listening on port 8080
	if err := http.ListenAndServe(":8080", mux); err != nil {
		log.Fatal(fmt.Sprintf("Error when starting or running http server: %v", err))
	}
}

As you can see, this is a really simple application, save it to a file called main.go and build it like this: go build -o myserver main.go .

Now you can run your binary: ./myserver and to check if it's working we'll send a request to it:

$ curl http://localhost:8080
75025

The CPU profile

Now, while the server is running, you will need to run two commands in parallel. You first need to start the profiling tool which will record data for 30 seconds after it is run AND as it is running, run the Apache Benchmark tool to send a few requests it's way.

So you will need to run the profiling tool like this:

go tool pprof -seconds 30 myserver http://localhost:8080/debug/pprof/profile

While that's running, run the benchmark:

ab -k -c 8 -n 100000 "http://127.0.0.1:8080/"

This will create a total of 100,000 keep-alive requests to your server, using 8 cores. To better understand what this benchmark command does, it is explained in the link provided.

After 30 seconds, the profiling tool will show a prompt for commands that will look something like this:

$ go tool pprof -seconds 30 myserver http://localhost:8080/debug/pprof/profile
Fetching profile from http://localhost:8080/debug/pprof/profile?seconds=30
Please wait... (30s)
Saved profile in /Users/username/pprof/pprof.myserver.localhost:8080.samples.cpu.013.pb.gz
Entering interactive mode (type "help" for commands)
(pprof)

Here you can run commands to show you how much of CPU time each function took and other useful information. For example, if I run top5  it will list the top 5 functions that are hogging the CPU:

(pprof) top5
84.57s of 85.18s total (99.28%)
Dropped 87 nodes (cum <= 0.43s)
Showing top 5 nodes out of 30 (cum >= 1.09s)
      flat  flat%   sum%        cum   cum%
    51.93s 60.97% 60.97%     51.93s 60.97%  main.exponentialFibonacci
    20.57s 24.15% 85.11%     20.59s 24.17%  fmt.(*pp).doPrintf
    12.06s 14.16% 99.27%     12.06s 14.16%  syscall.Syscall
     0.01s 0.012% 99.28%     11.22s 13.17%  net.(*netFD).Write
         0     0% 99.28%      1.09s  1.28%  bufio.(*Reader).ReadLine

As you can see the exponentialFibonacci function really hogs the CPU.

Please note: These values might differ on your machine. For reference I'm using a MacBook Pro (Retina, 13-inch, Early 2015), 2.7 GHz Intel Core i5 Processor and 8 GB 1867 MHz DDR3 of Memory.

If we wanted to see a graph of this profile we need to run the web command like this:

(pprof) web
(pprof)

This will open up your default browser and display an image of the profile. Here's a crop of the image that concerns our Fibonacci function:

golang profiling

So during that profile, 60.97% of the time, the exponentialFibonacci was running on the CPU.

Optimizations

Now, we know from the theory that O(n) < O(2^n). Let's see if this holds up in practice, it we were to replace the exponentialFibonacci  call with linearFibonacci  inside the handler  function.

Now we run the profile again. You can immediately see that it took less time because the benchmark actually finishes really fast this time.

If we run top5 now, the linearFibonacci  function doesn't even make the cut.  Even if you try to do top100 you will not find it because the compiler inlined that particular code.

So we need to rebuild the application with the compiler flags that disable inlining like this:

go build -gcflags -l -o myserver main.go

 

Now even with this flag enabled I had a hard time finding the function in the top. I went ahead and increased the hard-coded value for the n-th Fibonacci number to 10,000. So I'm looking for the 10,000th Fibonacci number, this number doesn't even fit inside the integer datatype in Golang. It will overflow several times before coming to a stop. I also increased the benchmark to 1,000,000 requests.

Now if I run top5 I get:

(pprof) top5
36.21s of 46.49s total (77.89%)
Dropped 226 nodes (cum <= 0.23s)
Showing top 5 nodes out of 102 (cum >= 1.97s)
      flat  flat%   sum%        cum   cum%
    25.94s 55.80% 55.80%     26.23s 56.42%  syscall.Syscall
     3.38s  7.27% 63.07%      3.38s  7.27%  runtime.kevent
     2.60s  5.59% 68.66%      2.60s  5.59%  runtime.usleep
     2.32s  4.99% 73.65%      4.26s  9.16%  main.linearFibonacci
     1.97s  4.24% 77.89%      1.97s  4.24%  runtime.mach_semaphore_signal

Or in graphical format:

golang profiling

As you can see, it barely even makes a dent.

So for this test, calculating the 25th Fibonacci number recursively takes 60% of the CPU while calculating the 10,000th Fibonacci number linearly takes 4% of the CPU (without inlining).

Another useful command for pprof to see how much CPU time a function takes is the list  command. Or, if you're like me, to find out if a function is actually called.

For our linearFibonacci  function it looks like this:

(pprof) list linearFibonacci
Total: 46.49s
ROUTINE ======================== main.linearFibonacci in /Users/username/workspace/go/src/github.com/username/test_profiling/main.go
     2.32s      4.26s (flat, cum)  9.16% of Total
         .          .      8:)
         .          .      9:
         .          .     10:// O(n) Fibonacci
         .          .     11:func linearFibonacci(n int) int {
         .          .     12:	// Create an int array of size n + 1
      10ms      1.95s     13:	v := make([]int, n+1)
         .          .     14:
         .          .     15:	// F(0) = 0
         .          .     16:	v[0] = 0
         .          .     17:	// F(1) = 1
         .          .     18:	v[1] = 1
         .          .     19:
         .          .     20:	// F(i) = F(i-1) + F(i-2)
     260ms      260ms     21:	for i := 2; i <= n; i++ {
     2.05s      2.05s     22:		v[i] = v[i-1] + v[i-2]
         .          .     23:	}
         .          .     24:
         .          .     25:	// F(n) - return the n-th Fibonacci number
         .          .     26:	return v[n]
         .          .     27:}

A better comparison

A better way to compare the two methods, and the theory to practice, is this:

  1. Knowing that the exponentialFibonacci method is O(2^n), it would take approximately 2^25 = 33554432 instructions to calculate the 25th Fibonacci number.
  2. Linearly, calculating the 33554432th Fibonacci number should take roughly the same time as calculating the 25th number exponentially.

So following the methodology above we do this:

  1. Build the application using the exponentialFibonacci(25) call.
  2. Start the application.
  3. Start the Apache Benchmark for 1,000,000 requests.
  4. Start the CPU profile for 30s seconds.

We get this:

(pprof) top5
98.27s of 99.02s total (99.24%)
Dropped 64 nodes (cum <= 0.50s)
Showing top 5 nodes out of 30 (cum >= 1.30s)
      flat  flat%   sum%        cum   cum%
    60.78s 61.38% 61.38%     60.78s 61.38%  main.exponentialFibonacci
    24.54s 24.78% 86.16%     24.54s 24.78%  fmt.(*pp).doPrintf
    12.95s 13.08% 99.24%     12.95s 13.08%  syscall.Syscall
         0     0% 99.24%      1.30s  1.31%  bufio.(*Reader).ReadLine
         0     0% 99.24%      1.30s  1.31%  bufio.(*Reader).ReadSlice

Now for the second part:

  1. Build the application using the linearFibonacci(33554432) call.
  2. Start the application.
  3. Start the Apache Benchmark for 1,000,000 requests.
  4. Start the CPU profile for 30s seconds.

We get this:

(pprof) top5
49280ms of 49870ms total (98.82%)
Dropped 92 nodes (cum <= 249.35ms)
Showing top 5 nodes out of 29 (cum >= 470ms)
      flat  flat%   sum%        cum   cum%
   28650ms 57.45% 57.45%    44400ms 89.03%  main.linearFibonacci
   15660ms 31.40% 88.85%    15660ms 31.40%  runtime.memclr
    3910ms  7.84% 96.69%     3910ms  7.84%  runtime.usleep
     590ms  1.18% 97.87%      590ms  1.18%  runtime.duffcopy
     470ms  0.94% 98.82%      470ms  0.94%  runtime.mach_semaphore_timedwait

As you can see, the flat percentages, which is how much of the time was spent in the routine itself, is roughly the same. 61.38% vs 57.45%, it's about 4% difference between them.

Profiling memory

Using the same process, you can run the following command to profile memory:

go tool pprof -alloc_objects myserver http://localhost:8080/debug/pprof/heap

If you run a top command you should see something like this:

(pprof) top10
9741685 of 9927382 total (98.13%)
Dropped 7 nodes (cum <= 49636)
Showing top 10 nodes out of 33 (cum >= 99079)
      flat  flat%   sum%        cum   cum%
   3182489 32.06% 32.06%    3182489 32.06%  net/textproto.(*Reader).ReadMIMEHeader
   2050835 20.66% 52.72%    2050835 20.66%  context.WithCancel
   1068043 10.76% 63.47%    8447075 85.09%  net/http.(*conn).readRequest
    675175  6.80% 70.28%    5155947 51.94%  net/http.readRequest
    667729  6.73% 77.00%     667729  6.73%  net/url.parse
    655370  6.60% 83.60%    1414760 14.25%  main.handler
    618866  6.23% 89.84%     618866  6.23%  main.linearFibonacci
    589833  5.94% 95.78%     589833  5.94%  net/textproto.(*Reader).ReadLine
    134266  1.35% 97.13%     172250  1.74%  net/http.newBufioWriterSize
     99079     1% 98.13%      99079     1%  sync.(*Pool).pinSlow

Conclusion

Now that you've seen the basics on how to profile your Golang web apps, you can start diving into heavier stuff like this. Take some time and run a profile on your own Golang web apps.

Also, you should see the Gophercon talk I mentioned at the start of this post, it's quite good.


OOP in Golang vs C++

Before I started to learn Go, every online opinion I would read about the language complained about the lack of generics and how OOP was dumbed down  and so on.

It made me put off learning it for quite some time, more than I would like to admit. Coming from a C++ background, OOP, generics and meta-programming was my daily bread.

It wasn't until I had to actually learn Go that I saw what it offered me in terms of OOP and it was just enough. As such, I wanted to put a side-by-side comparison of typical C++ code that deals with classes, and it's corresponding implementation in Go that does more or less the same thing.

This is by no means an exhaustive list of examples, but I thought it might prove useful for someone trying to figure out Go.

To run all Go examples, copy them to a file and run go run filename.go .

To run all C++  examples, copy them to a file and run g++ -o filename filename.cpp -std=c++14 && ./filename .

Class declaration

In C++:

#include <iostream>
#include <memory>
#include <string>

class MyClass {
    private:
        std::string property1;

        void Method1(std::string param1, int param2);

    public:
        std::string property2;

        MyClass(std::string constructor_argument);
        int Method2(int param);
};

MyClass::MyClass(std::string constructor_argument) {
    this->property1 = constructor_argument;
}

void MyClass::Method1(std::string param1, int param2) {
    std::cout << param1 << std::endl << param2 << std::endl;
    std::cout << this->property2 << std::endl;
}

int MyClass::Method2(int param) {
    this->Method1(this->property1, param);

    return param + 1;
}

int main(int argc, char *argv[]) {
    auto obj = std::make_unique<MyClass>("property 1 value");

    obj->property2 = "property 2 value";

    std::cout << obj->Method2(4) << std::endl;

    return 0;
}

Go equivalent:

package main

import "fmt"

type MyClass struct {
	// properties that start with a lowercase character are private
	property1 string
	// properties that start with an uppercase character are public
	Property2 string

	/*
		Keep in mind that public and private in Golang actually
		means exported by package. Code from the same package
		can access a structure's private properties and methods.
	*/
}

func NewMyClass(constructor_argument string) *MyClass {
	return &MyClass{property1: constructor_argument}
}

func (mc *MyClass) method1(param1 string, param2 int) {
	fmt.Printf("%s\n%d\n", param1, param2)
	fmt.Printf("%s\n", mc.property1)
}

func (mc *MyClass) Method2(param int) int {
	mc.method1(mc.property1, param)

	return param + 1
}

func main() {
	obj := NewMyClass("property 1 value")

	obj.Property2 = "property 2 value"

	fmt.Printf("%d\n", obj.Method2(4))

	// No return needed
}

Inheritance (sort of)

In C++:

#include <iostream>
#include <memory>
#include <string>

class BaseClass {
    public:
        std::string property1;
        void method1();
};

void BaseClass::method1() {
    std::cout << this->property1 << std::endl;
}

class DerivedClass : public BaseClass {
    public:
        std::string property2;
        void method2();
};

void DerivedClass::method2() {
    std::cout << this->property2 << std::endl;
}

int main(int argc, char *argv[]) {
    auto obj = std::make_unique<DerivedClass>();
    obj->property1 = "property 1 value";
    obj->property2 = "property 2 value";

    obj->method1();
    obj->method2();

    return 0;
}

Go equivalent:

package main

import "fmt"

type BaseClass struct {
	Property1 string

	// no need for method declaration here
}

func (bc *BaseClass) Method1() {
	fmt.Printf("%s\n", bc.Property1)
}

type DerivedClass struct {
	BaseClass // this is actually composition

	Property2 string
}

func (dc *DerivedClass) Method2() {
	fmt.Printf("%s\n", dc.Property2)
}

func main() {
	obj := &DerivedClass{}
	obj.Property1 = "property 1 value"
	obj.Property2 = "property 2 value"

	obj.Method1()
	obj.Method2()

	// no need to return
}

Interfaces

In C++:

#include <iostream>
#include <memory>
#include <string>

class MyInterface {
    public:
        virtual void method() = 0;
};

class Class1 : public MyInterface {
    public:
        void method() override;
};

void Class1::method() {
    std::cout << "Class 1" << std::endl;
}

class Class2 : public MyInterface {
    public:
        void method() override;
};

void Class2::method() {
    std::cout << "Class 2" << std::endl;
}

std::shared_ptr<MyInterface> NewClass1() {
    return std::make_shared<Class1>();
}

std::shared_ptr<MyInterface> NewClass2() {
    return std::make_shared<Class2>();
}

int main(int argc, char *argv[]) {
    auto obj1 = NewClass1();
    auto obj2 = NewClass2();

    obj1->method();
    obj2->method();

    return 0;
}

Go equivalent:

package main

import "fmt"

type MyInterface interface {
	Method()
}

type Class1 struct {
}

func (c1 *Class1) Method() {
	fmt.Println("Class 1")
}

type Class2 struct {
}

func (c2 *Class2) Method() {
	fmt.Println("Class 2")
}

func NewClass1() MyInterface {
	return &Class1{}
}

func NewClass2() MyInterface {
	return &Class2{}
}

func main() {
	obj1 := NewClass1()
	obj2 := NewClass2()

	obj1.Method()
	obj2.Method()
}

Conclusion

There are basic equivalences between traditional OOP languages like C++ and the syntax and functionality that Golang provides.

In it's own simple way, Golang provides ways to implement encapsulation, inheritance and polymorphism. In my humble opinion, these mechanisms are enough for most object-oriented projects.


Off-the-Shelf or Custom Software: What's Best for Your Business?

Off-the-Shelf or Custom Software: What's Best for Your Business? [Infographic]

In the ever-evolving digital landscape and competitive business environment, companies are in constant pursuit of perfecting processes to help them deliver the best value and experience to clients and potential customers. Accordingly, businesses have unique and specific workflows that can be automated and streamlined with software, from productivity, collaboration, reporting, messaging, and other tools. This is where the question of whether to buy off-the-self software or customize your own arise.

Balancing your company’s short-term needs and long-term plans is fundamental to the success of your business. Often, it can be tricky and daunting. How, then, do you choose between buying off-the-shelf software solutions and outsourcing software development builders?

Many business owners and managers often face this dilemma. To help you decide, we’ve outlined the pros and cons of buying off-the-shelf software and building custom software solutions.

Off-the-Shelf or Custom Software: What's Best for Your Business?

Share this Image On Your Site

Some organizations are perfectly content with off-the-shelf software or canned software solutions to improve their workflow. There are software and tools in various categories from productivity, collaboration, messaging, office solutions, conferencing, marketing, sales, and many more. These are immediately available to individuals and businesses for a one-time fee or a monthly subscription fee. Some are even free, with limited features available.

On the other hand, some companies have very particular challenges that they need to address with custom-built software, so they either hire dedicated developers or outsource software developers to build one from the ground up. Costs for custom software development may vary from company to company.

Cost-Effectiveness

Off-the-shelf software is generally cheaper than custom-built software. Some offer it for free with limited features or you can get premium features by paying a one-time fee or a low monthly subscription fee.

For most startups and small businesses, the free software works, until such time that they need the full set of features. They can then choose to upgrade once they decide that the software fits their needs.

Custom software development may incur high upfront costs, especially if you choose to hire an in-house team of developers. Outsourcing software development is more cost-effective for bespoke software solutions.

Availability

Off-the-shelf software solutions are readily available. It’s as simple as signing up, placing your payment information, and you can immediately start using the service. On the other hand, custom software development may take months to develop, depending on your specific requirements.

Compatibility

Most off-the-shelf software can be integrated with other popular tools. However, there may be limitations. You may encounter a canned solution that perfectly addresses your challenges, but it’s not compatible with the current systems you have in place.

If you have a custom software, developers can ensure that it will work for your current infrastructure. Should there be a new software that your company needs to be incorporated into the workflow, you can ask your in-house or outsourced development team to work on it.

Functionality

Off-the-shelf software offers a wide variety of features and functionality to cater to the needs of a large market base. Sometimes, you’ll be surprised to find an additional feature helpful to your process. But often, there are more features than you need, which can make the product more complicated and hard to use.

This affects the performance of your team, making it difficult to get them onboard the new workflow and software. Your team members are the end-users of the software, and at the end of the day, it’s what’s easiest for them to use that matters.

On the other hand, a fully customized software guarantees to meet all your business needs, as it is tailored to match your specific requirements. Should there be an additional function that you would like to add in the future, you can ask your outsourced software developers to update your software.

Support

Customer support is usually provided for premium users of SaaS. However, customer support is limited to community support forums for free software users. If your growing business needs prompt attention to an issue, your options may be limited.

This is not the case for custom software. At IntelligentBee, we provide warranty for our code, and our software developers will work on bugs and issues on the spot, at no extra charge. Maintenance programs are also available to ensure a continuous focus on your custom software features and functionality.

Scalability

When choosing between off-the-shelf software solutions and fully customized software development, ask yourself this – can this software grow with your business? Scalability is an important consideration.

SaaS providers often roll out new features and updates without increasing their subscription fees, but these new features are not tailored to what your business specifically requires as your grow bigger. You can submit a feature request, but it may be ignored or rejected if it doesn’t fit the needs of a larger consumer base.

With a fully customized software, you can scale up the features whenever you need to or however you want to. You can start with your minimum business requirements, and slowly add features as your business grows.

Intellectual Property

Your company owns the intellectual property rights of the custom software built for your business. This can be considered an investment for your company. Factor in the added value that your custom software offers your business and your end-customers.

Competitive Advantage

With off-the-shelf software solutions, you’re basically using the same software that other businesses in the same niche use. It would be difficult for your organization to outperform your competitors if you employ the same workflow and tools.

Obviously, when you own custom software, this provides your company competitive advantage over your competitors. You use and own a tool that none of your other competitors have, giving your business a leg up in your industry.

Think of the value that your custom software can potentially offer your end-customers. By designing a software solution that meets all your unique business needs, your team will be more efficient, you can gain insight into the customer journey, and be able to improve your product and service, optimizing the customer experience.

Every business, small or large, has unique needs. Carefully considering the relevant factors when choosing between off-the-shelf and custom software is paramount to an organization’s efficiency, productivity, success, and eventual growth.

Ultimately, every organization’s goal is to improve performance and deliver the highest value to your customers. Custom software development for web and mobile applications can help you gain a competitive edge in today’s demanding market.

At IntelligentBee, we have a team of experienced software developers who can take your business to the next level with customized business solutions that can meet your every need.


How Custom Software Can Improve Your Business Performance

Each business has its own software needs for their processes and activities to run smooth. However, not all solutions are provided in software available in the market, also known as off-the-shelf software.

The crucial thing with off-the-shelf software is that it can only address your concerns up to a certain level. It doesn’t go to the nitty gritty of things where most problems emerge. Also, there are off-the-shelf software features that could go to waste as you may not need them. This means that you could end up paying for features that won’t be of use to your business.

It’s always better to have a software that can adjust to you instead of you changing your ways for the software. Hence, custom software.

Anything customized has a higher percentage of efficiency and effectivity, as it is designed to cater to your business’ problems and activities. Plus, using a software made for the mass market won’t get you far and different from your competitors. If you want a competitive advantage, custom software is the way to go.

Improve Your Business with Custom Software

Building your custom software can propel your business to success by bringing these benefits:

1. Automating Workflows for Improved Efficiency

Operational costs are reduced by simplifying complicated workflows. Instead of multiple people working in one line of work, one custom software alone can do all the tasks just by itself. It can cut the time spent on transferring from one person to another including the training and briefing of a specific task.

By having the extra time on tasks previously done manually, the workforce can focus on highly important tasks. This doesn’t only bring better productivity to your employees but also ensures quality in your business requirements.

Also, automated workflows let you identify the pain points in the process. You can better gauge if a certain task will be carried out on time. At the end of it all, you can save in cost and invest in productivity while making sure it’s done at the optimum.

2. Accelerating Reporting to Reduce Time Costs

Preparing reports is one of the most time-consuming tasks. Even when a person can master the processes over time, a custom software can still do it faster, as it can deliver your data in a snap.

Because a single software does the process from top to bottom, the information becomes centralized, making it easier for analysis. You don’t have to deal with different information coming from different tools and fit them all like puzzle pieces. In other words, you’ll have a database rich with information.

Furthermore, reports sometimes need data from its previous versions. Customized software can do the searching from your history and show results of relevant information.

3. Streamlining Communication

In any business, getting transferred from one person to another for a single piece of information doesn’t sound efficient. You must take into consideration the availability and reachability of the person you’re looking for.

Custom software can provide platforms for team members or departments to communicate fast and efficiently. By simply providing a communication channel where exchange of information can be done quickly, your business performance as well as your team’s output can improve by a mile.

4. Strengthening Security

Placing all your data in one system can pose a threat to security. Custom software addresses this by putting extra importance in keeping your data safe from hackers that would want to steal your information.

In fact, off-the-shelf software is more vulnerable to hacking as it is available to the mass market. It’s easier for hackers to study off-the-shelf software and find its loopholes. With custom software, hackers are challenged due to the software’s exclusivity and intricacies. Hence, external threats are minimized.

5. Providing Custom-Made Solutions

Because a custom software is designed for specific needs, it provides appropriate solutions to address problems the way you want it. And since you have full control of your technology, you can make tweaks each time you encounter new challenges or see rooms for improvement.

So, there’s no need to wait for updates and patches from off-the-shelf software. With your own custom software, you can come up with real-time solutions.

As they say, customizing is now the name of the game in every industry. A well-tailored software can undoubtedly give you an edge over your competitors.

Of course, you cannot stop from the first version of your custom software. Formulate a schedule of your updates to enhance its functionality. By outsourcing software development firms or professionals, you can be guided and assisted well from building your custom software to doing checks and improvements.


How to stand out as a company through decision making process

IB2.0  - Decision making: stand out as a company

What I realized is that most of our people see and distinguish as decisions only those that have a big impact . These are usually seen as the important decisions. You know, a decision that comes from a superior and is communicated in some sort of official medium like a meeting or an email.

After it is communicated and only then it’s usually perceived as a decision, making it look like it’s a rather short process. Also, I noticed that after the decision is made, there are lots of times when everyone is somehow relieved. Like something just finished, as in “oh that’s good, finally we decided about this, let’s celebrate”.

I think there’s more about a decision that this.

We see two important steps in a decision making process. First is documenting and debating and second is implementing.

Step 1 — Debating and making the decision

The action here is the process of gathering the information needed so that the decision maker can actually make a good decision. As documented as possible.

Step 2 — Implementing the decision

That is the most overlooked part but sadly it’s not less important than the decision itself. It’s actually the work put in by the team to make things happen. I liked the expression read once : it’s putting the meat on the bones.

What we’ve learned

After focusing the attention on the decision making process itself ,  we were surprised to find out that things were not actually going the ideal way in IntelligentBee.

The way I see it there are 2 speeds you want to have at the steps above. Slow and Fast.

Fast - Slow

If it’s Fast-Slow , it means that the debate and decision making is happening fast, and the implementation is slow. This results in quick decisions that are not always the correct ones due to lack of time for research. We’re already starting with half-chances of success here. And it’s getting even worse. After making the let’s-pray-this-is-a-good-one decision then here comes the implementation phase that starts late and happens slow. That kills the momentum, people forget why we’re doing the things we’re doing. They don’t usually perceive it as a whole, ruining the chance of success even more. In short, we don’t want to be there.

Fast - Fast

If it’s Fast-Fast  it means  that the debating and making the decision happens quickly and implementation fast. It may look we’re in a slightly different position, but actually we’re not. It’s because there was not enough time to make a good decision: gather all data, see alternatives, buy-in. As a result, the implementation will eventually be slow because the outcome desired was not thought over and the work needed to get there is often not estimated correctly.

Where you want to be: Slow - Fast

If you ever fired a rifle you know that the ready-steady-aim process should be a slow one if you want to hit the bullseye. You don’t actually want to have a cowboy shooting when you’re making decisions in your company.

The debating and making the decision should be a through step. All the options are carefully studied and debated. All people affected by the outcome are involved and committed.

The implementation step should be a lightning fast one. There was a time to research, a time to debate, a time for talks and analyzing. Now there is time to act. After lots of conflict, there is perfect alignment. Everyone is committed to execute as fast and as good as possible the decision that is now made. There is no room for changing minds and certainly no place to bring out the arguments used above, in the debating phase.

All team act as one and everyone is aware that what’s making a company stand out is not the speed at which they make decisions, but the speed and quality they execute against every decision made.


Considerations When Hiring a Custom Software Development Company

5 Considerations When Hiring a Custom Software Development Company

Once you have decided that your business needs custom software to meet specific goals, the next plan of action is to hire dedicated developers who can build your stepping stone to growth.

A custom software is like a suit tailored for your business. It is built with special features for exceptional demands, which off-the-shelf software cannot provide you. Not only does it's customized, it also allows your team to perform at their best.

A caveat though: one can easily make wrong decisions when hiring or outsourcing software development professionals. You may find a pool of talents out there, but not everyone has the required skill set, experience, expertise, and promptness that you need to build your custom software.

Avoid burning money on bad hires. Take time to consider the following key points when hiring a custom software developer or firm.

Things to Consider When Hiring a Custom Software Developer

Project Timeline: Can They Deliver on Time?

At the end of the day, what you want is someone that can deliver your custom software with the best quality within a reasonable deadline. According to a study by PM Solutions, 37% of IT projects are at risk of failure each year. One reason is the inability to meet the delivery schedule.

The percentage of success should be one of the first things to look for in a custom software company or developer. Be sure to check the history and portfolio of your candidates for telltale signs of reliability and work ethic.

Make the most of your investment by ensuring that no additional costs are incurred due to failure to deliver on time. Settle only for the option that can keep risks at a minimum.

Your Business Needs: What Do You Want to Achieve?

Of course, arriving at the appropriate software solutions can only begin by determining your business problems. Identify the specific demands that you require, which a custom software can only solve.

Do you need a specific feature that will simplify your complicated workflows? Or do you want a platform that will centralize your team communication? Knowing what needs to be done can guide you on what to look for when hunting for the perfect hire.  

Budget: How Much Are You Willing to Pay?

All projects entail costs, and it’s a significant factor that can influence your hiring decision. Determine your budget through a cost estimation, which includes hardware and software costs, travel and training costs, as well as effort costs, among others.

Developing a custom software can be more cost-efficient than buying off-the-shelf software. In fact, a study by Forrester reported that IT shops spend about 27% of their software budget on custom software development compared to 35% spent on packaged application software. This means 8% lower budget.

However, be wary of unreasonably low budgets, as it could lead you to bad hires and compromise the quality of custom software that you want to develop.

Technological Expertise: How Technologically Proficient Are They?

When hiring a custom software developer or firm, consider the kind of technology and methodology required to build the tool you need. Some developers are proficient in Java technology while others are experts in .Net applications. It's important to pick one that can execute the right methodology to minimize costs while maximizing gains.

Remember, custom software development is not limited to one programming or scripting language. There is a plethora of variations out there, with different tools and frameworks to be used for specific circumstances. So, look at technological expertise, versatility, and capability to mix various tools to get the job done – whether it’s cutting edge software or legacy applications.

Technical Support: Can They Provide Tech Support After the Development Stage?

Your custom software will have issues and bugs over time, and that’s inevitable. A good custom software developer is someone who can provide technical support even after the development stage. Find those who communicate in a friendly, professional manner and can assist you with any issues. This will give you more time to focus on the core processes of your business.

On the other hand, an unfriendly and unsupportive custom developer firm could potentially sabotage your business, and lead to project failure.

Last Thoughts

Consider these key points to make a more accurate choice when choosing a custom software developer or firm that will execute the project you need. Hiring software development teams like IntelligentBee due to its friendly team of developers, proven fast delivery, and a wide range of software and technological expertise is an advantage to your business.

Give yourself time and do your research in advance to find the perfect custom software developer or firm that will achieve your desired result. 


customer care

8 Tips On How To Handle Angry Customers Without Losing Your Cool

Hi there, reader! :) This article presents some tips on how you can handle those customers who are a little more difficult to handle, based on my own experience.

Whether you're planning to chat or write emails, below are my top suggestions on how to create the best interaction with your customers, even if they are not so nice.

1. Don't take it personally

One of the most difficult tasks in maintaining your calm when dealing with angry customers is to not take their frustration personally. You shouldn't do that as they know that you did not cause the problem. Listening to what they have to say without interrupting and then finding a way to help them out will cool down the situation.

Also, as a professional customer service specialist, you shouldn't argue back. If they become abusive, let them know that you understand their situation and you are there to help.

2. Empathize

This would be the most important rule which I often associate with the law of attraction - if you act with patience and empathize, you'll receive gratitude even though the problem is not solved.

Some customers keep coming back. Asking questions as "How are you today?" or "How is it going?" will help in creating that special bond between you and your customer which will lead you to know them as people and not just simple buyers.

3. Be patient

Patience is a virtue especially when dealing with angry customers. Some of them may get angrier as the live chat continues, but if you stay in control and redirect the conversation to a happy resolution, things may move in the right direction. Each customer is different and being patient with each of them will improve the quality of conversation.

4. Inform the customer when he needs to wait while you're investigating

Often times and usually when I chat with customers, the investigation requires time and they have to wait. Phrases such as "I appreciate your patience while I'm investigating your case." or " Just a moment please while I am looking for more details" will make it clear to the customer when he needs to wait and also avoid the repeated "Are you there?". Asking questions regarding their problem will also help you take back control and extract the information you need to get to the bottom of their situation.

Also, if I'm caught in multiple investigations, I usually tell them that I'm helping other customers as well and my reply can be delayed. However, always assure them that they will receive feedback from your side.

5. Knowing when and how to apologize

I know that it is difficult being truly sincere when you are trying to keep your cool, but an apology at the right moment can calm down the customer. Depending on situation, there are a few different ways you can apologize to your customers such as:

"I'm sorry you are so frustrated. I understand your situation and I will do my best to help you"

"I am really sorry that I misunderstood your problem."

"I apologize for the inconvenience this may cause you and your team."

6. Solve the problem

If you applied the rules from above, your customer should be finally relaxed. This means that you can work with him in order to find a resolution that satisfies both sides.

7. End the conversation with a happy note

It is very important to end a chat session on a high note. Instead of giving an "abrupt goodbye", you can ask your customer if there's anything else you can do for them and reminding that you are right there for them if they require any assistance. Also, wishing them a wonderful day and a sunny weather should give the "goodbye" a "talk to you soon" meaning, which is great.

8. Relax, take it easy

Let the anger go away with your customer. Always remember that a focused mind requires a relaxed state, so don't forget to take a break when you cannot concentrate. Take a walk to the kitchen, drink a cup of tea while enjoying the view, play a game with your colleague or listen to Mika’s song (Relax, take it easy) as it will help you to relieve the stress. Also, it is scientifically proven that taking a deep breath multiple times will help you concentrate even more.

I believe that these tips aren't only for customer support. You can practice them every day of your life, as communication is the key to good relations between the people. Knowing how to communicate will allow building connections and a great success.

...and at the end, no matter what, don't forget to smile! :)


IB2.0  - Manager vs Leader

A world-known debate. What makes a Leader and what makes a Manager? What’s the difference, seen through the eyes of the IntelligentBee culture.

Of course, there are tons of content on the internet about this subject, all with reasonable and well documented arguments.

What’s better?

I think that’s an example of the wrong question. Actually, it’s incomplete. I’ve seen this question (especially in the title/header) on countless posts and I think it’s not relevant.

Better would be: What’s better in your current stage of the company?

There are many ways to differentiate a Manager and a Leader. For example, if we’re talking about strategy vs tactics, someone said once that the difference between Manager and Leader is: if you’re in a forest, a good Manager will tell you how to get from point A to point B with minimum of resources and in the shortest time possible. A Leader will tell you if you’re in the right forest or not.

Of course, that’s a way of looking at things. I’ll try to give my 2 cents on this from a different standpoint : IntelligentBee culture.

At IntelligentBee, we’re in a stage of growth with our company where the balance between management and leadership that we need from our middle and top managers is more inclined towards leadership. When I say “more” I mean a lot.

Encourage bottom-up communication in your team VS communicate only with your direct

The main point is: we want all teams to be unified and work as a whole. This came from the simple statement we agreed on a while ago: we come to the office because we like what we do and we like the people we work with. That is the main trigger that created our awesome culture based on the 4Hs: Humble, Honest, Hungry, Happy that kept our team highly motivated and engaged.

We think the team communication has a crucial role. We all love to feel like part of a tight team that has a purpose tied to its existence. When everything that happens or is about to happen in that team is first discussed inside the team rather than outside, team will start seeing the manager more as a leader. Regardless of its nature: plans, successes, fails, personal schedule that prevents planned things from happening, mistakes done, lessons learned, you name it.

Plan with your team VS assign work to your team

This comes right off the first one above. When everyone in your team participates in planning and decision making process, everyone will feel more empowered — therefore motivated to push for the team. We don’t particularly like situations when managers talk only with their superior/direct, and make a decision only based on that. Afterwards it’s just a simple “telling” to the team what is to be executed. No one likes to only execute. This of course is a good point to consider also for the superior/direct. A simple question to the manager: What’s your team thinking about this? should immediately trigger at least a question if not the whole pre-decision process involving the team. If the team participates in the pre-decision phase they will start looking at their manager more like a leader.

Serve your team VS your team serves you

A manager should be part of the team. One of her duties is that the team has all necessary resources to do their job. Although it might sound like a cliche, it has never been more true. But that’s not enough. Helping your team deliver by involving hands-on when something is at risk of being not finished on time, acknowledging everyone’s involvement, creativity and effort — only a few of the things that will make the team look at their manager more like a leader.

These are just a few traits of the managers we want to have in IB, traits that will make them more like leaders to their teams. It’s a well-known fact that employees stay or leave the company because of their managers. This is crucial for the culture we have and want to preserve in our company.


Key to negative feedback: be constructive

Feedback is one of the words I use and hear a lot. It looks like everybody knows what it means, how important it is. Then, why is it so hard sometimes to give it and accept it? I don't know if you like by the book definitions, but I'll give you one:

 In an organizational context, feedback is the information sent to an entity (individual or a group) about its prior behavior so that the entity may adjust its current and future behavior to achieve the desired result.

(a definition from www.businessdictionary.com)

There are two types of feedback, positive and negative, both valuable and effective.  We have a constant need of knowing where we stand, how do we do our job and how can we maximize our potential.

While it is more convenient to give and receive positive feedback, we might avoid giving the negative one. But this is one of the most important tools to develop employees.

No matter if we talk about positive or negative feedback, it has to be constructive so that it brings an improvement to the receiver's behavior. Feedback should be:

  • specific
  • realistic
  • well intended
  • timely
  • shouldn't be judgmental

When it is expressed as I mentioned above, it will motivate and should lead to performance improvement.

If what's communicated sounds as criticism, it's too general and doesn't refer to a specific situation or example, it will demotivate us. It is much easier or at hand to 'attack' with words than it is to deliver the message in a diplomatic, non-aggressive manner.

What's the context where a employee can give or receive feedback? We encourage our colleagues to have One on One Meetings with their managers.

1:1s are a chance to give and receive regular feedback, to develop a stronger connection between the two and a way to have in control the problems which may occur in a working environment. We see them as meetings that should be scheduled by the employee, but a manager can do it do. It should happen once a month (still working on improving their frequency in our company). All kind of subjects can be on the agenda: performance, career development, other professional or personal issues.

Of course feedback doesn't happen only in a formal meeting, it is a daily thing even though we might not be aware of it.

I'll leave now you with an intriguing affirmation I read. Feedback's role is to make employees do the job better, it is not to make them feel better. Do you agree with this statement?


Automatically Restart Your Node.js Application

Many of us write code on Node.js, click [CTRL+S] to save the file but forget to restart the application.

If we don't forget to restart the application we will go in console and hit [CTRL+C] to stop the application and then restart it by pressing the [UP] arrow and [Enter].

Nodemon

You can automate this repetitive task and make your development process easier by using `nodemon`.

`nodemon` will watch the files and if any files were changed, the `nodemon` will automatically restart your node application.

First, you need to install `nodemon`:

npm install nodemon -g

Now, you should swap the `node` command for the `nodemon` command:

$ nodemon app.js
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node app.js`
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
Read about: How to set up a Node.Js development environment

If you need to manually restart your application, instead of stopping and restart `nodemon`, you can simply type `rs` on your console.

[nodemon] starting `node app.js`
rs
[nodemon] starting `node app.js`

Happy Coding!