shrturl

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

README

shrturl

A url shortening API.

This is a simple REST API that facilitates sharing short URLs. It was written to illustrate the usefulness of the Adapter Design Pattern.

Initial Design

The REST API allows users to POST new url's to the service and are returned a shortened URL. When any user visits the shortened URL they are redirected to the to the original URL. The original specification required that the service be set up quickly and without dependencies. The service accomplishes persistence by writing url mappings to a flat file on the host machine.

Redesign

Since the service's initial release it has become very popular within the ACME corporation. The employees have shared it with their friends and usage load on the service has increased substantially. The ACME corporation overlords have decided that the service is a gift to humanity and want to ensure the service can endure the new load.

Initial reports indicate that the average response time from the service is linearly dependent on the load of the system. The flat file backing store is to blame as each operation depends on this file. Stakeholders for the service indicate that a more efficient persistence service is necessary.

MongoDB is identified as a persistence store of choice. This decouples the service application from the persistence store allow each to scale independently and adapting to the new load on the service. Unfortunately, the libraries for MongodDB do not match the existing client interface. Fortunately, the engineers received a proper education and are aware of an adapter pattern that will allow them to integrate the new design changes.

Documentation

Overview

Copyright 2015 Benjamin Campbell <benji@benjica.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
Package api provides a backing api for the shrturl application
Package api provides a backing api for the shrturl application
Package faststore is a collection of stores that are optimzed and not neccesarly of the same interface as a url.Store
Package faststore is a collection of stores that are optimzed and not neccesarly of the same interface as a url.Store

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL