<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Luiz Ferreira</title>
    <description>The latest articles on DEV Community by Luiz Ferreira (@luizsfer).</description>
    <link>https://dev.to/luizsfer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F404351%2F80b1b07b-8c46-4ba8-a6c1-cf86591677c6.jpeg</url>
      <title>DEV Community: Luiz Ferreira</title>
      <link>https://dev.to/luizsfer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luizsfer"/>
    <language>en</language>
    <item>
      <title>The 12 Factors: When was the last time you reviewed these concepts?</title>
      <dc:creator>Luiz Ferreira</dc:creator>
      <pubDate>Tue, 11 Apr 2023 09:02:06 +0000</pubDate>
      <link>https://dev.to/luizsfer/the-12-factors-when-was-the-last-time-you-reviewed-these-concepts-4iff</link>
      <guid>https://dev.to/luizsfer/the-12-factors-when-was-the-last-time-you-reviewed-these-concepts-4iff</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Cx1XEUj7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cw1stfcw9jj9z7z9nrty.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Cx1XEUj7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cw1stfcw9jj9z7z9nrty.png" alt="Cover with developer discovering the universe through cloud computing" width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hello everyone! Welcome to my blog!&lt;/p&gt;

&lt;p&gt;Today, I'm going to share with you a revolutionary methodology that has been changing the way we develop and manage modern applications: the &lt;a href="https://12factor.net/"&gt;12 factors&lt;/a&gt;. Inspired by the books of the legendary Martin Fowler, these principles bring numerous advantages for developers and DevOps/SRE professionals. Let's explore together the importance, gains, and advantages of these factors, and how they make our day-to-day work easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Importance of the 12 Factors
&lt;/h2&gt;

&lt;p&gt;The 12 factors aim to improve the quality, scalability, and maintainability of applications. With the increasing complexity and growing demand for cloud-based solutions, it is essential to adopt practices and principles that guarantee the stability and performance of our applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gains and Advantages
&lt;/h2&gt;

&lt;p&gt;By following the 12 factors methodology, you will be ensuring several benefits, such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Development Agility:&lt;/strong&gt; Projects based on the 12 factors have faster and more efficient development cycles, allowing new features and fixes to be delivered more frequently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Applications developed with this methodology are naturally scalable, making it easier to meet demands for growth and traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resilience and availability:&lt;/strong&gt; Applications built based on the 12 factors are more resilient to failures and guarantee greater availability for users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portability:&lt;/strong&gt; The adoption of the 12 factors allows greater flexibility and cost reduction, as applications are easily portable between different environments and cloud providers.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How does this make my work easier?
&lt;/h2&gt;

&lt;p&gt;The 12 factors simplify the development and management of applications, bringing benefits to both developers and DevOps/SRE professionals:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Better collaboration between teams:&lt;/strong&gt; The 12 factors methodology promotes more effective communication and cooperation between development and operations teams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient monitoring and problem-solving:&lt;/strong&gt; The 12 factors facilitate monitoring and problem-solving, helping teams identify and quickly correct any issues that may arise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduction of errors:&lt;/strong&gt; The adoption of the 12 factors helps reduce errors and inconsistencies between development, testing, and production environments, leading to more reliable and stable software.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Companies that use the 12 Factors
&lt;/h2&gt;

&lt;p&gt;The 12 factors methodology is widely adopted by companies and organizations of all sizes, including technology giants such as Netflix, Spotify, Airbnb, and Salesforce. These companies recognize the value of the 12 factors in building modern, scalable, and resilient applications, and apply these principles in their own development and operations practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  List of articles on the 12 Factors
&lt;/h2&gt;

&lt;p&gt;Check out our detailed articles on each of the 12 factors:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-1-codebase/"&gt;Codebase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-2-dependencies/"&gt;Dependencies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-3-config/"&gt;Configurations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-4-backing-services/"&gt;Backing services&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-5-build-release-run/"&gt;Build, Release, Run&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-6-processes/"&gt;Processes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-7-port-binding/"&gt;Port binding&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-8-concurrency/"&gt;Concurrency&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-9-disposability/"&gt;Disposability&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-10-dev-prod-parity/"&gt;Dev/Prod parity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-11-logs/"&gt;Logs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://luizferreira.dev/12-factors-12-admin-processes/"&gt;Admin Process&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Stay tuned!
&lt;/h2&gt;

