<?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: guigoncalves</title>
    <description>The latest articles on DEV Community by guigoncalves (@guigoncalves).</description>
    <link>https://dev.to/guigoncalves</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%2F1006835%2Ffdbea4c0-2844-4fdb-ac56-94406016c6bd.jpeg</url>
      <title>DEV Community: guigoncalves</title>
      <link>https://dev.to/guigoncalves</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/guigoncalves"/>
    <language>en</language>
    <item>
      <title>How to chose an AWS database</title>
      <dc:creator>guigoncalves</dc:creator>
      <pubDate>Sat, 21 Jan 2023 16:38:32 +0000</pubDate>
      <link>https://dev.to/guigoncalves/how-to-chose-the-aws-database-3dfn</link>
      <guid>https://dev.to/guigoncalves/how-to-chose-the-aws-database-3dfn</guid>
      <description>&lt;p&gt;In order to ensure optimal performance, scalability and cost-effectiveness, selecting the appropriate database type is crucial for any application. This text aims to explore the various database options provided by Amazon Web Services (AWS) and provide guidance on when each should be used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S1_zfJG2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frdf90lmh3looxznbgup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S1_zfJG2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/frdf90lmh3looxznbgup.png" alt="AWS Databases" width="880" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction to the options
&lt;/h1&gt;

&lt;h2&gt;
  
  
  RDS
&lt;/h2&gt;

&lt;p&gt;Relational Database Service (RDS). RDS is a fully managed service that makes it easy to set up, operate, and scale a relational database in the cloud. It supports popular database engines such as MySQL, PostgreSQL, and Oracle. RDS is a great choice for applications that need to store structured data and support complex queries and transactions.&lt;/p&gt;

&lt;h2&gt;
  
  
  DocumentDB
&lt;/h2&gt;

&lt;p&gt;DocumentDB, also known as AWS MongoDB, is a fully managed, fast, and highly available document database that makes it easy to store, manage, and query semi-structured data. DocumentDB is a great choice for applications that need to store and query semi-structured data, such as JSON documents. It is also a good choice for applications that need to scale horizontally, as it supports automatic sharding and partitioning.&lt;/p&gt;

&lt;h2&gt;
  
  
  DynamoDB
&lt;/h2&gt;

&lt;p&gt;DynamoDB is a fully managed, highly scalable, and fast NoSQL database service that supports both document and key-value data models. DynamoDB is a great choice for applications that need to store and retrieve large amounts of data with low latency. It supports automatic sharding and partitioning, which makes it easy to scale horizontally. Additionally, it supports secondary indexes, which allows you to query the data in different ways.&lt;/p&gt;

&lt;h2&gt;
  
  
  Amazon Elasticsearch Service
&lt;/h2&gt;

&lt;p&gt;Amazon Elasticsearch Service, which is a fully managed service that makes it easy to deploy, operate, and scale Elasticsearch clusters. It is a great choice for applications that need full-text search and analytics capabilities. Amazon Redshift, which is a fully managed data warehouse service that makes it easy to analyze large amounts of data using SQL and your existing business intelligence tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object Storage
&lt;/h2&gt;

&lt;p&gt;An example is Amazon Simple Storage Service (S3) is an object storage service, which allows you to store and retrieve any amount of data from anywhere on the web. S3 is a great choice when you need to store and retrieve large amounts of unstructured data, such as images, videos, audio, and text files.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to chose one or another
&lt;/h1&gt;

&lt;p&gt;you should consider factors such as the &lt;strong&gt;type&lt;/strong&gt; of data you need to store, the &lt;strong&gt;size&lt;/strong&gt; of your data, and the type of &lt;strong&gt;queries&lt;/strong&gt; you will be running. &lt;br&gt;
Relational databases such as &lt;strong&gt;RDS&lt;/strong&gt; are a great choice for applications that need to store structured data and support complex queries and transactions. NoSQL databases such as &lt;strong&gt;DocumentDB&lt;/strong&gt; and &lt;strong&gt;DynamoDB&lt;/strong&gt; are a great choice for applications that need to store and query semi-structured data or handle large amounts of data with low latency. &lt;br&gt;
Additionally, &lt;strong&gt;Amazon Elasticsearch Service&lt;/strong&gt; and &lt;strong&gt;Amazon Redshift&lt;/strong&gt; are great options for applications that need full-text search and analytics capabilities and &lt;strong&gt;S3&lt;/strong&gt; is perfect in case you want to store objects, such as videos, files or images.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>aws</category>
      <category>database</category>
      <category>cloud</category>
    </item>
    <item>
      <title>GraphQL basics and how it differs from REST</title>
      <dc:creator>guigoncalves</dc:creator>
      <pubDate>Sat, 14 Jan 2023 19:26:54 +0000</pubDate>
      <link>https://dev.to/guigoncalves/graphql-basics-and-how-it-differs-from-rest-27j7</link>
      <guid>https://dev.to/guigoncalves/graphql-basics-and-how-it-differs-from-rest-27j7</guid>
      <description>&lt;p&gt;GraphQL is a query language for your API that was developed by Facebook in 2012. It allows the client to define the structure of the data it needs, and the server will return only the requested data. In this way, it differs from REST (Representational State Transfer) which is an architectural style for building web services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwt1hoo6ghi7g1szx3x1w.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwt1hoo6ghi7g1szx3x1w.jpeg" alt="Rest and GraphQL" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages
&lt;/h2&gt;

&lt;p&gt;One of the main advantages of GraphQL is its flexibility. With REST, the client must make multiple requests to different endpoints to retrieve all the necessary data, which can lead to over-fetching or under-fetching of data. With GraphQL, the client can specify exactly what data it needs in a single request, and the server will return only that data. This allows for more efficient data retrieval and reduces the amount of data transfer over the network.&lt;/p&gt;

&lt;p&gt;Another advantage of GraphQL is its ability to handle complex and nested data. With REST, retrieving nested data requires multiple requests to different endpoints, which can be time-consuming and difficult to manage. With GraphQL, the client can specify exactly what nested data it needs in a single request, and the server will return that data in a single response.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real Time Subscription
&lt;/h2&gt;

&lt;p&gt;GraphQL subscriptions allow for real-time updates by enabling the client to subscribe to specific events or changes and receive updates over a WebSocket connection as the data changes. This feature is supported by most of the GraphQL implementations, and can be implemented using a GraphQL client library such as Apollo Client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disadvantages
&lt;/h2&gt;

&lt;p&gt;However, GraphQL does have some disadvantages as well. One of the main disadvantages is that it can be more difficult to cache the data in a GraphQL API compared to a REST API. This is because the structure of the data returned by a GraphQL API can vary depending on the client's request, whereas the structure of the data returned by a REST API is fixed. Additionally, GraphQL does not have as wide of support as REST, and may not be as well suited for certain types of applications.&lt;/p&gt;

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

&lt;p&gt;In conclusion, GraphQL is a powerful tool for building APIs that is particularly well suited for applications that require flexible, efficient data retrieval and real-time updates. However, it does have some disadvantages and may not be the best choice for every application. It is important to weigh the pros and cons of both GraphQL and REST before deciding which is the best option for your specific use case.&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>Versioning GraphQL and Rest API's</title>
      <dc:creator>guigoncalves</dc:creator>
      <pubDate>Thu, 12 Jan 2023 13:32:27 +0000</pubDate>
      <link>https://dev.to/guigoncalves/the-most-important-graphql-questions-p7b</link>
      <guid>https://dev.to/guigoncalves/the-most-important-graphql-questions-p7b</guid>
      <description>&lt;p&gt;When building an API, it's important to consider how you will handle versioning. The ability to evolve your API over time while maintaining backwards compatibility is crucial for ensuring a smooth experience for your users. In this article, we'll go over some best practices for versioning a GraphQL API and a REST API, and how to implement them with code snippets.&lt;/p&gt;

&lt;p&gt;Handling versioning with version on header:&lt;br&gt;
One common approach to versioning API is to use a field or header to specify the version. This allows clients to specify which version of the API they want to use, and the server can respond accordingly. For example, a client could include a &lt;code&gt;version&lt;/code&gt; field in their query, and the server would use that to determine which schema/resource to use.&lt;/p&gt;

&lt;p&gt;GraphQL example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require("express");
const graphqlHTTP = require("express-graphql");

const app = express();

const schemaV1 = /* your v1 schema */;
const schemaV2 = /* your v2 schema */;

app.use("/graphql", graphqlHTTP((req) =&amp;gt; {
    const version = req.headers["version"];
    const schema = version === "v1" ? schemaV1 : schemaV2;
    return {
        schema,
        graphiql: true
    };
}));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the server is using the version header passed in by the client to determine which schema to use.&lt;/p&gt;

&lt;p&gt;Handling versioning with url:&lt;br&gt;
A common approach to versioning REST API's is to include the version number in the URL. For example, you could have &lt;code&gt;/v1/resource&lt;/code&gt; and &lt;code&gt;/v2/resource&lt;/code&gt; as your endpoint for different versions of your API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require("express");
const app = express();

app.use("/v1/resource", (req, res) =&amp;gt; {
    // v1 resource endpoint
});

app.use("/v2/resource", (req, res) =&amp;gt; {
    // v2 resource endpoint
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the server is using different endpoint for different versions of your API.&lt;/p&gt;

&lt;p&gt;Best practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid making breaking changes to the API&lt;/li&gt;
&lt;li&gt;Introduce new fields or types, or deprecate old fields or types in GraphQL API&lt;/li&gt;
&lt;li&gt;Introduce new endpoints or deprecate old endpoints in REST API&lt;/li&gt;
&lt;li&gt;Provide a migration path for existing clients&lt;/li&gt;
&lt;li&gt;Document the API clearly and communicate changes to users&lt;/li&gt;
&lt;li&gt;Provide release notes and detailed documentation for each field, type or endpoint.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>graphql</category>
      <category>webdev</category>
      <category>backend</category>
      <category>rest</category>
    </item>
  </channel>
</rss>
