Need advice about which tool to choose?Ask the StackShare community!
API Platform vs Symfony: What are the differences?
API Platform is a powerful set of tools built on top of Symfony, a popular PHP framework. While Symfony provides a foundation for building web applications, API Platform focuses specifically on creating and managing APIs. This means that API Platform offers additional features and functionality specifically designed for API development.
Architecture: One key difference between API Platform and Symfony is the architecture they follow. Symfony uses a traditional MVC (Model-View-Controller) architecture, where the application is divided into separate layers responsible for handling various aspects of the application. On the other hand, API Platform follows a CQRS (Command Query Responsibility Segregation) and DDD (Domain-Driven Design) architecture. This allows for better separation of concerns and enables the use of specific patterns and concepts specifically tailored for building APIs.
Automatic CRUD operations: API Platform simplifies the process of creating CRUD (Create, Read, Update, Delete) operations by automatically generating them based on the provided entity definitions. With Symfony, you would need to manually define and implement these operations for each entity.
API documentation: API Platform provides built-in tools for automatically generating API documentation, including interactive API documentation using the OpenAPI (formerly known as Swagger) specification. This makes it easier for developers to understand and consume the API without the need for extensive manual documentation. Symfony, on the other hand, does not have built-in support for generating API documentation.
Serialization and normalization: API Platform offers a powerful serialization and normalization system that allows developers to define how entities should be serialized and normalized when exposed through the API. This ensures consistency and flexibility when dealing with data representations. Symfony also has serialization capabilities, but they are not as comprehensive and integrated as in API Platform.
GraphQL support: API Platform provides out-of-the-box support for GraphQL, a query language for APIs. This allows developers to easily expose GraphQL endpoints and benefit from the advantages of this query language, such as reducing over-fetching and under-fetching of data. Symfony does not have native support for GraphQL and would require additional configuration and libraries to implement it.
In Summary, API Platform and Symfony have key differences in their architecture, automatic CRUD operations, API documentation generation, serialization and normalization capabilities, and native support for GraphQL. API Platform focuses specifically on creating and managing APIs, providing additional features and functionality tailored for API development.
I'm about to begin working on an API, for which I plan to add GraphQL connectivity for processing data. The data processed will mainly be audio files being downloaded/uploaded with some user messaging & authentication.
I don't mind the difficulty in any service since I've used C++ (for data structures & algorithms at least) and would also say I am patient and can learn fairly quickly. My main concerns would be their performance, libraries/community, and job marketability.
Why I'm stuck between these three...
Symfony: I've programmed in PHP for back-end in a previous internship and may do so again in a few months.
Node.js: It's newer than PHP, and it's JavaScript where my front-end stack will be React and (likely) React Native.
Go: It's newer than PHP, I've heard of its good performance, and it would be nice to learn a new (growing) language.
Go with Node.js. There's something really satisfying about being able to use a single language across your entire tech stack. Especially once you integrate GraphQL, which is effectively JSON.
Your second best option is Go, but the ecosystem around Node.js is quite a bit stronger. This will play a big factor when you start building functionality like file management, messaging (especially in real-time), and authentication. The libraries and documentation are just stronger for Node.
Pros of API Platform
- Headless1
- Microframework1
- Symfony1
- Open source1
- Composer1
- Easy to use1
- Automated api-docs1
- Restful1
Pros of Symfony
- Open source177
- Php149
- Community130
- Dependency injection129
- Professional122
- Doctrine80
- Organized75
- Modular architecture71
- Smart programming47
- Solid45
- Documentation20
- LTS releases16
- Decoupled framework components10
- Robust10
- Easy to Learn10
- Good practices guideline8
- Service container8
- Bundle8
- Powerful7
- Simple7
- Flexible6
Sign up to add or upvote prosMake informed product decisions
Cons of API Platform
- Easy only for easy task like normal crud on entity2
Cons of Symfony
- Too many dependency10
- Lot of config files8
- YMAL4
- Feature creep3
- Bloated1