&lt;p&gt;Now that you understand the power and importance of the 12 factors, be sure to follow &lt;strong&gt;&lt;a href="https://luizferreira.dev/"&gt;luizferreira.dev&lt;/a&gt;&lt;/strong&gt; to stay on top of best practices and trends in the world of modern application development and operations.&lt;/p&gt;

&lt;p&gt;Also, follow me on social networks and join our community of enthusiasts and professionals! We are always sharing tips, tricks and valuable knowledge to help you succeed in your career and projects.&lt;/p&gt;

&lt;p&gt;And remember, knowledge is power! The more you know about the 12 factors, the better prepared you will be to face the challenges and opportunities of the tech world. So, keep exploring, learning and growing with us!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>programming</category>
      <category>cloud</category>
      <category>productivity</category>
    </item>
    <item>
      <title>12 Factors: Revisiting the 7th Factor - Port Binding</title>
      <dc:creator>Luiz Ferreira</dc:creator>
      <pubDate>Tue, 04 Apr 2023 15:50:19 +0000</pubDate>
      <link>https://dev.to/luizsfer/12-factors-revisiting-the-7th-factor-port-binding-l8f</link>
      <guid>https://dev.to/luizsfer/12-factors-revisiting-the-7th-factor-port-binding-l8f</guid>
      <description>&lt;p&gt;Welcome to my blog!&lt;/p&gt;

&lt;p&gt;Hello everyone! In this article, we will continue our series on the &lt;a href="https://12factor.net/"&gt;12 factors&lt;/a&gt; for the development of modern applications, inspired by the books of the legendary Martin Fowler. If you missed our previous articles, feel free to check out the &lt;a href="https://luizferreira.dev/categories/12-factors/"&gt;other factors&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today, we will cover the seventh factor:&lt;/p&gt;

&lt;h2&gt;
  
  
  Port Binding
&lt;/h2&gt;

&lt;p&gt;The seventh factor states that the application should communicate with the outside world through a bound port. This means that the application must be able to accept incoming connections and communicate with other services and components through this port.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is Port Binding Important?
&lt;/h3&gt;

&lt;p&gt;Binding a port ensures that the application is easy to deploy, configure, and integrate with other services and components. In addition, port binding allows the application to run in different environments and platforms without the need to change the source code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Principles for Port Binding
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Be platform-agnostic:&lt;/strong&gt; Your application should be able to communicate with other services and components, regardless of the platform or environment they are running on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use standard protocols:&lt;/strong&gt; Use standard protocols, such as HTTP, to ensure compatibility and facilitate integration with other services and components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexible configuration:&lt;/strong&gt; Allow the bound port to be easily configured, whether through environment variables, configuration files, or command-line arguments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Treat the port as a scarce resource:&lt;/strong&gt; The application must be able to handle the possibility that the desired port is already in use and be able to find an alternative port if necessary.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Examples and Tools
&lt;/h3&gt;

&lt;p&gt;Here are some examples of tools and technologies that can help implement port binding in your application:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Express.js:&lt;/strong&gt; Express.js is a minimalist framework for Node.js that makes it easy to create web applications and APIs. It allows for simple and efficient port binding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flask:&lt;/strong&gt; Flask is a micro-framework for Python that allows for the rapid and easy creation of web applications and APIs. It also supports port binding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Apache:&lt;/strong&gt; Apache is a widely-used web server that allows for port binding and flexible configuration of web applications and APIs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Nginx:&lt;/strong&gt; Nginx is a high-performance web server and reverse proxy that supports port binding and is easy to configure.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Stay Tuned
&lt;/h2&gt;

&lt;p&gt;In the next article, we will cover the eighth factor of the 12 factors. Stay tuned and don't miss the next part of this informative series!&lt;/p&gt;

&lt;p&gt;If you enjoyed this article, please share it with your colleagues and friends on social media. Also, don't forget to leave a comment below with your questions,&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>12 Factors: Revisiting the 6th Factor - Processes</title>
      <dc:creator>Luiz Ferreira</dc:creator>
      <pubDate>Mon, 03 Apr 2023 05:39:38 +0000</pubDate>
      <link>https://dev.to/luizsfer/12-factors-revisiting-the-6th-factor-processes-2dlc</link>
      <guid>https://dev.to/luizsfer/12-factors-revisiting-the-6th-factor-processes-2dlc</guid>
      <description>&lt;p&gt;Hello everyone! Welcome again!&lt;/p&gt;

&lt;p&gt;In this article, we will continue our series on the &lt;a href="https://12factor.net/"&gt;12 factors&lt;/a&gt; for the development of modern applications, inspired by the books of the legendary Martin Fowler. If you missed our previous articles, feel free to check out the &lt;a href="https://luizferreira.dev/categories/12-factors/"&gt;other factors&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today, we will cover the sixth factor:&lt;/p&gt;

