<?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: Yusuf Bozacı</title>
    <description>The latest articles on DEV Community by Yusuf Bozacı (@yusufbozaci).</description>
    <link>https://dev.to/yusufbozaci</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2482699%2Fe23de711-93ae-4b1b-ad1e-0c41d29b4e1b.png</url>
      <title>DEV Community: Yusuf Bozacı</title>
      <link>https://dev.to/yusufbozaci</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yusufbozaci"/>
    <language>en</language>
    <item>
      <title>REST vs GraphQL: How to Choose the Right API for Your Project</title>
      <dc:creator>Yusuf Bozacı</dc:creator>
      <pubDate>Tue, 13 Oct 2026 20:51:03 +0000</pubDate>
      <link>https://dev.to/yusufbozaci/rest-vs-graphql-how-to-choose-the-right-api-for-your-project-4moe</link>
      <guid>https://dev.to/yusufbozaci/rest-vs-graphql-how-to-choose-the-right-api-for-your-project-4moe</guid>
      <description>&lt;h1&gt;
  
  
  REST vs GraphQL: How to Choose the Right API for Your Project
&lt;/h1&gt;

&lt;p&gt;Choosing between REST and GraphQL isn't really about which technology is better. It's about which problems your application needs to solve.&lt;/p&gt;

&lt;p&gt;Both approaches can power a modern application. Both can return JSON over HTTP. Both can work with almost any database.&lt;/p&gt;

&lt;p&gt;But they make different trade-offs, especially when it comes to data fetching, caching, and complexity.&lt;/p&gt;

&lt;p&gt;Let's break down the differences using a practical example.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: Fetching data for a user profile
&lt;/h2&gt;

&lt;p&gt;Imagine you're building a dashboard that displays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user's name and email&lt;/li&gt;
&lt;li&gt;Their latest five posts&lt;/li&gt;
&lt;li&gt;The number of comments on each post&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With a typical REST API, you might make requests to multiple endpoints:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /api/users/42
GET /api/users/42/posts?limit=5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Depending on your API design, you may need additional requests for comment counts.&lt;/p&gt;

&lt;p&gt;A well-designed REST endpoint can also return everything in one response. REST doesn't require multiple requests, but resource-oriented APIs often encourage separating data into endpoints.&lt;/p&gt;

&lt;p&gt;Now let's look at GraphQL.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="k"&gt;query&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"42"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;commentCount&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One query describes exactly what the interface needs.&lt;/p&gt;

&lt;p&gt;That's the biggest difference: &lt;strong&gt;GraphQL gives clients more control over the response shape.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Data fetching
&lt;/h2&gt;

&lt;p&gt;With REST, servers generally define the structure of each endpoint's response.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Alex"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"alex@example.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"createdAt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2024-01-01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"preferences"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But what if your interface only needs the name?&lt;/p&gt;

&lt;p&gt;You might receive unnecessary information, commonly called over-fetching.&lt;/p&gt;

&lt;p&gt;GraphQL allows the client to request specific fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="k"&gt;query&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"42"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, this flexibility isn't always necessary.&lt;/p&gt;

&lt;p&gt;If your application has a few predictable screens, carefully designed REST endpoints may be simpler to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Caching
&lt;/h2&gt;

&lt;p&gt;REST has a practical advantage: HTTP caching.&lt;/p&gt;

&lt;p&gt;A request such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /api/products/123
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can use standard HTTP caching mechanisms, including cache headers and CDNs.&lt;/p&gt;

&lt;p&gt;GraphQL caching often requires more thought because many implementations use a single endpoint with POST requests.&lt;/p&gt;

&lt;p&gt;Libraries such as Apollo Client provide normalized caching, but your team still needs to understand how cache identities and updates work.&lt;/p&gt;

&lt;p&gt;GraphQL can also use GET requests and persisted queries, so caching isn't impossible. It simply requires different design decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. API contracts
&lt;/h2&gt;

&lt;p&gt;GraphQL uses a strongly typed schema.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives frontend developers a discoverable contract.&lt;/p&gt;

&lt;p&gt;REST can achieve similar benefits using OpenAPI, JSON Schema, and generated TypeScript clients.&lt;/p&gt;

&lt;p&gt;The difference isn't whether type safety is possible. It's how that contract is defined and maintained.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Performance
&lt;/h2&gt;

&lt;p&gt;A common misconception is that GraphQL is automatically faster than REST.&lt;/p&gt;

