Skip to content

Commit

Permalink
Update Post “git-based-cms-definition-features-best-practices”
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjagodic committed Nov 15, 2023
1 parent 0a4f371 commit 7b1f8c8
Showing 1 changed file with 29 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,54 @@ date: 2023-11-10T09:18:08.062Z
---
In this post, we'll dive into the definition, main features, caveats, and best practices of Git-based CMS, helping you make an informed decision for your next project.

### **What is a Git-Based CMS?**
### What is a Git-Based CMS?

A Git-based CMS, as the name suggests, enables you to edit content that is stored in your Git repository, alongside your code. It's an integral part of the [Jamstack](https://jamstack.org/what-is-jamstack/) architecture, which separates the frontend from data and business logic. In practice, this means you'll need:
A Git-based CMS, as the name suggests, enables you to edit content that is stored in your [Git](https://git-scm.com/) repository, alongside your code. It's an integral part of the [Jamstack](https://jamstack.org/what-is-jamstack/) architecture, which separates the frontend from data and business logic. In practice, this means you'll need:

- a static site generator or a meta-framework (like Hugo, Gatsby, Next),
- a headless CMS (either Git-based or API-based),
- a build & CDN platform (like Netlify or Vercel).
* a **static site generator** or a meta-framework (like [Hugo](https://gohugo.io/), [Gatsby](https://www.gatsbyjs.com/), [Next](https://nextjs.org/)),
* a **headless CMS** (either Git-based or API-based),
* a build & CDN **platform** (like [Netlify](https://www.netlify.com/) or [Vercel](https://vercel.com/)).

You can also think of a Git-based CMS as a visual editing layer on top of data files like Markdown, JSON, YAML, etc. This makes content management more intuitive for developers, as it brings content directly into your code editor.
You can also think of a Git-based CMS as a **visual editing layer** on top of data files like Markdown, JSON, YAML, etc. This makes content management more intuitive for developers, as it brings content directly into your code editor.

### **Versioning: A Developer's Dream**
### Versioning: A Developer's Dream

The standout feature of Git-based CMS is its robust versioning and history capability. It leverages [Git](https://git-scm.com/)'s powerful version control system, allowing you to restore exact states from various points in history. Moreover, Git-based CMS works seamlessly with branches and branch-related environments, making content editing and review a breeze. This aligns it with the workflows developers are familiar with for code changes.
The standout feature of Git-based CMS is its robust versioning and history capability. It leverages [Git](https://git-scm.com/)'s powerful version control system, allowing you to **restore exact states from any point in history**, for which you can determine who did exactly what and when. Moreover, Git-based CMS works seamlessly with branches and branch-related environments, making content editing and review a breeze. This aligns it with the workflows developers are familiar with for code changes.

### **Simplicity at Its Core**
### Simplicity at Its Core

While there may be differences among Git-based CMS options, they are generally straightforward to set up. For instance, Decap CMS can be integrated with just the addition of [two files](https://decapcms.org/docs/add-to-your-site/) to your repository. Storing content alongside your code makes it easily accessible for developers, eliminating the need to switch between code editors and tools like phpMyAdmin. The user interface for content editors is designed with a focus on content, simplifying their experience and leaving out unnecessary settings and styling options. Say goodbye to dependency alerts, as you might encounter in traditional CMS platforms like WordPress.
While there may be differences among Git-based CMS options, they are generally **straightforward to set up**. For instance, Decap CMS can be integrated with just the addition of [two files](https://decapcms.org/docs/add-to-your-site/) to your repository. Storing content alongside your code makes it easily **accessible for developers**, eliminating the need to switch between code editors and tools like phpMyAdmin. The user interface is designed with a focus on content, **simplifying content editors’ experience** and leaving out unnecessary settings and styling options. Say goodbye to dependency alerts, as you might encounter in traditional CMS platforms like WordPress.

### **Scalability: From Small to Large Projects**
### Scalability: From Small to Large Projects

Git-based CMS solutions balance simplicity and scalability, making them suitable for a wide range of projects. Scalability largely depends on the volume of your content and the speed at which you need to serve it. For static site projects, Git-based CMS can go a long way. However, if you require instant search or other resource-intensive queries, you might want to consider an API-based solution.
Git-based CMS solutions balance simplicity and scalability, making them suitable for a wide range of projects. **Scalability largely depends on the volume of your content and the speed at which you need to serve it**. For static site projects, Git-based CMS can go a long way.

Some Git-based CMS platforms like Tina and CloudCanon offer a cloud database proxy, enabling advanced features that might be necessary for specific projects. The scalability of your Git-based CMS will also depend on your Git provider, as the CMS consumes resources through their API when making commits. The decoupled nature of Git-stored content ensures that scaling your frontend to accommodate more users is a seamless process.
But not all the way. For example, a Decap project on Github scales to about 10.000 entries if you have a lot of collection relations. It’s possible to have more entries if there are fewer relations. The bottleneck in this case is the GitHub API, which has a rate limit of 5000 on the personal plan and 15000 on the enterprise plan. A new user with an empty cache will eat up that limit fast because Decap will make a request per each entry to create a cache.

### **Enhanced Security and Business Flexibility**
To mitigate this, some Git-based CMS platforms like [Tina](https://tina.io/) and [CloudCanon](https://cloudcannon.com/) offer a cloud database proxy, enabling advanced features that might be necessary for specific projects. Those could be real-time collaboration, user roles, and other resource-intensive queries.

With content stored alongside your code, the security landscape becomes simplified. You only need to secure a single source, and you can outsource this responsibility to your Git provider, such as GitHub or BitBucket. The CMS user interface can be further secured with the authentication service of your choice. Some Git-based CMS platforms even offer customizable logins, and others allow you to define an external or custom solution. Additionally, certain Git-based CMS platforms provide different roles for content editors, giving you fine-grained control over who can make changes.
It is important to understand that any **limitations of the CMS are not the limitations of the frontend**. The decoupled nature of Git-stored content enables this.

From a business perspective, Git-based CMS solutions offer exceptional value, with many open-source options available. Numerous platforms provide free tier options that can be upgraded as your needs evolve. Importantly, you retain ownership of your content, which is stored in universally recognized formats like [Markdown](https://en.wikipedia.org/wiki/Markdown). This means you can easily switch to another CMS with minimal effort. Depending on your business requirements, you can choose from options like simple open-source solutions to more advanced options like DB proxies and real-time collaboration, each with its pricing structure.
### Enhanced Security and Business Flexibility

### **Caveats to Consider**
With content stored alongside your code, the security landscape becomes simplified. You only need to **secure a single source**, and you can outsource this responsibility to your Git provider, such as [GitHub](https://github.com/) or [BitBucket](https://bitbucket.org/product). The CMS user interface can be further secured with the authentication service of your choice. Some Git-based CMS platforms even offer customizable logins, and others allow you to define an external or custom solution. Additionally, certain Git-based CMS platforms provide different roles for content editors, giving you fine-grained control over who can make changes.

As with any technology, there are caveats to keep in mind when using a Git-based CMS. Content managed through a Git-based CMS is typically project-specific and not recommended for cases where you have a central repository of content serving multiple frontend clients, such as a website and a mobile app. While Git providers offer fast and reliable APIs, very large repositories may experience performance issues. Some Git-based CMS platforms address this with a cloud database layer, which comes at an additional cost.
From a business perspective, Git-based CMS solutions offer **exceptional value**, with many open-source options available. Numerous platforms provide free tier options that can be upgraded as your needs evolve. Importantly, you retain ownership of your content, which is stored in universally recognized formats like [Markdown](https://en.wikipedia.org/wiki/Markdown). This means you can easily **switch to another CMS with minimal effort**. Depending on your business requirements, you can choose from options like simple open-source solutions to more advanced options like DB proxies and real-time collaboration, each with its pricing structure.

Moreover, Git is not ideal for storing large files like images efficiently. Although Git offers a feature known as Large File Storage (LFS), it's often more practical to use an external service such as [Cloudinary](https://cloudinary.com/) to manage large assets. These services can be seamlessly integrated into your Git-based CMS, providing a more efficient way to handle media files.
### Caveats to Consider

### **Best Practices for Git-Based CMS Adoption**
As with any technology, there are caveats to keep in mind when using a Git-based CMS. Content managed through a Git-based CMS is typically **project-specific** and not recommended for cases where you have a central repository of content serving multiple frontend clients, such as a website and a mobile app. While Git providers offer fast and reliable APIs, very large repositories may experience performance issues. Some Git-based CMS platforms address this with a cloud database layer, which comes at an additional cost.

When considering a Git-based CMS, it's crucial to approach it within the context of your entire tech stack. It's a fundamental part of the Jamstack architecture, so it's essential to plan your project accordingly. You can add a Git-based CMS later on or replace it, but having a clear understanding of your project's requirements from the start will simplify the process.
Moreover, Git is not ideal for storing large files like images efficiently. Although Git offers a feature known as [Large File Storage](https://git-lfs.com/) (LFS), it's often more practical to use an external service such as [Cloudinary](https://cloudinary.com/) to manage large assets. These services, called digital asset managers (DAM), can be seamlessly integrated into your Git-based CMS, providing a more efficient way to handle media files. DAMs store your assets in a central repository, serve with an optimized CDN, and offer an array of transformations to optimize media delivery.

### Best Practices for Git-Based CMS Adoption

When considering a Git-based CMS, it's crucial to approach it within the context of your entire tech stack. It's a **fundamental part of the Jamstack** architecture, so it's essential to plan your project accordingly. You can add a Git-based CMS later on or replace it, but having a clear understanding of your project's requirements from the start will simplify the process.

Research your options thoroughly, as there are numerous Git-based CMS platforms with different features. Ask yourself what you need and explore the combinations that align with your project's objectives. If you're migrating from a traditional database-driven CMS, you can find scripts online or ask for assistance to ease the transition.

### **In Conclusion**
### In Conclusion

Git-based CMS offers versioning, simplicity, and security, making it a joy to install, use, and maintain. It is suitable for small to large projects, but there is an upper limit to its scalability.

Git-based CMS offers versioning, simplicity, and security, making it a joy to install, use, and maintain. It streamlines the CMS experience, reducing complexity and offering greater control over your content. In essence, it’s the most of CMS for the least amount of moving parts.
It streamlines the CMS experience, reducing complexity and offering greater control over your content. In essence, **it’s the most of CMS for the least amount of moving parts**.

0 comments on commit 7b1f8c8

Please sign in to comment.