1. The document describes a project to build RESTful web services for a social media application like Pinterest. It includes functionalities implemented, high-level architecture with Python web services, CouchDB database, and client testing with cURL.
2. The web services were built with Bottle microframework and exposed CRUD operations as HTTP methods. Data was stored in CouchDB with a flat schema for each user document.
3. While the schema had limitations of returning full documents, it mapped requests to data through URL traversal and operations through HTTP methods as required for REST.
This documentation details the design of a Distributed Web content caching system in a LAN, using the SDN OpenFlow model. This system was successfully implemented on GENI (Global Environment for Network Innovations) to test the performance improvements.
This distributed web-caching helps reduce access delays of frequently requested web content (web pages, files - pdfs, images,etc.) within the LAN by more than 50% compared to a LAN without this caching system. Further, this model helps in reducing load on the access links as every repeated request need not be fetched from the main server located in some other geographical area.
The distribution of caching servers in the LAN aim at load balancing the requests and also tackle the issue of single point of failure as in a centralized caching system.
IJRET : International Journal of Research in Engineering and Technology is an international peer reviewed, online journal published by eSAT Publishing House for the enhancement of research in various disciplines of Engineering and Technology. The aim and scope of the journal is to provide an academic medium and an important reference for the advancement and dissemination of research results that support high-level learning, teaching and research in the fields of Engineering and Technology. We bring together Scientists, Academician, Field Engineers, Scholars and Students of related fields of Engineering and Technology.
This documentation details the design of a Distributed Web content caching system in a LAN, using the SDN OpenFlow model. This system was successfully implemented on GENI (Global Environment for Network Innovations) to test the performance improvements.
This distributed web-caching helps reduce access delays of frequently requested web content (web pages, files - pdfs, images,etc.) within the LAN by more than 50% compared to a LAN without this caching system. Further, this model helps in reducing load on the access links as every repeated request need not be fetched from the main server located in some other geographical area.
The distribution of caching servers in the LAN aim at load balancing the requests and also tackle the issue of single point of failure as in a centralized caching system.
IJRET : International Journal of Research in Engineering and Technology is an international peer reviewed, online journal published by eSAT Publishing House for the enhancement of research in various disciplines of Engineering and Technology. The aim and scope of the journal is to provide an academic medium and an important reference for the advancement and dissemination of research results that support high-level learning, teaching and research in the fields of Engineering and Technology. We bring together Scientists, Academician, Field Engineers, Scholars and Students of related fields of Engineering and Technology.
Develop skills to prepare for installing, configuring and performing ongoing maintenance of a Microsoft Exchange Server 2013 infrastructure.
Help prepare for certification exam 70-341.
Learn best practices.
Integration and Batch Processing on Cloud FoundryJoshua Long
This talk explores the new possibilities for scale by using Spring Integration, Spring Batch and RabbitMQ on Cloud Foundry, the open source PaaS from VMWare.
Develop skills to prepare for installing, configuring and performing ongoing maintenance of a Microsoft Exchange Server 2013 infrastructure.
Help prepare for certification exam 70-341.
Learn best practices.
This article tries to demystify HTTP, "servlet", "web server", "application server", "servlet container" and gives the fundamentals of the Java Servlet API (that comes with the J2EE SDK).
Dịch vụ : Thiết kế website (http://www.web360.com.vn/) - Dịch vụ thiết kế web khách sạn (http://web360.com.vn/Thiet-ke-Web-khach-san.html)
Web360 công ty thiết kế web với nhiều năm kinh nghiệm , chúng tôi cung cấp các giải pháp dành cho những khách hàng có nhu cầu xây dựng website để đẩy mạnh công việc kinh doanh, mở rộng các kênh bán hàng, tăng cường khả năng giao tiếp với khách hàng hoặc muốn khẳng định đẳng cấp hoặc thương hiệu của công ty.
Thiết kế web giá rẻ nhất đà nẵng(http://web360.com.vn/Thiet-ke-web-gia-re-da-nang.html)
DỊCH VỤ THIẾT KẾ WEB CHUYÊN NGHIỆP CỦA CHÚNG TÔI NHƯ SAU :
1. Giao diện website được thiết kế đẹp mắt, chuyên nghiệp.
2. Website được nghiên cứu kỹ các đối tượng khách hàng, phân tích nhu cầu, thói quen và hành vi của họ khi duyệt web để xây dựng các chức năng và nội dung phù hợp nhằm biến họ trở thành khách hàng thực sự của bạn.
3. Nghiên cứu rất kỹ các đối thủ cạnh tranh của bạn trên mạngi internet và sẽ tư vấn cho bạn cách để bạn vượt qua họ.
4. Các chuyên gia của chúng tôi cũng sẽ tư vấn cho bạn cách viết nội dung và sử dụng những từ khóa có giá trị nhằm thu hút và giữ chân khách hàng, đồng thời tạo thiện cảm cho các công cụ tìm kiếm.
5. Tối ưu hóa công cụ tìm kiếm chuẩn SEO google
Liên hệ với chúng tôi để được tư vấn thiết kế web tại Đà Nẵng tận tình nhất !
Thiet ke web da nang - Cong ty thiet ke web tai da nang (http://web360.com.vn/Thiet-ke-web-Da-Nang.html)
Liên hệ : 090.52.52.360 - 0905.595.360(Mr Hoàng)
Email : info@web360.com.vn (info@web360.com.vn)
Website : www.web360.com.vn (http://web360.com.vn/)
Địa chỉ : 44 Ngô Chi Lan - Q.Hải Châu - TP.Đà Nẵng
Chúng tôi luôn nỗ lực đem lại cho khách hàng những sản phẩm và dịch vụ tốt nhất !
dịch vụ,thiết kế,thiết kế web,chuyên nghiệp,dịch vụ thiết kế,dịch vụ thiết kế web đà nẵng
This session will provide attendees with hands-on experience and in-depth knowledge of using Node.js as a runtime environment and Express.js as a web framework to build scalable and fast backend systems. Additionally, attendees will learn about Passport.js, a popular authentication middleware for Node.js, and how to use Prisma ORM to handle database operations in a type-safe and efficient manner.
The session will be conducted by experienced developers who have worked with these technologies and will be able to provide valuable insights and best practices. The session will be interactive and include plenty of opportunities for attendees to ask questions and work on real-world projects.
Develop skills to prepare for installing, configuring and performing ongoing maintenance of a Microsoft Exchange Server 2013 infrastructure.
Help prepare for certification exam 70-341.
Learn best practices.
Integration and Batch Processing on Cloud FoundryJoshua Long
This talk explores the new possibilities for scale by using Spring Integration, Spring Batch and RabbitMQ on Cloud Foundry, the open source PaaS from VMWare.
Develop skills to prepare for installing, configuring and performing ongoing maintenance of a Microsoft Exchange Server 2013 infrastructure.
Help prepare for certification exam 70-341.
Learn best practices.
This article tries to demystify HTTP, "servlet", "web server", "application server", "servlet container" and gives the fundamentals of the Java Servlet API (that comes with the J2EE SDK).
Dịch vụ : Thiết kế website (http://www.web360.com.vn/) - Dịch vụ thiết kế web khách sạn (http://web360.com.vn/Thiet-ke-Web-khach-san.html)
Web360 công ty thiết kế web với nhiều năm kinh nghiệm , chúng tôi cung cấp các giải pháp dành cho những khách hàng có nhu cầu xây dựng website để đẩy mạnh công việc kinh doanh, mở rộng các kênh bán hàng, tăng cường khả năng giao tiếp với khách hàng hoặc muốn khẳng định đẳng cấp hoặc thương hiệu của công ty.
Thiết kế web giá rẻ nhất đà nẵng(http://web360.com.vn/Thiet-ke-web-gia-re-da-nang.html)
DỊCH VỤ THIẾT KẾ WEB CHUYÊN NGHIỆP CỦA CHÚNG TÔI NHƯ SAU :
1. Giao diện website được thiết kế đẹp mắt, chuyên nghiệp.
2. Website được nghiên cứu kỹ các đối tượng khách hàng, phân tích nhu cầu, thói quen và hành vi của họ khi duyệt web để xây dựng các chức năng và nội dung phù hợp nhằm biến họ trở thành khách hàng thực sự của bạn.
3. Nghiên cứu rất kỹ các đối thủ cạnh tranh của bạn trên mạngi internet và sẽ tư vấn cho bạn cách để bạn vượt qua họ.
4. Các chuyên gia của chúng tôi cũng sẽ tư vấn cho bạn cách viết nội dung và sử dụng những từ khóa có giá trị nhằm thu hút và giữ chân khách hàng, đồng thời tạo thiện cảm cho các công cụ tìm kiếm.
5. Tối ưu hóa công cụ tìm kiếm chuẩn SEO google
Liên hệ với chúng tôi để được tư vấn thiết kế web tại Đà Nẵng tận tình nhất !
Thiet ke web da nang - Cong ty thiet ke web tai da nang (http://web360.com.vn/Thiet-ke-web-Da-Nang.html)
Liên hệ : 090.52.52.360 - 0905.595.360(Mr Hoàng)
Email : info@web360.com.vn (info@web360.com.vn)
Website : www.web360.com.vn (http://web360.com.vn/)
Địa chỉ : 44 Ngô Chi Lan - Q.Hải Châu - TP.Đà Nẵng
Chúng tôi luôn nỗ lực đem lại cho khách hàng những sản phẩm và dịch vụ tốt nhất !
dịch vụ,thiết kế,thiết kế web,chuyên nghiệp,dịch vụ thiết kế,dịch vụ thiết kế web đà nẵng
This session will provide attendees with hands-on experience and in-depth knowledge of using Node.js as a runtime environment and Express.js as a web framework to build scalable and fast backend systems. Additionally, attendees will learn about Passport.js, a popular authentication middleware for Node.js, and how to use Prisma ORM to handle database operations in a type-safe and efficient manner.
The session will be conducted by experienced developers who have worked with these technologies and will be able to provide valuable insights and best practices. The session will be interactive and include plenty of opportunities for attendees to ask questions and work on real-world projects.
The aim of the presentation is to give readers the framework to think about building the rest APIs right. It starts with describing the need for APIs, what REST APIs are and how are they different from general web APIs. Furthermore, it explains how HTTP and REST play together to build the overall solution and HTTP best practices to be followed when designing REST APIs. It then outlines, some of the basic features / functionality to expect from properly designed REST API system.
DN 2017 | Big Data / Microservice Versioning | Thomas Pötter | Compris Techno...Dataconomy Media
Similar to the CAP trade-off (Consistency – Availability – Partition-Tolerance), this presentation demonstrates the C(A/P)S trade-off for protocol/data versioning which stands for the trade-off between the goals of Code amount (low), Availability/Performance and Storage (low) which can be achieved through lazy/eager migration or by creating multiple converters. This presentation then shows best practices for versioning and how the trade-off can be solved. A switchboard pattern is presented, which permits the use of different versions in parallel.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSEDuvanRamosGarzon1
AIRCRAFT GENERAL
The Single Aisle is the most advanced family aircraft in service today, with fly-by-wire flight controls.
The A318, A319, A320 and A321 are twin-engine subsonic medium range aircraft.
The family offers a choice of engines
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Pinterest like site using REST and Bottle
1. CMPE 275
Project 2 Report
RESTful social collaboration through Pinterest re-enactment
Team:
Bhushan Deo (009269403)
Deven Pawar (009275994)
Dhruv Gogna (005067284)
Gaurav Bhardwaj (009297431)
Vinay Bhore (009290931)
2. Introduction
The main goal of Project 2 is to explore the design and challenges in developing RESTful web services for
a social media service such as Pinterest. Sharing content is an important pattern found in all social media
services. Providing robust and well documented web services is very important in such products as there
are several external clients which use them to access and manipulate stored user data. In this report, we
provide a detailed explanation of our team’s design and implementation.
High Level Architecture
The team’s configuration consists of the following components:
1. Web Services:
We expose our functionality to the client using RESTful web services written in Python using the
Bottle micro-framework.
2. Database:
CouchDB NoSQL database is used to persist user data. It provides data storage as JSON
documents and thus naturally maps to the requirements. Also, when client hits our web service
and some data is changed, we can verify changes in the database through the web interface
(Futon), that comes with CouchDB.
3. couchdb-python library:
This library provides interface to interact with CouchDB from python code. In our experience,
this was a very well designed library with advanced features like high-level couchDB document
to python object mapping, intuitive interfaces and good documentation.
4. Client:
For testing, we are using curl to hit our web services and see the response. Curl provides many
advanced options to make testing via HTTP requests easy.
The following sections explain the functionalities implemented and the web service and database
component in detail. These include comments about what we learnt while working on each component.
3. Functionalities
This project also required cross team interaction to come up with a stable specification for the web
services. As per the specification agreed to by the class, following functionalities were implemented by
our team.
Here, we observed how the traditional Create, Read, Update and Delete operations in databases, map
exactly to HTTP methods POST, GET, PUT and DELETE respectively.
Functionality Endpoint (fields in angular brackets are generated on the
server)
CRUD? HTTP
Met-
hod
Request
Parameters (all
are string type
unless specified)
Sign up http://localhost:8080/users/signUp Create POST firstName
lastName
emailId
password
Login http://localhost:8080/users/login/ Create POST emailId
password
Create a
board
http://localhost:8080/users/<userId>/boards/ Create POST boardName
boardDesc
category
isPrivate(Boolean)
Get all
boards
http://localhost:8080/users/<userId>/boards/ Read GET None
Get details of
a single
board
http://localhost:8080/users/<userId>/boards/<boardId>/ Read GET None
Update
Board
http://localhost:8080/users/<userId>/boards/<boardId>/ Update PUT boardName
boardDesc
category
isPrivate(Boolean)
Delete Board http://localhost:8080/users/<userId>/boards/<boardId>/ Delete DELETE None
Create Pin http://localhost:8080/users/<userId>/boards/<boardId>/p
ins/
Create POST pinName
image
description
Get a single
pin from a
board
http://localhost:8080/users/<userId>/boards/<boardId>/p
ins/<pinId>/
Read GET None
Get all pins
from a board
http://localhost:8080/users/<userId>/boards/<boardId>/p
ins/
Read GET None
Update a pin http://localhost:8080/users/<userId>/boards/<boardId>/p
ins/<pinId>/
Update PUT pinName
image
description
Delete a pin http://localhost:8080/users/<userId>/boards/<boardId>/p
ins/<pinId>/
Delete DELETE None
Add a
comment to
a pin
http://localhost:8080/users/<userId>/boards/<boardId>/p
ins/<pinId>/comment/
Create POST description
View
comments
on a pin
http://localhost:8080/users/<userId>/boards/<boardId>/p
ins/<pinId>/comment/
Read GET None
4. The responses were returned in JSON format and contained relevant data and endpoint information for
subsequent operations as agreed to by the class.
Web Services
Why Web Services fit in this project?
Essentially, web services help de-couple the client and the server implementations. User performs
various CRUD operations on an external system by sending HTTP requests through the client. The web
service layer, intercepts these requests on the server, performs operations on the database and sends
back appropriate response to the client. This fits well with the sharing and collaboration required by
social media products. From real world examples such as Facebook, Twitter and Pinterest, it can be seen
that a robust and well documented RESTful API is a vital contributor to these products going viral.
Bottle:
Web services were written in Python using the Bottle micro-framework. We found Bottle to be very
intuitive for creating our web services. The framework is very lightweight and in order to use it, it only
requires us to include one bottle.py file in the project directory.
Server:
Bottle runs by default on a single threaded WSGI server, but has adapters to various multi-threaded
servers such as paste and Cherrypy which give better performance for applications that need to handle
large number of concurrent requests. For testing this project, we have used the default server.
Mapping requests to appropriate methods:
Various endpoints as mentioned in the functionalities section, map easily to corresponding methods
which process the requests at those endpoint, simply by placing a @route decorator above that method.
Retrieving data from request:
In REST, the URL path determines the data that will be accessed or manipulated and the HTTP method
determines the operation that will be performed on that data.
- To get information about data that will be accessed, we use wildcards in the URL:
@route(‘http://localhost:8080/users/<userId>/boards/<boardId>/’,method=’GET’)
def getBoard(userId, boardId):
# got userId and boardId from the URL, now perform GET(read) on database
- To retrieve data from the HTTP request, bottle provides convenient methods in the request object:
@route(‘http://localhost:8080/users/<userId>/boards/<boardId>/’,method=’PUT’)
def updateBoard(userId, boardId):
# got userId and boardId from the URL, now perform PUT(update)on database
# with the fields sent in the request by the client
boardName = request.forms.get('boardName')
boardDesc = request.forms.get('boardDesc')
Returning JSON response:
JSON was the decided as the format in which response will be sent back to the client. Even in this case,
Bottle made it easy to return back response with “application/json” content type. We simply had to
5. return a python dictionary object. Bottle returns the response in JSON and the appropriate field is set in
the HTTP header.
@route(‘http://localhost:8080/users/<userId>/boards/<boardId>/’,method=’PUT’)
def updateBoard(userId, boardId):
# perform appropriate operations
return dict(status='OK', message='sample message')
If other response types such as html or xml are expected by the client, we are aware that we would have
to check for the content types which the client accepts from the HTTP request header and accordingly
format the response before sending it back (content negotiation).
Handling trailing ‘/’ slash:
If some clients put a trailing slash at the end of the endpoint URL, then that is treated as a separate
route by Bottle and might not map to the appropriate method in our web service code. Given that we
would be testing across teams, this was highly probable. To handle this, Bottle documentation suggests
to simply map two routes to the same method, one with a trailing slash and one without a slash.
@route(‘http://localhost:8080/users/<userId>/boards/<boardId>/’,method=’PUT’)
#No trailing slash
@route(‘http://localhost:8080/users/<userId>/boards/<boardId>’,method=’PUT’)
def updateBoard(userId, boardId):
# perform appropriate operations
Database
In REST web services, we can think of the URL as a path that is traversed to get to the data that is to be
accessed or manipulated. Further, the HTTP method that is specified in the HTTP request gives us the
operation (create, read, update or delete) that is to be performed on the data. Accordingly the actions
that we take in code depend on the combination of the following factors:
1. Response format accepted by the client (json, xml, html, image, etc..)
2. Data that is to be accessed (URL traversal)
3. What kind of operation on the data (HTTP method type)
Thus, for every endpoint there are several combinations that need to be handled so that we process the
user request appropriately and so that we return desired response back to the user. In this context, it is
clear that we have to organize our data based on the endpoints that we expose to the user.
We observed that this is a notable difference compared to Project 1, where there was only one endpoint
for the client, and the server queue delegated the message to the appropriate resource to handle. In
Project 2, there are several endpoints for the client and each endpoint maps to one method on the server
side.
The flat schema that we have used to store data in CouchDB is as follows. The “_id” is the userId that is
generated server side when the user signs up. This is passed around in each URL and is used to identify
user in each subsequent request.
7. Drawback:
The limitation of this schema is that for any request, we get the entire complex document associated
with a userId from the database. Then, in case of long URLs we have to employ multiple nested loops to
get to the data that we require. For example, updating information about a pin needs three nested
loops through the document that is returned. This is shown in the figure above. This would be
problematic if a user had thousands of boards and pins.
A solution to this would be to create separate tables (“databases” in CouchDB) for each step in the
endpoint URL tree, i.e. separate tables for user, board and comments, each record containing reference
to the userId. However, the tradeoff here is that this would require more queries to the database per
user request.
Note on Aerospike:
Initially we decided on using Aerospike as our database. However, its Python client seems to be under
development and there was no support for list and map data structures. Further, there was no query
support in the Python client, only full table scan was supported. Hence we decided to go with CouchDB.
Nonetheless, it was interesting to understand Aerospike’s architecture and concepts such as location
awareness of client, peer relationship among nodes, use of binary wire protocol for communication and
cross data center replication.
Conclusion
For our team, following are the major learnings from this project:
1. Programming in Python
2. RESTful web services
3. Database design for RESTful web services
4. Micro-frameworks
5. Comparison of technologies used in Project 1 and 2
6. CouchDB and Aerospike
7. Collaboration in Small and Large Software Development Teams