&lt;p&gt;It isn't.&lt;/p&gt;

&lt;p&gt;GraphQL can reduce network round trips and unnecessary fields, particularly on mobile networks.&lt;/p&gt;

&lt;p&gt;But complex queries can also introduce expensive resolver operations, deeply nested relationships, and N+1 database queries.&lt;/p&gt;

&lt;p&gt;For example, requesting 100 users and each user's posts can accidentally generate hundreds of database queries if resolvers aren't designed carefully.&lt;/p&gt;

&lt;p&gt;REST has performance challenges too, but its more predictable endpoints can be easier to monitor and cache.&lt;/p&gt;

&lt;p&gt;Always measure actual application performance instead of choosing based on assumptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. When should you choose REST?
&lt;/h2&gt;

&lt;p&gt;REST is often a good choice when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your application has predictable data requirements.&lt;/li&gt;
&lt;li&gt;You are building a straightforward CRUD API.&lt;/li&gt;
&lt;li&gt;HTTP caching is important.&lt;/li&gt;
&lt;li&gt;You want a simple public API.&lt;/li&gt;
&lt;li&gt;Your team prefers minimal infrastructure complexity.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. When should you choose GraphQL?
&lt;/h2&gt;

&lt;p&gt;GraphQL becomes attractive when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple clients need different data shapes.&lt;/li&gt;
&lt;li&gt;Your frontend combines many related resources.&lt;/li&gt;
&lt;li&gt;You have complex dashboards or mobile screens.&lt;/li&gt;
&lt;li&gt;You want a strongly typed, discoverable API schema.&lt;/li&gt;
&lt;li&gt;Your team can manage resolver performance and query complexity.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The important part: You don't have to choose only one
&lt;/h2&gt;

&lt;p&gt;It's perfectly reasonable to use both.&lt;/p&gt;

&lt;p&gt;For example, your internal services might expose REST endpoints, while a GraphQL layer combines their data for your frontend applications.&lt;/p&gt;

&lt;p&gt;The best architecture is the one that solves your actual problems with the least unnecessary complexity.&lt;/p&gt;

&lt;p&gt;If you want a quick side-by-side reference, &lt;a href="https://softwaredictionary.org/compare/rest-vs-graphql" rel="noopener noreferrer"&gt;Software Dictionary's REST vs GraphQL comparison&lt;/a&gt; summarizes the differences, common misconceptions, and examples.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Don't choose GraphQL just because your application uses React.&lt;/p&gt;

&lt;p&gt;Don't choose REST only because it's familiar.&lt;/p&gt;

&lt;p&gt;Think about your data requirements, team experience, caching needs, and maintenance costs.&lt;/p&gt;

&lt;p&gt;Start with the simplest approach that meets your requirements. Introduce additional complexity when you have a clear reason.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The right API is the one your team can understand, maintain, and evolve.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>architecture</category>
      <category>backend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Semantic Commit: Guide to Regular Commit Messages</title>
      <dc:creator>Yusuf Bozacı</dc:creator>
      <pubDate>Mon, 25 Nov 2024 21:05:00 +0000</pubDate>
      <link>https://dev.to/yusufbozaci/guide-to-regular-commit-messages-3agd</link>
      <guid>https://dev.to/yusufbozaci/guide-to-regular-commit-messages-3agd</guid>
      <description>&lt;p&gt;Hello Everyone! 👋&lt;/p&gt;

&lt;p&gt;Your commit messages are more than just recording changes to your codebase. Effective and regular commit messages increase your team's collaboration, provide a better understanding of the code, and make debugging easier. In this article, I will share a guide to writing an effective commit message based on semantic commit principles. You will also see how you can streamline your processes with &lt;strong&gt;&lt;a href="https://sematiccommit.com" rel="noopener noreferrer"&gt;semanticcommit.com&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Semantic Commit?
&lt;/h2&gt;