&lt;h2&gt;
  
  
  Processes
&lt;/h2&gt;

&lt;p&gt;The sixth factor states that the application should be executed as one or more stateless processes, with data being stored in backing services. This is important to ensure scalability, portability, and ease of deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stateless Processes
&lt;/h3&gt;

&lt;p&gt;Stateless processes are those that do not store information about the current state of the application, which means they do not maintain data in memory or local storage. Instead, any required state information is stored in backing services, such as databases, caches, or messaging systems.&lt;/p&gt;

&lt;p&gt;The main advantage of using stateless processes is that they can be easily scaled horizontally, adding more instances of the process as needed to handle the load. Additionally, as each process is independent and does not store state information, they can be restarted or replaced without affecting the overall operation of the application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Principles for Processes
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid storing data in memory or local storage:&lt;/strong&gt; As mentioned earlier, processes should be stateless and should not store state information. This ensures that processes are independent and can be easily scaled.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Store data in backing services:&lt;/strong&gt; State data should be stored in appropriate backing services, such as databases, messaging systems, or caches. This allows processes to be restarted or replaced without losing important information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scale horizontally:&lt;/strong&gt; Stateless processes allow the application to be scaled horizontally, adding more instances as needed to handle the load. This helps ensure that the application can meet traffic demands and provide consistent performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Monitor processes:&lt;/strong&gt; Monitor your application's processes to ensure they are functioning correctly and identify potential issues or bottlenecks. This can include monitoring resource usage, response time, and error rates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ensure portability:&lt;/strong&gt; As processes are independent and stateless, they should be portable and able to run in different environments and platforms. This makes deploying and maintaining the application easier.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Examples and Tools
&lt;/h3&gt;

&lt;p&gt;Here are some examples of tools and technologies that can help implement stateless processes in your application:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Docker:&lt;/strong&gt; Docker is a containerization platform that allows packaging applications and their dependencies into containers, which can be run in different environments and platforms. This makes creating stateless and portable processes easier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Kubernetes:&lt;/strong&gt; Kubernetes is a container orchestration system that manages the deployment, scaling, and operation of container-based applications. It facilitates the creation of stateless processes, ensuring the necessary instances are always running and managing horizontal scalability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Redis:&lt;/strong&gt; Redis is an in-memory data store, used as a database, cache, and message broker. It is useful for storing state information in backing services, ensuring processes remain stateless.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;RabbitMQ:&lt;/strong&gt; RabbitMQ is an open-source message broker that implements the Advanced Message Queuing Protocol (AMQP). It can be used to store temporary state information, such as messages and events, helping to keep processes stateless.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Amazon S3:&lt;/strong&gt; Amazon S3 is a simple storage service that allows storing and retrieving any amount of data, at any time, from anywhere on the web. It can be used to store state data in backing services, ensuring processes are independent and stateless.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary, the sixth factor of the 12 factors is "Processes". It highlights the importance of running applications as one or more stateless processes, with data being stored in backing services. This ensures scalability, portability, and ease of application deployment. The tools and technologies mentioned above can help you achieve this goal.&lt;/p&gt;

&lt;p&gt;In the next article, we will cover the seventh factor of the 12 factors. Stay tuned!&lt;/p&gt;

&lt;p&gt;Don't forget to share this article with your colleagues and leave a comment below if you have any questions or suggestions.&lt;/p&gt;

&lt;p&gt;See you next time!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>12 Factors: Revisiting the 5th Factor - Build, Deploy, and Run</title>
      <dc:creator>Luiz Ferreira</dc:creator>
      <pubDate>Thu, 30 Mar 2023 14:31:18 +0000</pubDate>
      <link>https://dev.to/luizsfer/12-factors-revisiting-the-5th-factor-build-deploy-and-run-4n0j</link>
      <guid>https://dev.to/luizsfer/12-factors-revisiting-the-5th-factor-build-deploy-and-run-4n0j</guid>
      <description>&lt;p&gt;Hello everyone! In this article, we will continue our series on the &lt;a href="https://12factor.net/"&gt;12 factors&lt;/a&gt; for the development of modern applications, inspired by the legendary Martin Fowler's books. If you missed our previous articles, feel free to check out the &lt;a href="https://luizferreira.dev/categories/12-factors/"&gt;other factors&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today, we will cover the fifth factor:&lt;/p&gt;

