Who hasn't used HTTP (standard library) when developing with Go Gin、Echo、Iris、Fiber、Beego、GoFrame、gRPC、Go-Micro、Go-Zero、Kratos Have you read countless people in these frameworks? Everyone claims to have good performance and powerful features, but there are always some "unpleasant" moments when using it, right?
Just like dating, at first you may think everyone is good, but over time, various small frictions and pain points come out. Today, I'm going to chat with everyone about how I found my "dream frame" - Sponge, and how "fragrant" it really is after "reading a thousand sails"!
In those years, we stepped into the pit together
Before encountering Sponge, my daily Go development was both painful and happy.
Gin, Echo: Although freedom is good, it cannot withstand the 'four walls of the family'
Gin and Echo can be said to be old friends of Gopher, lightweight, fast, and easy to get started with. But the price of freedom is that many things have to be made by oneself.
Do you want to write a simple CRUD? Okay, from defining struct, writing handler, service, model, to registering routing, a set of "physical labor" took half a day to complete. It's okay if the project is small, but as soon as it gets bigger, the code structure starts to 'let go of oneself', and different people write different 'under garments' - oh no, styles.
Let me show you a "familiar" picture, using Gin to write an interface for creating users. Does it feel like every project is copying and pasting
![]()
This is just the simplest example, and adding database operations, logs, parameter validation, error handling... the amount of code and repetitive labor can be imagined. Every time I start a new project, it feels like reinventing the wheel, and my heart is tired.
Go Micro, Go Zero, Kratos: Although microservices are good, they are a bit "heavy"
In order to solve the above problems, the community has also emerged a group of excellent "heavyweight" players, such as go micro, go zero, and kratos. They provide a very comprehensive microservice governance capability, covering everything from RPC, service discovery, configuration center to link tracing.
But their 'pain' is also here:
The learning curve is steep: to make good use of them, one must first spend a lot of time learning the concepts and various components of the framework, which can be a bit "heavy" for projects that want to quickly get started and iterate.
Code generation "black box": Although they also provide code generation tools, sometimes the generated code is too "magical" and it is unclear where to start when problems arise. And for us developers who have a 'code cleanliness obsession', it feels like we can't fully control the code, you know.
The project structure is huge: a simple service may also generate a lot of files and directories, sometimes it feels like "culling a chicken with a cow's knife".
Encountering Sponge: My 'Truly Fragrant' Moment!
Just as I was about to jump back and forth between "making wheels repeatedly" and "being kidnapped by frames", and even began to doubt my life, I discovered Sponge.
Sponge perfectly balances development efficiency and code controllability, solving all the pain points mentioned above.
1. "Foolish" code generation, bidding farewell to repetitive labor
What impressed me the most about Sponge is its powerful code generation ability. It's not just about generating some template code, but truly one click generation of a complete project!
You just need to:
Define your database table structure (such as an SQL file).
Or define your API interface (a Protobuf file).
Then, with a few clicks on the web interface provided by Sponge, a complete, production level backend service code is generated!
Still the example of creating a user above, how to do it with Sponge?
Step 1: Taking MySQL as an example, write a user.sql file and import it into MySQL service. Other database services (such as PostgreSQL, MongoDB, etc.) are also similar.
Step 2: On Sponge's web interface, select "Generate Web Service Based on SQL", fill in the MySQL service DSN address, and select the table name "user".
Step 3: Click on "Generate Code" and download the compressed file.
After decompression, you will get a complete and runnable project! Includes:
API interface (/app/v1/user)
Swagger documentation (automatically generated, can be directly debugged online)
Handler layer (request handling)
Service layer (business logic)
DAO layer (database CRUD operations, based on GORM)
Complete project structure Makefile、Dockerfile……
You read it right, you don't need to write a single line of Go code, just a fully functional CRUD service is enough! This development efficiency is simply taking off!
2. Building block architecture, flexible and decoupled
The code generated by Sponge is not a pile of 'spaghetti'. It adopts a very clear layered and decoupled design.
Each module is like a building block, you can freely combine and expand it. for example
Don't want to use GORM? No problem, the DAO layer is API based, and you can easily replace it with any ORM you like.
Do you want to add custom logic? The Service layer has already reserved "homework" for you, and you only need to fill in the core business logic in the generated template, without worrying about the framework's miscellaneous matters.
Want to transition from monolithic to microservices? The projects generated by Sponge are naturally microservices architecture, which can be easily split and combined.
This design not only ensures development efficiency, but also gives developers great freedom and a sense of control. The code is' your 'code, not' framework 'code.
3. Rich built-in components, ready to use out of the box
Sponge is not just a code generator, it's also a 'family bucket'.
Web framework: Built in Gin, you can seamlessly use all of Gin's middleware and ecosystem.
RPC framework: Supports gRPC and can generate HTTP+gRPC or gRPC Gateway with one click, allowing your gRPC service to support HTTP calls simultaneously.
Service governance: integrates a series of essential microservices components such as service discovery, circuit breaker, current limiting, link tracing, and monitoring.
Common libraries: Gorm, Redis, MongoDB, Kafka, RabbitMQ... are all encapsulated for you to use right out of the box.
Previously, when using Gin, one had to search for libraries, integrate them, and package them one by one. Now with Sponge, just turn on the switch directly in the configuration file, don't be too excited!
summary
Returning to the original question, after reading so many Go frameworks, why did I ultimately choose Sponge?
For individual developers and startup teams: the only martial arts in the world are fast and unbreakable. Sponge allows you to quickly build product prototypes, validate ideas, and spend time on core business rather than repetitive physical labor.
For medium to large teams: Sponge has unified project structure and development standards, reducing the cost of getting new members started and improving team collaboration efficiency. Its high cohesion and low coupling design also makes the project easier to maintain and expand.
For Gopher, who pursues perfection, there is no "black magic" in Ponge. The generated code is clear and standardized, allowing you to enjoy efficient development while still fully controlling your own code and learning excellent architectural design ideas from it.
Of course, no framework is a perfect silver bullet. But Sponge really touched me, it's like an experienced big brother, helping you do all the dirty and tiring work, allowing you to focus more on creative work.
If you, like me, are tired of wavering between various frameworks and repetitive work day after day, why not give Sponge a chance. Go to its GitHub repository and run through the examples. Trust me, you will also shout out those two words from the bottom of your heart like me: really fragrant!