Configuring REST-assured for Amazon API Gateway

As part of testing our Amazon API Gateway deployment, we set up JUnit tests to run automated Swagger/OpenAPI validation using Swagger Request Validator and REST-assured. This allows us to write simple tests in a fluent style, with automatic validation that requests and responses match the Swagger API specification deployed to API Gateway. given() .log().all() .filter(validationFilter) .when() .post("/oauth2/token") .then() .assertThat() .statusCode(200); Out of the box, REST-assured does not work with Amazon’s API Gateway endpoints using Java 8. Attempting to use it results in a handshake error when connecting to the API Gateway endpoint. ...

December 13, 2016 · 2 min · Kevin Sookocheff

Paper Review: Robust Query Processing through Progressive Optimization

Title and Author of Paper Robust Query Processing through Progressive Optimization. Markl et al. Summary Traditional query optimizers choose an execution plan for a query by using estimates of current database statistics. However, these estimates may be inaccurate, leading to overly expensive query plans being chosen and executed. This paper presents progressive query optimization, allowing query execution to detect and recover from estimation errors during processing. During each execution step, progressive query optimization (POP) detects differences between the cardinality of the currently processed tuple and compares that to the estimated cardinality that was used to define the original execution plan. If those cardinalities differ enough, POP will re-optimize the query using updated estimates of cardinality. Any materialized views already computed can be reused during the re-execution step. ...

November 18, 2016 · 3 min · Kevin Sookocheff

Creating a Service Oriented Organization

The decision to build products using a service-oriented (or microservice) architecture has enormous technical and organizational impact that is reflected in everything from how teams write code, to how they communicate, to how the organization itself is structured. Given the breadth and depth of impact this decision has, it pays to reflect on why an organization chooses a service oriented architecture, how an organization can support such an architecture, and how teams and individuals can support the organization in successfully adopting a service oriented platform. ...

October 30, 2016 · 6 min · Kevin Sookocheff

Understanding API Gateway Payload Mappings

Amazon’s API Gateway provides the facilities to map an incoming request’s payload to match the required format of an integration backend. API Gateway Payload Mapping API Gateway uses the concept of “models” and “mapping templates” to specify the mapping between the client payload and the server payload. Models A model defines the structure of the incoming payload using JSON Schema. The model is an optional, but not required, piece of API Gateway. By providing a model, you make it easier to define the upcoming mapping template that actually does the transformation between the client and server. ...

October 21, 2016 · 6 min · Kevin Sookocheff

Securing a Swagger API with OAuth2

In our previous article on Swagger, we defined a Player API modelling GET access to a Player resource. In this article, I show how to use Swagger’s security models to to deploy this API using an OAuth2 configuration. Swagger handles authentication and authorization using a combination of a “Security Definitions” Object and a list of “Security Requirements” Objects. Each of these definitions are applied at the top-level of your Swagger specification. ...

October 19, 2016 · 3 min · Kevin Sookocheff

How to deploy a Swagger specification to Amazon API Gateway using CloudFormation

Full sample code for this article is available on Github. Aamazon’s API Gateway supports the direct importing of Swagger specification files using CloudFormation rules. To do this, you have two choices. Injecting the swagger.json or swagger.yaml file directly into the Body field of the CloudFormation template, or uploading the swagger.json or swagger.yaml file to an S3 location and setting that location as the BodyS3Location field of the CloudFormation template. A minimal YAML template is listed below: ...

October 18, 2016 · 3 min · Kevin Sookocheff

Designing a Swagger API

The goal of Swagger is to define a standard interface for describing REST APIs. In an ideal world, a Swagger definition for your API will allow both humans and computers to discover and understand your API. At it’s core, Swagger is a formal specification of an API. Surrounding this specification are a wide swath of tools to support creating documentation, providing client libraries, and managing API deployments. One of Swagger’s original goal was to provide a way to document an API in both a human and machine readable way. Swagger provides such a documentation format for RESTful APIs. By augmenting this documentation format with tools for API clients and developers, Swagger grew into an ecosystem providing for API developers and consumers. ...

October 12, 2016 · 6 min · Kevin Sookocheff

What is OSGi? Microservices for the JVM

As someone who is being recently re-introduced to the Java platform, there are a lot of components and pieces to become familiar with. One of those pieces is OSGi, a service registry and deployment specification for Java apps. The OSGi specification describes a complete environment for running Java applications as components. Each component is a bundle that can be remotely installed, started, stopped, updated or uninstalled. In addition, OSGi provides a service registry that allows existing services to detect the addition or removal of other services and adapt accordingly. ...

October 11, 2016 · 2 min · Kevin Sookocheff

Paper Review: The Volcano Optimizer Generator: Extensibility and Efficient Search

Title and Author of Paper The Volcano Optimizer Generator: Extensibility and Efficient Search. Goetz Graefe and William J. McKenna. Summary The query optimizer’s job is to take user input in the form of SQL and generate a cost-efficient plan for satisfying that query using the underlying physical layout of the database. This paper describes Volcano, a system for taking a data model, logical algebra, physical algebra, and optimization rules and translating them into optimizer source code. ...

October 11, 2016 · 3 min · Kevin Sookocheff

Paper Review: Dynamo: Amazon’s Highly Available Key-value Store

Title and Author of Paper Dynamo: Amazon’s Highly Available Key-value Store, DeCandia et al. Summary Dynamo, as the title of the paper suggests, is Amazon’s highly available key-value storage system. Dynamo only supports primary-key access to data, which is useful for services such as shopping carts and session management. Dynamo’s use case for these services is providing a highly-available system that always accepts writes. This requirement forces the complexity of conflict resolution to data readers. Writes are never rejected. ...

October 7, 2016 · 2 min · Kevin Sookocheff