Preparing for cloud-native

But what is cloud-native? What makes an application cloud-native? We say an application runs in the cloud when it's running outside our premises. More than that, it denotes when an application is supposedly running and spread across different locations and is resilient to failures.

A cloud-native application or microservice is designed from scratch to run in the cloud and take advantage of that computing model. It is able to scale and operate even if parts of its infrastructure fail. Being cloud-native is about how we deploy our microservice, not where.

And, we're already doing that! Since we first deployed using Docker, we have already started and restarted our microservice, and rebuilt new images and replicated without the worry of where, but instead, how.

Thinking generically, there are a few points to take into account when designing our microservice, or anything that will be cloud-native, for that matter:

  • Understand what data your microservice will handle, and what kind of structures and relations will there be. Does a relational database such as MySQL or PostgreSQL suffice? Do you need a more loose database server that can handle documents with different information structures, such as MongoDB or RethinkDB?
    These questions must be answered to narrow the options. There are plenty of other types of databases. After narrowing your choices, you should pick the one that gives you more resilience and that can be replicated the same way as your microservice, to handle some degree of failure.
  • Find out what other dependencies you might need. If you have choices, go for the ones that are not dependent on a specific operative system. Below the cloud servers, there are different operative systems and you don't want to be forced to choose any type.
  • Avoid going non-standard. More specifically, try to take the most out of current standard protocols. Because you can deploy to geographically distant hosts, connectivity and policy rules may introduce restrictions to traffic, so keep with standards such as HTTP in order to communicate between microservices.
  • Design your microservices to be able to scale horizontally. It's not uncommon for microservices to not scale linearly just by adding replicas, but try to design them to be able to distribute loads more evenly. One easy path is to have a layer of proxies on top.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset