Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swarajkumarsingh/ziplink
Fully Scalable URL shortener backend with Golang, with caching for millions of users
https://github.com/swarajkumarsingh/ziplink
backend caching db go golang mongodb redis scalable url-shortener ziplink
Last synced: about 1 month ago
JSON representation
Fully Scalable URL shortener backend with Golang, with caching for millions of users
- Host: GitHub
- URL: https://github.com/swarajkumarsingh/ziplink
- Owner: swarajkumarsingh
- License: mit
- Created: 2023-09-17T13:01:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-14T12:13:31.000Z (12 months ago)
- Last Synced: 2024-12-04T17:07:55.741Z (2 months ago)
- Topics: backend, caching, db, go, golang, mongodb, redis, scalable, url-shortener, ziplink
- Language: Go
- Homepage: https://github.com/swarajkumarsingh/ziplink
- Size: 521 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# URL Shortener Service
![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)
![]()
A Scalable URL shortener service implemented in Golang with Redis and MongoDB for storage, and Docker for containerization.
## Table of Contents
- [Features](#features)
- [Prerequisites](#prerequisites)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)## Features
- Shorten long URLs into easy-to-share links
- Store URL mappings in both Redis and MongoDB for performance and durability
- Retrieve original URLs by visiting the shortened link
- Dockerized for easy deployment## Prerequisites
Before you begin, ensure you have met the following requirements:
- [Golang](https://golang.org/) installed
- [Redis](https://redis.io/) server installed and running
- [MongoDB](https://www.mongodb.com/) server installed and running
- [Docker](https://www.docker.com/) installed (optional, for containerization)## Getting Started
### Installation
1. Clone this repository:
```bash
git clone https://github.com/swarajkumarsingh/ziplink.git```
2. Navigate to the project directory:
```bash
cd ziplink
```3. Install the required Go packages:
```bash
go mod tidy
```### Benchmarks
* **POST requests (Create Short-URL):** Average 856.728106ms (shared cloud cluster)
* **GET requests (REDIRECT URL):** Average 5.33ms (Redis, MongoDB)### Configuration
1. Mongodb client(local, atlas)
2. Redis client(local, cloud)### Usage
- After installing docker, just run dev.bat(windows), linux and mac run make run(Note: Mongodb, and redis client should be running,)
**NOTE:** Add configs as shown in run.example.sh
```bash
./run.sh
```### Contributing
Contributions are welcome! If you'd like to contribute to this project, please follow these guidelines:1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and test thoroughly.
4. Commit your changes with clear commit messages.
5. Create a pull request against the main branch.### License
This project is licensed under the MIT License. See the LICENSE file for details.