&lt;h2&gt;
  
  
  Build, Deploy, and Run
&lt;/h2&gt;

&lt;p&gt;The fifth factor emphasizes the importance of separating the stages of building, deploying, and running an application. This separation ensures that the application can be consistently built, deployed, and run in different environments, improving maintainability, portability, and scalability.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Principles for Build, Deploy, and Run
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Build:&lt;/strong&gt; The build stage involves compiling the source code, processing assets, and creating an executable or package that can be deployed to various environments. It is essential to have a reproducible build process that generates consistent artifacts across different environments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deploy:&lt;/strong&gt; The deployment stage involves taking the build artifacts and deploying them to a specific environment, such as staging or production. It should be automated, consistent, and have a clear separation between environments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Run:&lt;/strong&gt; The run stage is when the application is actually executed in the target environment. It should be easy to start, stop, and restart the application, and it should be able to run consistently across different environments.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Tools and Examples
&lt;/h3&gt;

&lt;p&gt;Here are some tools and technologies that can help you implement the Build, Deploy, and Run factor in your application:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Git:&lt;/strong&gt; Git is a widely-used version control system that can help you manage your source code and assets, making it easier to build and deploy your application consistently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Docker:&lt;/strong&gt; Docker is a containerization platform that allows you to package your applications and their dependencies into containers, which can run consistently across different environments and platforms. This makes it easier to deploy and run your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Jenkins:&lt;/strong&gt; Jenkins is an open-source automation server that can help you automate the build, deployment, and run stages of your application. This ensures that your application can be consistently built, deployed, and run in different environments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Kubernetes:&lt;/strong&gt; Kubernetes is a container orchestration system that can manage the deployment, scaling, and operation of container-based applications. It can help you run your application consistently across different environments and scale it as needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ansible:&lt;/strong&gt; Ansible is an open-source automation tool that can help you automate the deployment and configuration of your application across different environments. This ensures that your application can be consistently deployed and run in various environments.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary, the fifth factor of the 12 factors is "Build, Deploy, and Run." It highlights the importance of separating the stages of building, deploying, and running an application, ensuring that the application can be consistently built, deployed, and run in different environments. The tools and technologies mentioned above can help you achieve this goal.&lt;/p&gt;

&lt;p&gt;In the next article, we will cover the sixth factor of the 12 factors. Stay tuned!&lt;/p&gt;

&lt;p&gt;Don't forget to share this article with your colleagues and leave a comment below if you have any questions or suggestions.&lt;/p&gt;

&lt;p&gt;See you next time!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>devops</category>
      <category>cloud</category>
      <category>productivity</category>
    </item>
    <item>
      <title>12 Factors: Revisiting the 4th Factor - Backing Services</title>
      <dc:creator>Luiz Ferreira</dc:creator>
      <pubDate>Wed, 29 Mar 2023 07:52:07 +0000</pubDate>
      <link>https://dev.to/luizsfer/12-factors-revisiting-the-4th-factor-backing-services-2je9</link>
      <guid>https://dev.to/luizsfer/12-factors-revisiting-the-4th-factor-backing-services-2je9</guid>
      <description>&lt;p&gt;We continue with our series of study and review of the &lt;a href="https://12factor.net/"&gt;12 factors&lt;/a&gt; for the development of modern applications, inspired by the books of the legendary Martin Fowler.&lt;/p&gt;

&lt;p&gt;In previous articles, we discussed the first three factors: &lt;a href="https://luizferreira.dev/codebase/"&gt;Codebase&lt;/a&gt;, &lt;a href="https://luizferreira.dev/dependencies/"&gt;Dependency Management&lt;/a&gt;, and &lt;a href="https://luizferreira.dev/configuration/"&gt;Configurations&lt;/a&gt;. Today, we will address the fourth factor:&lt;/p&gt;

&lt;h2&gt;
  
  
  Backing Services
&lt;/h2&gt;

&lt;p&gt;Backing services are external resources used by your application, such as databases, messaging systems, caching services, and other APIs. These services are usually managed by third parties or other teams and are essential for the functioning of your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat Backing Services as Attached Resources
&lt;/h2&gt;

&lt;p&gt;One of the main practices of the fourth factor is to treat backing services as attached resources, that is, consume them as if they were an integral part of your application. This implies a consistent approach to accessing and using these services, regardless of their type or provider.&lt;/p&gt;

