DEV Community

Cover image for The secret to boost the efficiency of your development projects, support for database mysql, mongodb, postgresql, tidb, sqlite
zhuyasen
zhuyasen

Posted on

The secret to boost the efficiency of your development projects, support for database mysql, mongodb, postgresql, tidb, sqlite

In today's fast-paced software development landscape, boosting efficiency is of paramount importance. Developers are constantly on the lookout for tools and technologies that can shorten development cycles and produce higher-quality applications. This article introduces a groundbreaking development tool that can increase development project efficiency by more than 5 times and supports multiple databases, even enabling low-code development using the Go language.

If you are develop RESTful web service or microservice with a simple CRUD API interface, you don't need to write any Go code can be compiled and deployed to the linux server, docker, k8s, just need to connect to the database (mysql、mongodb、postgresql、tidb、sqlite) to generate a complete service code.

If you develop generic web or microservices, just focus on the three core parts of define database tablesdefine api interfaces in proto filesfill in business logic code in the generated template files, and the rest of the go code is automatically generated.

Introducing Sponge

Sponge is a basic development framework that integrates code auto generationGin and GRPC, sponge has a rich set of code generation commands, generating different functional code can be combined into a complete service (similar to the way that artificially broken sponge cells can automatically recombine into a new sponge). The code is decoupled and modularly designed, it is easy to build a complete project from development to deployment, just fill in the business logic code on the generated template code, greatly improved development efficiency and reduced development difficulty.

Github address: https://github.com/zhufuyi/sponge 

Code Generation Framework

Sponge mainly generates code based on SQL and Protobuf in two ways, each of which generates code for different purposes. Among them, SQL supports the databases MySQL, MongoDB, PostgreSQL, TiDB, and SQLite.

Code Generation Framework Diagram

Image description

UI Interface Corresponding to the Code Generation Framework

Image description

Egg Model for Generating Service Code

Image description

Framework Diagram Corresponding to the Generated Service Code

Image description

Key Features

Sponge is a relatively comprehensive development framework that aims to simplify and accelerate the development process. It provides a range of powerful features and functionalities to help developers overcome common bottlenecks and significantly improve efficiency.

Feature Description
GUI Operation The code generation command comes with a user-friendly GUI interface.
Database Support Supports mainstream databases such as MySQL, MongoDB, PostgreSQL, TiDB, and SQLite.
Automatic Code Generation Automatically generate and merge code based on database tables, saving significant time and effort.
Rich Service Types Supports the development of web services, grpc services, and grpc gateway services.
High Reliability and Performance Service code is decoupled and modularized, with rigorous testing and adherence to good coding practices. Built-in caching easily handles high concurrency.
Automated Deployment Provides one-stop automated deployment of binaries, docker, and kubernetes, quickly deploying applications to production environments.
Team Collaboration Unified code specifications for more efficient team collaboration.

Advantages

Sponge offers the following advantages:

Advantage Description
Improved Development Efficiency Automatic code generation, code merging, and other features significantly improve development speed.
Reduced Development Difficulty Low-code development allows developers to create applications without writing large amounts of code.
Shortened Time to Market Deployment automation reduces deployment time, enabling applications to be put into production faster.
Improved Code Quality Automatically generated unit tests ensure high quality and maintainability of applications.
Reduced Development Cost By significantly improving efficiency and reducing developer involvement, the overall development cost of applications is reduced.

Application Scenarios

Sponge is suitable for backend service development scenarios in various businesses, including:

  • High-performance Web services
  • Microservices
  • GRPC gateway services

Quick Start

The first step is to install Sponge. It supports installation on Windows, Mac, Linux, and Docker environments. Click to view the Sponge installation instructions.

After the installation is complete, start the Sponge UI service:

sponge run
Enter fullscreen mode Exit fullscreen mode

You can generate the services and related code you need on the UI interface. For detailed tutorials, click here to view:

Examples of sponge development

Develop a simple community web backend service in one day This example demonstrates how to use Sponge to quickly develop a simple web backend service for a community. The service includes basic functions such as user registration, login, and posting.
Seamlessly migrate a monolithic web service to microservices This example shows how to use Sponge to migrate a monolithic web service to microservices with minimal effort. The example covers the process of splitting the service into multiple independent services and implementing communication between them.
Quickly build a simple order system with distributed transactions from scratch This example demonstrates how to use Sponge to build a simple order system with distributed transactions. The system includes features such as order creation, coupon, payment, and inventory management.

Conclusion

Sponge is a development framework that helps you dramatically increase development efficiency and reduce development costs. Through its support for major databases, low-code development, and automation features, sponge provides unparalleled value for a variety of back-end service development scenarios. If you're looking for a way to dramatically improve development efficiency and shorten time-to-market, then sponge is definitely worth a try.

Top comments (0)