&lt;p&gt;Semantic Commit is a method used in software development. Its main purpose is to ensure that commit messages (i.e., messages associated with each change made to the code) are more meaningful and structured. This way, developers can more easily understand when, why, and what changes were made to the code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Are Commit Messages Important?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Easily Understandable Changes&lt;/strong&gt;&lt;br&gt;
Each commit message clearly describes the changes made. This way, while working on a project, you can quickly understand what changed in the code and why. For example, instead of saying 'just some edits made,' a clear explanation like 'new login page added' is provided.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Faster Issue Resolution&lt;/strong&gt;&lt;br&gt;
When there is a bug in a project, it becomes much easier to find the changes that might have caused the issue by reviewing past commit messages. Meaningful and structured commit messages help you quickly locate and resolve errors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Version Tracking&lt;/strong&gt;&lt;br&gt;
Semantic Commit helps you see more clearly which changes were made in which version of the project. For example, when a new feature is added, the version number can be updated. This makes it easier to keep the project up to date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Team Collaboration&lt;/strong&gt;&lt;br&gt;
When working with multiple people, having everyone write commit messages in the same way keeps the project organized. This way, one team member can more easily understand what another has done, increasing collaboration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Easier Project Management&lt;/strong&gt;&lt;br&gt;
As the project grows, there may be hundreds or even thousands of commits. Meaningful commit messages make it easier to manage the large project and track changes over time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Commit Message Structure
&lt;/h2&gt;

&lt;p&gt;Semantic Commit messages are written according to a specific rule. These rules make the structure of each commit message meaningful and consistent.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Type
&lt;/h3&gt;

&lt;p&gt;This indicates the type of change made. It is added at the beginning of the commit message. Common commit types include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;feat: Used when a new feature is added.&lt;/li&gt;
&lt;li&gt;fix: Indicates that a bug has been fixed.&lt;/li&gt;
&lt;li&gt;docs: Used if only documentation-related changes are made.&lt;/li&gt;
&lt;li&gt;style: Changes that do not affect the code's functionality, only related to formatting (e.g., correcting spaces or punctuation).&lt;/li&gt;
&lt;li&gt;chore: Non-functional changes to the code or dependencies. For example, package updates or changes in build configurations.&lt;/li&gt;
&lt;li&gt;refactor: Used to restructure the code without changing its functionality.&lt;/li&gt;
&lt;li&gt;test: Used to add or update tests.&lt;/li&gt;
&lt;li&gt;perf: Used for changes made solely to improve performance without altering functionality.&lt;/li&gt;
&lt;li&gt;ci: Used for changes related to continuous integration configuration.&lt;/li&gt;
&lt;li&gt;build: Used for changes related to the build system, such as build settings or dependency management.&lt;/li&gt;
&lt;li&gt;revert: Reverts the effects of a previous commit.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Scope (Optional)
&lt;/h3&gt;

&lt;p&gt;Specifies which module, file, or component the change was made on. It is written in parentheses along with the type.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;feat(auth), fix(ui), docs(readme), style(header), chore(deps), refactor(api), test(login), perf(image-loader), ci(travis), build(webpack), revert(api)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Subject
&lt;/h3&gt;

&lt;p&gt;Briefly and concisely describes what the commit does. It should be written in a maximum of 50 characters.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;feat(auth): add login functionality&lt;/li&gt;
&lt;li&gt;fix(ui): resolve button alignment issue&lt;/li&gt;
&lt;li&gt;docs(readme): update installation instructions&lt;/li&gt;
&lt;li&gt;style(header): fix indentation&lt;/li&gt;
&lt;li&gt;chore(deps): update axios to v0.21.1&lt;/li&gt;
&lt;li&gt;refactor(api): optimize fetch method&lt;/li&gt;
&lt;li&gt;test(login): add unit tests for login function&lt;/li&gt;
&lt;li&gt;perf(image-loader): optimize image loading for faster page speed&lt;/li&gt;
&lt;li&gt;ci(travis): add deployment step to pipeline&lt;/li&gt;
&lt;li&gt;build(webpack): update webpack configuration for faster builds&lt;/li&gt;
&lt;li&gt;revert(api): revert API changes that caused issues with data fetching&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Effective commit messages directly affect not only your developer experience but also the overall success of your project. With &lt;strong&gt;Semantic Commit&lt;/strong&gt;, you can make this process more organized, understandable, and efficient.  &lt;/p&gt;

&lt;p&gt;Be sure to try &lt;strong&gt;&lt;a href="https://semanticcommit.com" rel="noopener noreferrer"&gt;semanticcommit.com&lt;/a&gt;&lt;/strong&gt; to write better commit messages!  &lt;/p&gt;

&lt;p&gt;Remember, regular commits are the foundation of regular projects. 🚀  &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>learning</category>
      <category>github</category>
    </item>
  </channel>
</rss>