&lt;p&gt;To follow this practice, you should:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Abstract access to services:&lt;/strong&gt; Create abstraction layers that hide the specific details of each backing service. This makes it easy to switch providers or migrate to other services without the need for major modifications to the code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use configurations to specify backing services:&lt;/strong&gt; As mentioned in the &lt;a href="https://luizferreira.dev/configuration/"&gt;third factor&lt;/a&gt;, configurations should be separated from the code. Thus, it is essential to store connection information to backing services, such as URLs and credentials, in environment variables or other configuration mechanisms.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Decouple backing services:&lt;/strong&gt; Ensure that your application can function even if some backing services are not available. Decoupling the application from backing services increases resilience and allows you to continue operating even when facing problems with any of these services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Monitor and track communication with backing services:&lt;/strong&gt; Track and monitor the use and performance of backing services to detect possible bottlenecks, failures, and performance improvements.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Examples and Tools
&lt;/h2&gt;

&lt;p&gt;Here are some examples of backing services and tools that you can use in your project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Databases:&lt;/strong&gt; PostgreSQL, MySQL, MongoDB, and Redis are examples of backing services in the form of databases. They can be used to store and manage data for your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Messaging services:&lt;/strong&gt; RabbitMQ, Kafka, and Amazon SQS are messaging services that enable asynchronous communication between components of your application, aiding in scalability and decoupling processes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Storage services:&lt;/strong&gt; Amazon S3, Google Cloud Storage, and Azure Blob Storage are examples of storage services that can be used to store files and other resources for your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;External APIs:&lt;/strong&gt; Some applications may rely on external APIs to obtain information, such as geolocation, weather forecasts, or financial data. These APIs are also considered backing services and should be treated according to the practices mentioned earlier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Monitoring tools:&lt;/strong&gt; Tools like New Relic, Datadog, and Prometheus can be used to monitor and track communication with backing services, helping to identify issues and improve application performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Caching services:&lt;/strong&gt; Redis, Memcached, and Amazon ElastiCache are examples of caching services that can be used to enhance the performance and speed of your application's responses by storing temporary or frequently used data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Search services:&lt;/strong&gt; Elasticsearch, Solr, and Amazon CloudSearch are search services that can be used to index and search data in your application, providing a faster and more efficient search experience for users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Authentication and authorization services:&lt;/strong&gt; Auth0, Okta, and Firebase Authentication are examples of services that help manage authentication and authorization of users in your application, ensuring the security and privacy of data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Logging platforms:&lt;/strong&gt; Graylog, Logstash, and Amazon CloudWatch are examples of logging services that can be used to collect, analyze, and store logs from your application, aiding in the identification of issues and performance analysis.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Continuous Integration and Continuous Delivery (CI/CD):&lt;/strong&gt; Jenkins, GitLab CI/CD, and GitHub Actions are examples of services that can be used to automate the process of integration, testing, and deployment of your application, improving code quality and streamlining the development cycle.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When using backing services, it is important to follow best practices mentioned, such as treating resources as attached resources and ensuring portability between execution environments. Also, when choosing a backing service, consider factors such as scalability, ease of use, cost, support, and the developer community behind the service.&lt;/p&gt;

&lt;p&gt;Remember that choosing the right backing service for your project can have a significant impact on the success of your application. Therefore, it is crucial to research and compare different options before making a decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stay tuned
&lt;/h2&gt;

&lt;p&gt;In this article, we covered the sixth factor of the 12 factors of software development, which is the use of backing services. Using backing services allows you to focus on developing the core functionalities of your application, delegating secondary tasks to specialized and reliable services.&lt;/p&gt;

&lt;p&gt;We will continue our journey through the 12 factors in the upcoming articles, exploring even more essential concepts and practices for the development of modern applications. Stay tuned and follow our blog to learn more!&lt;/p&gt;

&lt;p&gt;Until next time!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>devops</category>
      <category>cloud</category>
      <category>productivity</category>
    </item>
    <item>
      <title>12 Factors: Revisiting the 3rd Factor - Configuration</title>
      <dc:creator>Luiz Ferreira</dc:creator>
      <pubDate>Mon, 20 Mar 2023 14:55:38 +0000</pubDate>
      <link>https://dev.to/luizsfer/12-factors-revisiting-the-3rd-factor-configuration-767</link>
      <guid>https://dev.to/luizsfer/12-factors-revisiting-the-3rd-factor-configuration-767</guid>
      <description>&lt;p&gt;Welcome to my blog!&lt;/p&gt;

