# US 10,956,250 B1 · Database interface to obtain item state on conditional operation failure

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,956,250 B1
- Document ID: US10956250B1
- Status: Granted
- Kind: B1
- Application number: 16/364,045
- Filed: 2019-03-25
- Granted: 2021-03-23
- Earliest claimed: 2019-03-25
- Assignees: Amazon Technologies, Inc.
- Applicants: Amazon Technologies, Inc.
- Inventors: Akshat Vig; Rashmi Krishnaiah Setty; Joon Ahn; Somasundaram Perianayagam; Fahad Ahmed; Kapil Singh; Stefano Stefani; Vaibhav Jain
- Web page: https://patentgrep.com/patent/US10956250B1

## CPC

- G06F 11/0775: {Content or structure details of the error report, e.g. specific table structure, specific error fields}
- G06F 11/0769: {Readable error formats, e.g. cross-platform generic formats, human understandable formats}
- G06F 11/0781: {Error filtering or prioritizing based on a policy defined by the user or on a policy defined by a hardware/software module, e.g. according to a severity level}
- G06F 16/1774: {Locking methods, e.g. locking methods for file systems allowing shared and concurrent access to files}
- G06F 16/86: {Mapping to a database}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods are provided to implement a database system configured to return the state of a data item upon failure of a condition check on the data item during a conditional write. In embodiments, a write request may specify an indicator to return the item state upon condition failure. The request may specify multiple database operations to execute as a transaction, where failure of a single condition check will cause the entire transaction to fail and an item state causing the failure to be returned. The returned state of the data item may include a selection of the item's attributes specified by the request. Advantageously, these features allow a client to easily obtain the precise cause of a write's failure. Moreover, because the item state is returned only when a conditional write fails and only when requested, the response size of most write requests remains unchanged.

## Claims

### Claim 1

A system comprising:
a database system implemented by one or more computers, configured to:
provide a transaction interface configured to accept requests to execute transactions on a database, the requests specifying:
(a) a set of one or more operations to execute for one or more respective data items, wherein the set of one or more operations in the requests are to be executed atomically on a consistent state of the database,
(b) at least one condition for at least one of the one or more operations, wherein execution of the one operation is dependent on the one condition, and
(c) at least one failure state return (FSR) indicator, wherein the FSR indicator indicates whether to return an item state of at least one of the one or more data items upon failure of the one condition;
responsive to a request for a transaction received via the transaction interface, and as part of execution of the transaction:
determine that a data item associated with an operation specified in the request fails a condition specified for the operation;
determine whether an FSR indicator associated with the operation is set;
generate an error response for the request indicating failure of the condition, wherein the error response includes an item state of the data item if the FSR indicator is set, and does not include item state if the FSR indicator is not set; and
return the error response via the transaction interface.

### Claim 2 (depends on 1)

The system of claim 1, wherein:
the transaction interface is configured to accept transaction requests that specify a subset of attributes of the data item to return as the item state; and
to generate the error response, the database system is configured to include values of the subset of attributes of the data item as the item state, but not values of other attributes of the data item not in the subset.

### Claim 3 (depends on 1)

The system of claim 1, wherein the transaction interface is configured to accept transaction requests that specify a plurality of FSR indicators for respective ones of a plurality of conditions.

### Claim 4 (depends on 1)

The system of claim 1, wherein database system is configured to lock all data items to be read or written by the request during execution of the transaction, wherein the locking prevents the data item from being changed by operations outside the transaction.

### Claim 5 (depends on 1)

The system of claim 1, wherein database system is configured to:
verify with an identity and access management (IAM) system that a client that issued the request has a permission to receive the item state of the data item, wherein the permission is distinct from a write permission for the data item, and wherein the database system is configured to not return the item state of the data item if the permission is not verified.

### Claim 6

