Get startedGet started for free

Best practices for cloud application development (2)

1. Best practices for cloud application development (2)

SPEAKER: Caching content can improve application performance and lower network latency, cache application data that is frequently accessed, or that is computationally intensive to calculate each time. When a user requests data, the application component should check the cache first. If data exists in the cache, the application should return the previously cached data. If the data is not in the cache or has expired, the application should retrieve the data from backend data sources and recompute results. The application should also update the cache with the new value. Memorystore is Google Cloud's fully managed, in-memory service for caching using Redis or Memcached. In addition to caching application data in a cache, you can also use a Content Delivery Network, or CDN, to cache web content. Cloud CDN uses Google's global Edge network to serve content closer to users, which accelerates your websites and applications. Static content can be served from cloud storage buckets, services and functions running on Cloud Run, or Compute Engine virtual machine instance groups. Implement API gateways to make backend functionality available to consumer applications. Apigee is a platform for developing and managing APIs. By fronting services with a proxy layer, Apigee acts as a facade for your backend service APIs and provides security, rate limiting, quota, analytics, and more. If you have legacy applications that cannot be refactor and moved to the cloud, consider implementing APIs. Each consumer can then invoke these modern APIs to retrieve information from the backend instead of implementing functionality to communicate by using outdated protocols and disparate interfaces. You can minimize your effort for a user administration by delegating identity management. You can delegate user authentication to Google or other external providers like Facebook or GitHub. Identity Platform provides a drop-in, customizable authentication service for user sign-up and sign-in. In addition to external providers, Identity Platform supports other authentication methods, like email/password, SAML, OpenID Connect, and multi-factor authentication. Firebase authentication with Identity Platform provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. With federated identity management, you do not need to implement, secure, and scale a proprietary solution for authenticating users. Treat your logs as event streams. Logs constitute a continuous stream of events that keep occurring as long as the application is running. Do not manage log files in your application. Instead, write to an event stream, like standard out, and let the underlying infrastructure collate all events for later analysis and storage. With this approach, you can set up logs-based metrics and trace requests across different services in your application. Logging by writing to standard out works especially well for serverless compute options, like Cloud Run. With Google Cloud Observability, you can set up error reporting, logging and logs-based metrics, and monitor applications running in a multi-cloud environment. Implement a strong DevOps model with automation by using CI/CD pipelines. Automation helps you increase release velocity and reliability. With a robust CI/CD pipeline, you can test and roll out changes incrementally instead of making large releases with multiple changes. This approach enables you to lower the risk of regressions, debug issues quickly, and roll back to the last stable build if necessary. CI is Continuous Integration. And CD is Continuous Delivery or Continuous Deployment. In a continuous integration system, developers can make code changes made in their own feature branch into a shared branch in a code repository. When an update is made, the application build is triggered. And automated testing confirms that the new update hasn't broken existing unit in integration tests. In a continuous delivery system, the code change validated during continuous integration is automatically stored in a code repository. This validated code base is ready to be deployed to production by the operations team. Continuous deployment takes this one step further by automatically deploying the validated changes to production. Only a failed test prevents the change from being deployed to production. Continuous deployment means that changes and fixes are available in production faster, and automated deployments reduce the work of your operations team. There is no manual process for validating the release to production, though. So your application, tests, and CI/CD pipeline must be well-designed to prevent issues in production. When you create a CI/CD pipeline in Google Cloud, Cloud Build can detect repository commits, trigger a build, and run unit tests. The build system produces deployment artifacts that can be stored in Artifact Registry. Cloud Deploy can automatically trigger the deployment of builds to test environments or directly to production. You can automatically execute integration, security, and performance tests and then deploy successful builds to your production environment. When rolling out builds to the production environment, consider performing blue/green deployments or canary testing. These types of deployment strategies help ensure that unexpected issues with the new build do not affect most users. Consider using the strangler pattern when re-architecting or migrating large applications. In the early phases of migration, you might replace smaller components of the legacy application with newer application components or services. You can incrementally replace more features of the original application with new services. A strangler facade can receive requests and direct them to the old application or new services. As your implementation evolves, the legacy application is strangled by the new services and no longer required. This approach minimizes risk by allowing you to learn from each service implementation without affecting business-critical operations. The term "strangler" comes from strangler vines. The vines seed and start growing on the upper branches of fig trees, gradually enveloping the tree. As you create your own applications in the cloud, always consider these best practices. By following best practices of cloud development, you will set up your applications for success.

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.