&lt;p&gt;We continue our journey of studying and reviewing the &lt;a href="https://12factor.net"&gt;12 factors&lt;/a&gt; for modern application development, inspired by the books of the legendary Martin Fowler.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't forget to visit &lt;a href="https://luizferreira.dev"&gt;my website&lt;/a&gt;&lt;/strong&gt; and follow the new posts there. &lt;strong&gt;Contact me through social networks&lt;/strong&gt; so we can talk more about these cool topics.&lt;/p&gt;

&lt;p&gt;In previous articles, we discussed the first and second factors, &lt;a href="https://luizferreira.dev/codebase/"&gt;Codebase&lt;/a&gt; and &lt;a href="https://luizferreira.dev/dependencies/"&gt;Dependency Management&lt;/a&gt;. Today, we will address the third factor:&lt;/p&gt;

&lt;h2&gt;
  
  
  Configurations
&lt;/h2&gt;

&lt;p&gt;The configurations of an application are all the options and parameters that can vary between different environments (development, testing, production, etc.). These parameters include, for example, database connection information, API keys, and access credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate Configurations from Code and Use Environment Variables
&lt;/h2&gt;

&lt;p&gt;One of the main practices of the third factor is to separate configurations from code. This means that configurations should not be stored in the same repository as the application's source code, nor should they be hardcoded directly into the code.&lt;/p&gt;

&lt;p&gt;A common and efficient way to store and manage configurations is to use environment variables. Environment variables are a means of storing information outside of the source code, making it easier to maintain and ensuring greater security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits
&lt;/h2&gt;

&lt;p&gt;By following the practice of separating configurations from code and using environment variables, you can achieve the following benefits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: Prevents the leakage of sensitive information, such as API keys and access credentials.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt;: Allows easy adaptation of the application to different environments, without the need to change the source code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versioning&lt;/strong&gt;: Avoids the need to version configurations, since they are not part of the application's source code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Facilitates collaboration&lt;/strong&gt;: Facilitates collaboration between developers and teams, as each can have their own local configurations without affecting the environment of other team members.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simplified deployment&lt;/strong&gt;: Facilitates the deployment and configuration of new environments, as configurations can be easily adjusted without the need to change the source code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audit and traceability&lt;/strong&gt;: Facilitates tracking and auditing configuration changes, as they are managed independently of the code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Allows for quick adaptation of configurations when the application needs to be scaled, without the need to modify the source code.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Examples and Tools
&lt;/h2&gt;

&lt;p&gt;In addition to environment variables, there are several tools and libraries available to help with configuration management in different languages and frameworks, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;dotenv&lt;/strong&gt; (Node.js): Loads environment variables from a .env file in your project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example of using &lt;code&gt;dotenv&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Load the dotenv library&lt;/span&gt;
&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Access environment variable&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;apiKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_KEY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;python-dotenv&lt;/strong&gt; (Python): Allows the use of &lt;code&gt;.env&lt;/code&gt; files to store and manage environment variables in Python projects, facilitating the separation between configuration and code, and keeping sensitive configurations out of the version control system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example of using &lt;code&gt;python-dotenv&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# app.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;flask&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;dotenv&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;load_dotenv&lt;/span&gt;