A computer-implemented method, comprising:
performing, by a database system:
receiving, via an interface of the database system, a request to read or write one or more data items in a database, wherein the request specifies (a) a condition for an operation on a data item, and (b) a failure state return (FSR) indicator indicating whether to return an item state of the data item upon a failure of the condition;
responsive to the request and during execution of the request:
determining that the data item associated with the operation fails the condition;
determining that the FSR indicator is set;
generating an error response for the request indicating the failure of the condition, wherein the error response is generated to include the item state of the data item based at least in part on the determination that the FSR indicator is set; and
returning the error response via the interface.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
receiving a second request via the interface, wherein the second request specifies a second condition on a second data item;
determining that the second data item fails the second condition;
determining that a second FSR indicator associated with the second request is not set; and
generating and returning a second error response indicating the failure of the second condition, wherein the second error response is generated to not include the item state of the second data item based at least in part on the determination that the second FSR indicator is not set.

### Claim 8 (depends on 6)

The method of claim 6, wherein the database system is hosted on computing resources operated by a network-accessible service provider network, and the interface is a web service interface.

### Claim 9 (depends on 6)

The method of claim 6, wherein the database system is a non-relational database system and the interface is a non-relational database interface.

### Claim 10 (depends on 6)

The method of claim 6, wherein:
the request specifies a subset of attributes of the data item to return as the item state; and
generating the error response comprises including values of the subset of attributes of the data item as the item state, but not values of other attributes of the data item not in the subset.

### Claim 11 (depends on 6)

The method of claim 6, wherein:
the request specifies a subset of attributes of the data item to evaluate for the condition; and
generating the error response comprises including values of the subset of attributes of the data item as the item state, but not values of other attributes of the data item not in the subset.

### Claim 12 (depends on 6)

The method of claim 6, wherein:
the request specifies a transaction including a plurality of operations to be executed atomically on a consistent state of the database;
execution of at least some of the operations is dependent on respective conditions specified in the request; and
at least some of the conditions are specified with respective FSR indicators that indicate whether to return respective item states upon condition failure.

### Claim 13 (depends on 6)

The method of claim 6, wherein:
the request specifies a check operation to check a particular condition of a particular data item without writing any data items; and
the particular condition is associated with a particular FSR indicator that indicate whether to return a particular item state upon the failure of the particular condition.

### Claim 14 (depends on 12)

The method of claim 12, further comprising performing, by the database system:
evaluating the request to verify that the transaction does not include multiple operations that write a single data item, wherein detection of multiple operations that write a single data item causes the database system to fail the transaction.

### Claim 15 (depends on 12)

The method of claim 12, further comprising performing, by the database system:
locking all data items to be read or written by the request during execution of the transaction, wherein the locking prevents the data item from being changed by operations outside the transaction.

### Claim 16 (depends on 6)

The method of claim 6, further comprising performing, by the database system:
verifying with an access management system that a client that issued the request has a permission to receive the item state of the data item, where the permission is distinct from a write permission for the data item, and wherein the database system is configured to not return the item state of the data item if the permission is not verified.

### Claim 17

One or more non-transitory computer-accessible storage media storing program instructions that when executed on or across one or more processors of a database system cause the database system to:
receive, via an interface of the database system, a request to read or write one or more data items in a database, wherein the request specifies (a) a condition for an operation on a data item, and (b) a failure state return (FSR) indicator indicating whether to return an item state of the data item upon a failure of the condition;
responsive to the request and during execution of the request:
determine that the data item associated with the operation fails the condition;
determine that the FSR indicator is set;
generate an error response for the request indicating the failure of the condition, wherein the error response is generated to include the item state of the data item based at least in part on the determination that the FSR indicator is set; and
return the error response via the interface.

### Claim 18 (depends on 17)

The non-transitory computer-accessible storage medium of claim 17, wherein:
the request specifies a transaction including a plurality of operations to be executed atomically on a consistent state of the database;
execution of at least some of the operations is dependent on respective conditions specified in the request; and
at least some of the conditions are specified with respective FSR indicators that indicate whether to return respective item states upon condition failure.

### Claim 19 (depends on 18)

The non-transitory computer-accessible storage medium of claim 18, wherein the program instructions when executed cause the database system to:
lock all data items to be read or written by the request during execution of the transaction, wherein the locking prevents the data item from being changed by operations outside the transaction.

### Claim 20 (depends on 17)

The non-transitory computer-accessible storage medium of claim 17, wherein the program instructions when executed cause the database system to:
verify with an access management system that a client that issued the request has a permission to receive the item state of the data item, where the permission is distinct from a write permission for the data item, and wherein the database system is configured to not return the item state of the data item if the permission is not verified.
