GEMVC Philosophy

15 minutes BEGINNER

Learn the core principles and design philosophy that make GEMVC a powerful, secure, and easy-to-use microservice framework.

What You'll Learn

Core Principles

Simplicity, security, and performance

Microservice Architecture

Designed for small, focused services

4-Layer Architecture

API, Controller, Model, and Table layers

Video Coming Soon...

Core Philosophy

GEMVC is built with a simple yet powerful philosophy: easy to learn, easy to implement, easy to write code, and easy to maintain.

We believe that building REST APIs should be straightforward, secure by default, and performant without unnecessary complexity. GEMVC is designed to help developers create reliable microservices quickly and efficiently.

Microservice Architecture

GEMVC is specifically designed for microservice-based architecture. Our philosophy is based on breaking down large, complex projects into smaller, focused microservices.

The 8-10 Table Rule

A well-designed microservice should have a maximum of 8 to 10 tables. If your microservice requires more than 10 tables, it's time to rethink your microservice design and consider splitting it into multiple services.

The GEMVC philosophy is: "We have fantastic frontend applications. We need to break big, complex projects into smaller projects, finish each project as a microservice, and finally aggregate them on any frontend."

Lightweight & Fast

GEMVC philosophy is to be super light and fast without losing high-level security standards. We made a conscious decision to keep dependencies minimal and the framework as independent as possible.

Why Minimal Dependencies? We want to make GEMVC as independent as possible while keeping it light but effective. This approach ensures better performance, easier maintenance, and fewer compatibility issues.

GEMVC comes with its own lightweight ORM instead of using heavy ORMs like Doctrine. Since each microservice has a maximum of 10 tables, a large ORM like Doctrine would be a waste of performance and simply overkill.

Security by Default

GEMVC comes automatically with a high level of built-in security. The framework is secure by its own design - developers just need to define what each endpoint URL accepts.

90% Security Automatic: Input sanitization, SQL injection prevention, and path protection are all handled automatically by GEMVC. You focus on defining your API schema, and GEMVC handles the security.

GEMVC philosophy is "auto documentation with sanitization" - meaning if you sanitize your API input, you automatically have documentation! The auto-documentation generator creates comprehensive API docs based on your schema definitions.

GEMVC vs. Laravel & Symfony

GEMVC is NOT Laravel or Symfony. It targets a completely different approach and use case.

Laravel

Full-stack monolithic application framework designed for complete web applications with views, routing, and everything in one package.

GEMVC

Reliable REST API microservice-based framework focused solely on building fast, secure, and maintainable API services.

While Laravel is a ready full-stack monolithic application framework, GEMVC targets reliable REST API microservices. Each framework serves different purposes and architectural patterns.

4-Layer Architecture

GEMVC follows a clean 4-layer architecture pattern that separates concerns and makes code easy to understand and maintain:

1

API Layer

Handles authentication, sanitization, and documentation. Defines what each endpoint accepts.

2

Controller Layer

Aggregates and orchestrates different models. Calls multiple models and coordinates business logic flow.

3

Model Layer

Contains business logic, validations, and data transformations. Handles the "what" of your application.

4

Table Layer

Database layer abstraction. Handles all database operations and queries. Provides the data access layer.

Request Flow:

API calls ControllerController calls ModelModel calls Table

Webserver Agnostic

GEMVC is webserver agnostic - your application code works identically on OpenSwoole, Apache, or Nginx without a single line of application code change.

This philosophy allows you to:

  • Start with Apache for development
  • Switch to Nginx for production
  • Use OpenSwoole for high-performance async operations
  • All without changing your application code!

GEMVC Philosophy Summary

Core Values

  • ✓ Easy to learn and implement
  • ✓ Easy to write code and maintain
  • ✓ Fast, secure, and lightweight
  • ✓ Microservice-focused architecture

Key Features

  • ✓ Security by default (90% automatic)
  • ✓ Auto documentation with sanitization
  • ✓ Webserver agnostic
  • ✓ 4-layer clean architecture

🎉 Philosophy Complete!

Now that you understand GEMVC's philosophy, let's explore the architecture in detail!