&lt;span class="n"&gt;load_dotenv&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'PORT'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'/'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;hello_world&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;'Hello, World!'&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;'__main__'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'0.0.0.0'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Viper&lt;/strong&gt; (Golang): Manages application configurations in Go using a variety of sources, such as JSON, TOML, YAML, HCL, among others.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example of using &lt;code&gt;Viper&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
    &lt;span class="s"&gt;"github.com/spf13/viper"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;viper&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SetConfigName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"config"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;viper&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddConfigPath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;viper&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ReadInConfig&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nb"&gt;panic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Errorf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Error reading configuration: %s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;apiKey&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;viper&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"api_key"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"API Key:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;config-rs&lt;/strong&gt; (Rust): Configuration library for Rust that supports JSON, TOML, YAML, HJSON, and INI files, among others.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example of using &lt;code&gt;config-rs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;config&lt;/span&gt;&lt;span class="p"&gt;::{&lt;/span&gt;&lt;span class="n"&gt;Config&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;use&lt;/span&gt; &lt;span class="nn"&gt;serde&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Deserialize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;#[derive(Debug,&lt;/span&gt; &lt;span class="nd"&gt;Deserialize)]&lt;/span&gt;
&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;Settings&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;Config&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;default&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="n"&gt;settings&lt;/span&gt;
        &lt;span class="nf"&gt;.merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;File&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;with_name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"config"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="nf"&gt;.merge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nn"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;with_prefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"APP"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Settings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="nf"&gt;.try_into&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="nf"&gt;.unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"API Key: {:?}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="py"&gt;.api_key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we covered the third factor of the 12 factors of software development, which is configuration management. Following the practices presented here can help ensure the security, flexibility, and scalability of your application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stay tuned for the next articles&lt;/strong&gt;, where we will continue our journey through the 12 factors, delving even deeper into the concepts and practices that make them up.&lt;/p&gt;

&lt;p&gt;Until next time!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>devops</category>
      <category>productivity</category>
      <category>cloud</category>
    </item>
    <item>
      <title>12 Factors: Revisiting the 2nd Factor - Dependencies</title>
      <dc:creator>Luiz Ferreira</dc:creator>
      <pubDate>Fri, 10 Mar 2023 09:16:44 +0000</pubDate>
      <link>https://dev.to/luizsfer/12-factors-revisiting-the-2nd-factor-dependencies-k26</link>
      <guid>https://dev.to/luizsfer/12-factors-revisiting-the-2nd-factor-dependencies-k26</guid>
      <description>&lt;p&gt;Welcome to my &lt;code&gt;blog&lt;/code&gt;!&lt;/p&gt;

&lt;p&gt;I'm starting this project as a way to revisit some important concepts, study a bit, and share some of the knowledge I've accumulated on my journey so far!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't forget to visit &lt;a href="https://luizferreira.dev"&gt;my website&lt;/a&gt;&lt;/strong&gt; and follow the new posts there. &lt;strong&gt;Contact me through social networks&lt;/strong&gt; so we can talk more about these cool topics.&lt;/p&gt;

&lt;p&gt;In this first phase of study, I'd like to revisit the concepts used in the study of the &lt;a href="https://12factor.net/"&gt;12 factors for modern application development&lt;/a&gt;, inspired by the books of the legendary Martin Fowler.&lt;/p&gt;

&lt;p&gt;In our &lt;a href="https://luizferreira.dev/posts/001-12factorsrevisitingthe1stfactor/"&gt;last article&lt;/a&gt;, we talked about the first factor of the 12 factors of software development, Codebase. Today, we're going to talk about the second factor:&lt;/p&gt;

&lt;h2&gt;
  
  
  Dependency Management
&lt;/h2&gt;

&lt;p&gt;Dependency Management is an essential practice to ensure that your code is compatible and scalable. By using package management systems and the practice of isolating dependencies from the environment, you ensure that your application runs safely and reliably in different environments. This allows you to focus on creating new features without worrying about compatibility issues between application dependencies.&lt;/p&gt;

&lt;p&gt;Use Package Management Systems&lt;br&gt;
An important practice for managing dependencies is to use package management systems, such as NPM for Node.js or Maven for Java. These systems allow dependencies to be installed automatically, through a configuration file that specifies the application dependencies and their versions.&lt;/p&gt;

&lt;p&gt;In the case of Python, a widely used package management system is Pip. Pip is an easy-to-use tool that allows for quick and practical installation of packages and dependencies. In addition, Pip offers various features, such as the creation of virtual environments and the installation of packages from files.&lt;/p&gt;

&lt;p&gt;In the case of Go, the default package management system is Go Modules. It was introduced in version 1.11 of Go and is responsible for managing source code packages and dependencies. Go Modules offers various features, such as version control and compatibility checking of dependencies.&lt;/p&gt;

&lt;p&gt;In Rust, the default package management system is Cargo. Cargo allows for automated package installation and dependency management. In addition, Cargo offers features such as project creation, code compilation, and management of installed packages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Isolating Dependencies from the Environment
&lt;/h2&gt;

&lt;p&gt;Another important practice is the isolation of dependencies, which involves installing application dependencies in an environment that is isolated from the local machine. This is done using tools like Python's Virtualenv, Ruby's RVM, or asdf, which is a tool for managing language and package versions.&lt;/p&gt;

&lt;p&gt;asdf allows you to install and manage multiple language versions, such as Python, Ruby, Node.js, and Erlang, as well as packages related to these languages. With this, it is possible to have different versions of the same language or package installed in the same environment without interfering with each other.&lt;/p&gt;

&lt;p&gt;In addition, asdf also allows for the creation of specific virtual environments for different infrastructure tools such as Terraform, Terragrunt, Helm, among others. These virtual environments allow you to isolate specific dependencies for each tool and configure them separately, avoiding conflicts and ensuring the stability of your environment.&lt;/p&gt;

&lt;p&gt;For example, when using Terraform, you can create an asdf virtual environment specifically for Terraform and install only the necessary dependencies for your project's execution. This ensures that you do not have conflicts between the dependencies of Terraform and the dependencies of other projects running in the same environment.&lt;/p&gt;

&lt;p&gt;In addition, asdf is an easy-to-install and use tool, with support for various operating systems and an active community of developers, ensuring a large number of plugins available for different languages and tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stay Tuned
&lt;/h2&gt;

&lt;p&gt;Did you like our article? We hope so! Stay tuned for upcoming posts, where we'll talk about the other factors of the 12 factors of software development. And don't forget to follow us on social media to stay up-to-date with more programming tips and information.&lt;/p&gt;

&lt;p&gt;Until next time!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>devops</category>
      <category>productivity</category>
      <category>cloud</category>
    </item>
    <item>
      <title>12 Factors: Revisiting the 1st Factor</title>
      <dc:creator>Luiz Ferreira</dc:creator>
      <pubDate>Tue, 10 May 2022 10:33:04 +0000</pubDate>
      <link>https://dev.to/luizsfer/12-factors-revisiting-the-1st-factor-4oml</link>
      <guid>https://dev.to/luizsfer/12-factors-revisiting-the-1st-factor-4oml</guid>
      <description>&lt;p&gt;Welcome to my &lt;code&gt;blog&lt;/code&gt;! &lt;/p&gt;

&lt;p&gt;I'm starting this project as a way to revisit some important concepts, study a little and share some of the knowledge I've accumulated with my trajectory so far! &lt;/p&gt;

&lt;p&gt;In this first phase of studies, I would like to revisit the concepts employed in the studies about the &lt;a href="https://12factor.net/pt_br/"&gt;12 factors for modern application development&lt;/a&gt;, inspired by the books of the legendary Martin Fowler.&lt;/p&gt;

&lt;p&gt;This study was coordinated by developers of &lt;a href="//www.heroku.com"&gt;Heroku&lt;/a&gt;, a platform focused on delivering SaaS (Software as a Service) type applications.&lt;/p&gt;

&lt;p&gt;So let's get to know the first factor:&lt;/p&gt;

&lt;h2&gt;
  
  
  Codebase
&lt;/h2&gt;

&lt;p&gt;Every application should have an active version control system, some options are &lt;a href=""&gt;Git&lt;/a&gt;, &lt;a href=""&gt;Mercurial&lt;/a&gt; or &lt;a href=""&gt;Subversion&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A copy of this database is known as a &lt;code&gt;code repository&lt;/code&gt;, &lt;code&gt;repository&lt;/code&gt; or just the nice &lt;code&gt;repo&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;This is where we will store the code for our application, and this codebase always has a 1:1 relationship with the application, i.e., each application has its own codebase.&lt;/p&gt;

&lt;p&gt;This codebase can be shared with another application but as a part of its own codebase. When this situation occurs we have a distributed application and not an application. A distributed application is a composition of several highly linked applications.&lt;/p&gt;

&lt;p&gt;For a distributed application to be suitable for the 12-factor model it would be necessary to break this application into libraries and thus create the correct dependency between the application and the appropriate packages.&lt;/p&gt;

&lt;p&gt;However, this does not mean that we cannot have multiple environments running the same code, in fact, this is one of the advantages of the 12 factors. We can create our own environments for development, testing, staging, and production.&lt;/p&gt;

&lt;p&gt;Each environment can run a version of this repository, and each environment has its own reason, for the developer an environment for making changes, an environment for testing and checking with production-like data, and the production environment, which is the ideal version for the client, free of bugs and fully functional.&lt;/p&gt;

&lt;p&gt;We call the distribution of the repository to the environments &lt;code&gt;deployment&lt;/code&gt; or just &lt;code&gt;deployment&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This image shows these environments well:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bYGnl6xv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://12factor.net/images/codebase-deploys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bYGnl6xv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://12factor.net/images/codebase-deploys.png" alt="codebase-deploys" width="390" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Summarizing the image, we can have the same application running different versions, each with a reason for existing.&lt;/p&gt;

&lt;p&gt;When it comes to versioning tools, Git is widely used, becoming almost a standard in most companies. Not only that but Git was developed by Linus Torvalds, the same creator of the Linux kernel. 😁&lt;/p&gt;

&lt;p&gt;When searching in Google trends we can see its popularity:&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/luizsfer/embed/abqNXdW?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In a future post, we can talk more about this fantastic tool. But until then I recommend reading this &lt;a href="https://git-scm.com/about"&gt;material&lt;/a&gt; on the Git website.&lt;/p&gt;

&lt;p&gt;Until next time!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
