GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - arthurfp/Go_Object-Pool_Pattern: A Go project demonstrating the Object Pool pattern for efficient management of database connections. Features dynamic resource allocation, connection health checks, and configurable pool settings to optimize application performance.

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
cmd
cmd
 
 
internal/database
internal/database
 
 
pkg/pool
pkg/pool
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 

Repository files navigation

Object Pool Pattern Demonstration in Go

Overview

This repository showcases the implementation of the Object Pool design pattern in Go. The project demonstrates how to manage a pool of reusable resources — in this case, database connections — efficiently. The primary focus is on optimizing resource allocation, minimizing the overhead of resource initialization, and managing resource lifecycle to enhance application performance.

Pattern Description

The Object Pool Pattern is used to manage a set of ready-to-use objects from a pool rather than allocating and freeing them individually. This is especially useful in applications where the cost of initializing a class instance is high, the rate of instantiation of a class is high, and the number of instantiations in use at any one time is low. In this project, the pattern is implemented to manage database connections, ensuring that connections are reused efficiently and that the pool dynamically adjusts to load, improving overall application throughput.

Project Structure

  • cmd/: Contains the application entry point (main.go), demonstrating the use of the Object Pool pattern to manage database connections.
  • pkg/
    • pool/: Implements the connection pool, managing the lifecycle and availability of database connections.
  • internal/
    • database/: Contains the Connection class definition which represents individual database connections.

Getting Started

Prerequisites

Ensure you have Go installed on your system. You can download it from Go's official site.

Installation

Clone this repository to your local machine:

git clone https://github.com/arthurfp/Go_Object_Pool_Pattern.git
cd Go_Object_Pool_Pattern

Running the Application

To run the application, execute:

go run cmd/main.go

Running the Tests

To execute the tests and verify the functionality:

go test ./...

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues to discuss proposed changes or enhancements.

Author

Arthur Ferreira - github.com/arthurfp

About

A Go project demonstrating the Object Pool pattern for efficient management of database connections. Features dynamic resource allocation, connection health checks, and configurable pool settings to optimize application performance.

Topics

code-patterngogolangobject-pool-pattern

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.