Definitive Guide to Revolgy Serverless on Google Cloud Platform Index 03 So What Exactly Do We Mean by “Serverless” in This Context?

Definitive Guide to Revolgy Serverless on Google Cloud Platform Index 03 So What Exactly Do We Mean by “Serverless” in This Context?

Definitive guide to revolgy serverless on Google Cloud Platform Index 03 So what exactly do we mean by “serverless” in this context? 04 Advantages of Serverless technologies Servers are not what they used to be anymore You pay only for what you actually use Deploy in seconds and improve your CI/CD Save your resources and keep your Ops team happy Disadvantages of Serverless and how to avoid them Change your mindset, unlock new opportunities 05 Grouping of Serverless technologies Function-as-a-service (FaaS) Platform-as-a-service Managed Containers 12 How to build serverless applications Think as a Cloud developer not a VM developer Stateless application for faster scaling Smaller apps for faster initialisation times Security and Robustness 14 Microservices and Serverless Is it really more expensive? Why should you try serverless 16 Importance of a good architecture in Serverless If you think good architecture is expensive try out bad architecture first Reliable, robust and easy to change is better than fast, temporary solutions 18 Summary and key takeaways revolgy guide to serverless 02 When talking about the Cloud, the word Serverless sounds a bit odd, doesn’t it? Technically speaking the Cloud is a remote server in itself. So what exactly do In this case, serverless means you can deploy any we mean by serverless function, application or container without needing to in this context? worry about the server on which they run. And it doesn’t end with the server only. You are going to get the entire platform - from a deployment tool through the logs and error handling to load balancing and end-points management. As a developer, I have the most experience working with Google Cloud Platform, this is why I will often be referring to Google products here. However, the basic principles of Serverless are the same for all Cloud providers. revolgy guide to serverless 03 Advantages of Serverless technologies Servers are not The greatest advantage of serverless is that even what they used to be anymore when you call your cloud “a server” it is not a server anymore. It’s only a certain Service. You do not have to be bothered whether your application is deployed on a real server, virtual machine, Linux, Unix or Windows. You only have to worry about how to implement your application and how to deploy it on the desired cloud platform. You pay only for what you Another great difference is the payment model for actually use serverless. In the most serverless types you will only pay for an actual utilisation of the services. That means, if you do not use the service, the cost will scale down to 0. In contrast, in the non-serverless Cloud, it is obligatory to pay for the time your VM is on it, or pay for your container’s consumption of memory and CPU even if it’s doing nothing at the moment. Deploy in seconds Another significant advantage of serverless is the and improve your CI/CD speed of deployment and creation of new instances of your app. We are talking here about deployment in seconds as opposed to minutes. It helps to improve your CI/CD pipelines and makes a tremendous differ- ence when dealing with traffic peaks as well as short- ens the outage time to a minimum when releasing new versions. All this will result in the overall better quality of service for your customers. Save your resources and keep your Ops team happy You don’t need a deployment team Last but not least, the advantage I would like to mention here is the amount of overall resources needed to run your serverless services. Most public Cloud platforms provide you with tools for easy deployment. This means that you don’t need a deployment team at all. Any devel- oper will be able to handle it with some basic build tool. Operational team won’t have any trouble with the infra- structure either because its maintenance is completely taken care of. This way you will be able to handle even big applications (50 services and more) in a small team of 2-5 developers. The developers will become 80% pro- grammers and 20% DevOps engineers. In the long run it revolgy guide to serverless 04 will make your application development and operation much more cost effective. Thanks to serverless technol- ogies, in the future, we will see more micro companies of 2 to 10 people worth billions. As a developer and team leader I see a great benefit in the fact that most of the serverless technologies and tools available to developers are running on open source. This means that, vast majority of us are already familiar with them as we worked with them before. Another thing is that more and more programming lan- guages are supported by serverless runtimes. For you it means it will be easier to find the right developer for your service and shortens the time to market of your application Take some time to choose the right environment. Select- ing an environment that is too restrictive and sandboxed means that you will have to obey it’s limitations on librar- ies and resources. For example using threads or direct access to sockets on App Engine. Fortunately, these limitations are slowly becoming a thing of the past with the development of new serverless technologies. Disadvantages of Serverless Based on the serverless technologies you choose, you and how to avoid them are more or less bound to your cloud provider. Cloud functions are the most bounded with its runt- ime/SDK and the way you will deploy them. Google Cloud Run or AWS Fargate will on the other hand give you the most flexibility to choose your runt- ime, framework and third party libraries. Change your mindset, unlock new opportunities Optimize the expenses If you want to go serverless, you have to change your mindset. You have to start actually developing applica- tions suitable for serverless, not only copy your existing apps to a serverless box. This means that you have to learn how to optimise your application for better perfor- mance and lower resource consumption. You will also have to figure out how to optimise the total cost of the development of your application. Remember that you pay not only for computing power and memory but also for reading and writing ops to the database, in and out traffic of your service etc. DDoS in a serverless environment typically takes a different form than usual as it’s very hard to beat revolgy guide to serverless 05 the cloud provider in terms of computing resources. So even during a DDoS attack your application runs smoothly most of the time but consumes huge amount of computational resources until you drain your budget and the cloud provider cuts it down. You can even DDoS yourself in the same way by some programming error or incorrect settings that will skyrocket the usage of your resources in a short period of time and lead to an unpleasant surprise when you see your cloud invoice. That’s why it is so important to know how to properly set the budget and start monitoring it daily as soon as it’s visible. Spending limits (quotas) and error reporting in this case are a MUST to prevent disasters. Grouping of Serverless technologies Cloud Functions They are the most commonly used serverless technology – Function-as-a-service (FaaS) on different Cloud platforms. Cloud functions are also widely supported by the major cloud providers such as Google Cloud, Amazon Web Services (LAMBDA), Micro- soft Azure, IBM and Oracle. With the SDK of your cloud provider you are able to write simple functions that are triggered by HTTP request, change of the DB entity or triggered by file change. Best use cases Cloud functions are most commonly used to obtain and process specific data for client applications simply and fast - for example minor and straightforward functions for specific account data, temperature measuring or backing up of user data (as a cron task). Framework around these functions is built in a way that supports scripting languages common for front-end developers (e.g. Node.js, Python, PHP….). This allows front-end developers to write server-side code easily. Cloud functions are the easiest and fastest (in terms of learning time) gateways to server-side world. Advantages • Easy to learn • Support many front-end languages • Easy to deploy • Easy to maintain (separate function) • Cloud functions can save your day if you are in need of a simple functionality and don’t have server-side de- veloper at hand. Anyone with basic programming skills can simply write this function and help you deploy your product sooner. revolgy guide to serverless 06 Disadvantages In case of microservices you are also able to write the entire backend by simply triggering nothing else but these functions (Personally, I don’t recommend it, however, in specific scenarios it can work as a proof of concept). As mentioned earlier, based on the SDK you use, you are risking a vendor lock-in. It may become difficult to move your application from one provider to another. Lots of functions written in different languages in one project could also lead to a “maintenance hell” in the future. As cloud functions are meant to be only a supportive technology, there are some technical limitations to them such as quotas for CPU and memory usage, max time that one function can run and several others that can limit the functionality of the service as it grows. (E.g. in Google Cloud max.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    19 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us