# Using Layers

**URL:** https://forums.foundationdb.org/c/using-layers/14.md?page=2

[Latest](https://forums.foundationdb.org/latest.md) · [Categories](https://forums.foundationdb.org/categories.md) · [Tags](https://forums.foundationdb.org/tags.md)

**Page:** 3

---

## [Key-val sizes in the Record Layer](https://forums.foundationdb.org/t/key-val-sizes-in-the-record-layer/1481)

<div class="topic-metadata">

**Author:** [@amarjeet000](https://forums.foundationdb.org/u/amarjeet000)\
**Replies:** 4\
**Last updated:** [July 15, 2020, 12:46pm UTC](https://forums.foundationdb.org/t/key-val-sizes-in-the-record-layer/1481 "2020-07-15T12:46:20Z")

</div>

The Record Layer paper says the following: To avoid exposing FoundationDB’s limits on key and value sizes to clients, the Record Layer splits large records across a set of contiguous keys and splices them back together …

---

## [Wrong rank index when concurrently adding records](https://forums.foundationdb.org/t/wrong-rank-index-when-concurrently-adding-records/2185)

<div class="topic-metadata">

**Author:** [@iamquang95](https://forums.foundationdb.org/u/iamquang95)\
**Replies:** 1\
**Last updated:** [June 16, 2020, 5:48pm UTC](https://forums.foundationdb.org/t/wrong-rank-index-when-concurrently-adding-records/2185 "2020-06-16T17:48:31Z")

</div>

There are some unexpected behaviors of rank indexing when adding records concurrently. I’m having a record that has rank index. When i try to adding multiple records concurrently, there is something wrong with ranking. I…

---

## [Split long record causes conflict with other record](https://forums.foundationdb.org/t/split-long-record-causes-conflict-with-other-record/2160)

<div class="topic-metadata">

**Author:** [@iamquang95](https://forums.foundationdb.org/u/iamquang95)\
**Replies:** 3\
**Last updated:** [June 10, 2020, 6:04pm UTC](https://forums.foundationdb.org/t/split-long-record-causes-conflict-with-other-record/2160 "2020-06-10T18:04:42Z")

</div>

I have two records message SampleEntityName { string entity\_id = 1; string name = 2; } message SampleEntityNumber { string entity\_id = 1; int32 number = 2; } The SampleE…

---

## [Multiple questions about Indexes, functions and watches to implement etcd-layer](https://forums.foundationdb.org/t/multiple-questions-about-indexes-functions-and-watches-to-implement-etcd-layer/2047)

<div class="topic-metadata">

**Author:** [@PierreZ](https://forums.foundationdb.org/u/PierreZ)\
**Replies:** 7\
**Last updated:** [June 3, 2020, 6:21am UTC](https://forums.foundationdb.org/t/multiple-questions-about-indexes-functions-and-watches-to-implement-etcd-layer/2047 "2020-06-03T06:21:53Z")

</div>

Hi everyone! After playing with the FDB Operator, I decided to play a bit with the record-layer by developing an ETCD layer. My goal is to see how far I can go using the record-layer without using a fdb-client directly. …

---

## [How to update a field that is part of the primary key](https://forums.foundationdb.org/t/how-to-update-a-field-that-is-part-of-the-primary-key/2121)

<div class="topic-metadata">

**Author:** [@legilimen](https://forums.foundationdb.org/u/legilimen)\
**Replies:** 1\
**Last updated:** [May 21, 2020, 12:30am UTC](https://forums.foundationdb.org/t/how-to-update-a-field-that-is-part-of-the-primary-key/2121 "2020-05-21T00:30:52Z")

</div>

In my application am using Record layer. I have a use case where I want to update my primary key. My primary key is made up of three fields \[CATEGORY, TYPE, VALUE\]. My existing record is \[C1,T1,V1\]. I want to modify thi…

---

## [Record Layer query performance benchmarking against traditional RDBMS](https://forums.foundationdb.org/t/record-layer-query-performance-benchmarking-against-traditional-rdbms/2082)

<div class="topic-metadata">

**Author:** [@rahul-nitkkr](https://forums.foundationdb.org/u/rahul-nitkkr)\
**Replies:** 3\
**Last updated:** [April 22, 2020, 3:51pm UTC](https://forums.foundationdb.org/t/record-layer-query-performance-benchmarking-against-traditional-rdbms/2082 "2020-04-22T15:51:53Z")

</div>

I’ll start-off with a disclaimer that I know it is not an apples to apples comparison between FDB(with Record Layer) and a RDBMS like DB2 for eg, i just want to understand what kind of performance i should expect. Back…

---

## [Common Functionality Toolkit](https://forums.foundationdb.org/t/common-functionality-toolkit/2058)

<div class="topic-metadata">

**Author:** [@janderland](https://forums.foundationdb.org/u/janderland)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 9:31pm UTC](https://forums.foundationdb.org/t/common-functionality-toolkit/2058 "2020-04-14T21:31:09Z")

</div>

Has anyone considered starting a FDB toolkit library? Perhaps abstracting some of the patterns found in the design recipes? It’s been on the back of my mind for a while. Wanted to look into the usefulness of something …

---

## [Querying a non-string value](https://forums.foundationdb.org/t/querying-a-non-string-value/1807)

<div class="topic-metadata">

**Author:** [@marko.cacic](https://forums.foundationdb.org/u/marko.cacic)\
**Replies:** 3\
**Last updated:** [April 1, 2020, 7:45am UTC](https://forums.foundationdb.org/t/querying-a-non-string-value/1807 "2020-04-01T07:45:29Z")

</div>

Hi there, I have a protocol buffer file looking something like this: message NotificationMessageEntity { string notificationId = 1; NotificationType type = 2; string receiverId = 3; string message = 4; …

---

## [FunctionKeyExpression is not honored when evaluating the QueryPlan](https://forums.foundationdb.org/t/functionkeyexpression-is-not-honored-when-evaluating-the-queryplan/1937)

<div class="topic-metadata">

**Author:** [@rahul-nitkkr](https://forums.foundationdb.org/u/rahul-nitkkr)\
**Replies:** 8\
**Last updated:** [March 4, 2020, 6:45am UTC](https://forums.foundationdb.org/t/functionkeyexpression-is-not-honored-when-evaluating-the-queryplan/1937 "2020-03-04T06:45:04Z")

</div>

FunctionKeyExpression don’t seem to be honored in the evaluation of a query plan. We came across a test casewhich exposes this . Is there any plan to make FunctionKeyExpressions allowed to be picked for indexes ? Are…

---

## [Full range scan performed in sort when not required](https://forums.foundationdb.org/t/full-range-scan-performed-in-sort-when-not-required/1995)

<div class="topic-metadata">

**Author:** [@aymalik](https://forums.foundationdb.org/u/aymalik)\
**Replies:** 3\
**Last updated:** [March 3, 2020, 10:16am UTC](https://forums.foundationdb.org/t/full-range-scan-performed-in-sort-when-not-required/1995 "2020-03-03T10:16:53Z")

</div>

Hi there, I noticed that the Record Layer planner performs a full range scan where it isn’t required. A record of type R with primary key k was queried using the query below. RecordQuery.newBuilder() .setRecor…

---

## [Range scan not being truncated by primary key filter when an additional Or component present in And component](https://forums.foundationdb.org/t/range-scan-not-being-truncated-by-primary-key-filter-when-an-additional-or-component-present-in-and-component/1996)

<div class="topic-metadata">

**Author:** [@aymalik](https://forums.foundationdb.org/u/aymalik)\
**Replies:** 2\
**Last updated:** [March 3, 2020, 10:11am UTC](https://forums.foundationdb.org/t/range-scan-not-being-truncated-by-primary-key-filter-when-an-additional-or-component-present-in-and-component/1996 "2020-03-03T10:11:33Z")

</div>

Hi, For records of type Order as defined below, I want to be able to truncate the total sorted range of records scanned by passing a filter on the primary key but record layer doesn’t seem to allow that when an addition…

---

## [Creating an index on a repeated nested field](https://forums.foundationdb.org/t/creating-an-index-on-a-repeated-nested-field/1988)

<div class="topic-metadata">

**Author:** [@dmitrig01](https://forums.foundationdb.org/u/dmitrig01)\
**Replies:** 1\
**Last updated:** [March 2, 2020, 12:30pm UTC](https://forums.foundationdb.org/t/creating-an-index-on-a-repeated-nested-field/1988 "2020-03-02T12:30:07Z")

</div>

Hi! I have the following record definition: message TopLevel { repeated Nested nested = 1; } message Nested { optional string val = 1; } How do I create an concat index on TopLevel’s nested.val? I.e., if I had a r…

---

## [Number types in Tuples may not be null | Reverse scan](https://forums.foundationdb.org/t/number-types-in-tuples-may-not-be-null-reverse-scan/1912)

<div class="topic-metadata">

**Author:** [@VibhutiD](https://forums.foundationdb.org/u/VibhutiD)\
**Replies:** 3\
**Last updated:** [February 20, 2020, 2:50pm UTC](https://forums.foundationdb.org/t/number-types-in-tuples-may-not-be-null-reverse-scan/1912 "2020-02-20T14:50:37Z")

</div>

Hi, I am facing a certain error while doing a reverse scan namely “java.lang.NullPointerException: Number types in Tuples may not be null”. Repro : message order { int64 order\_id = 1; int32 price = 2:} message differe…

---

## [Creating secondary index on data within a Map](https://forums.foundationdb.org/t/creating-secondary-index-on-data-within-a-map/1910)

<div class="topic-metadata">

**Author:** [@samitsawant](https://forums.foundationdb.org/u/samitsawant)\
**Replies:** 3\
**Last updated:** [January 27, 2020, 9:21pm UTC](https://forums.foundationdb.org/t/creating-secondary-index-on-data-within-a-map/1910 "2020-01-27T21:21:25Z")

</div>

Hi, I am completely new to Foundation DB and Record layer. I was trying to understand secondary indexes through the existing documentation. I am curious to know how would be index a data which is unknown before hand. F…

---

## [Record layer saveRecord fails with \*\*\*java.util.concurrent.ExecutionException: com.apple.foundationdb.record.RecordCoreException: Expected only a single key extension for split record\*\*\*](https://forums.foundationdb.org/t/record-layer-saverecord-fails-with-java-util-concurrent-executionexception-com-apple-foundationdb-record-recordcoreexception-expected-only-a-single-key-extension-for-split-record/1887)

<div class="topic-metadata">

**Author:** [@rahul-nitkkr](https://forums.foundationdb.org/u/rahul-nitkkr)\
**Replies:** 3\
**Last updated:** [January 22, 2020, 5:17pm UTC](https://forums.foundationdb.org/t/record-layer-saverecord-fails-with-java-util-concurrent-executionexception-com-apple-foundationdb-record-recordcoreexception-expected-only-a-single-key-extension-for-split-record/1887 "2020-01-22T17:17:40Z")

</div>

Record layer We’re seeing intermittent exceptions when using record layer to persist records using ‘saveRecord/async’ since upgrading to 2.8.91. Debugging the issue, it appears that the unpackKey happening during the F…

---

## [Confusing error when using FDBMetaDataStore](https://forums.foundationdb.org/t/confusing-error-when-using-fdbmetadatastore/1818)

<div class="topic-metadata">

**Author:** [@max](https://forums.foundationdb.org/u/max)\
**Replies:** 7\
**Last updated:** [December 7, 2019, 4:32pm UTC](https://forums.foundationdb.org/t/confusing-error-when-using-fdbmetadatastore/1818 "2019-12-07T16:32:39Z")

</div>

I have a basic FDBRecordStore that is instantiated like so: var metadata: RecordMetaDataBuilder = RecordMetaData .newBuilder() .setRecords(fileDescriptor) val recordType = session.metadata.getRecordType("User") …

---

## [Basic Record Layer query performance and caching strategies](https://forums.foundationdb.org/t/basic-record-layer-query-performance-and-caching-strategies/1801)

<div class="topic-metadata">

**Author:** [@max](https://forums.foundationdb.org/u/max)\
**Replies:** 4\
**Last updated:** [December 6, 2019, 4:37pm UTC](https://forums.foundationdb.org/t/basic-record-layer-query-performance-and-caching-strategies/1801 "2019-12-06T16:37:59Z")

</div>

In getting up and running I’m seeing basic queries (inserts/lookups/queries) take about 30ms. I think this is an issue with the way I’m reusing (or failing to re-use) the instantiated recordStore instance. I’ve roughly f…

---

## [Bulk load in Record Layer is slow](https://forums.foundationdb.org/t/bulk-load-in-record-layer-is-slow/1794)

<div class="topic-metadata">

**Author:** [@rishabh](https://forums.foundationdb.org/u/rishabh)\
**Replies:** 3\
**Last updated:** [December 4, 2019, 3:33pm UTC](https://forums.foundationdb.org/t/bulk-load-in-record-layer-is-slow/1794 "2019-12-04T15:33:58Z")

</div>

We have a custom use case, for which we implemented our own layer in java. But we concluded that it was more or less same as record layer and we are now evaluating record layer. The first hurdle we have hit is that bulk…

---

## [Consistency of queries using continuation cursor](https://forums.foundationdb.org/t/consistency-of-queries-using-continuation-cursor/1694)

<div class="topic-metadata">

**Author:** [@rishabh](https://forums.foundationdb.org/u/rishabh)\
**Replies:** 5\
**Last updated:** [October 23, 2019, 5:12pm UTC](https://forums.foundationdb.org/t/consistency-of-queries-using-continuation-cursor/1694 "2019-10-23T17:12:25Z")

</div>

In record layer, long running queries are supported by concept of continuation. After firing a query, client gets some query results and a continuation as output. It can then use this continuation to again open a (new) …

---

## [Aggregate Functions on Double | Distinct Count](https://forums.foundationdb.org/t/aggregate-functions-on-double-distinct-count/1635)

<div class="topic-metadata">

**Author:** [@VibhutiD](https://forums.foundationdb.org/u/VibhutiD)\
**Replies:** 5\
**Last updated:** [September 26, 2019, 7:24pm UTC](https://forums.foundationdb.org/t/aggregate-functions-on-double-distinct-count/1635 "2019-09-26T19:24:25Z")

</div>

Hi, So I recently started exploring FoundationDB and Record Layer and had a couple of questions regarding it. As of now, Record Layer’s aggregate functions only support Integer fields. The reason for the same being is …

---

## [Document Layer OOM](https://forums.foundationdb.org/t/document-layer-oom/1557)

<div class="topic-metadata">

**Author:** [@yennie](https://forums.foundationdb.org/u/yennie)\
**Replies:** 12\
**Last updated:** [August 13, 2019, 6:36pm UTC](https://forums.foundationdb.org/t/document-layer-oom/1557 "2019-08-13T18:36:22Z")

</div>

I have a single instance of Document Layer running in a k8s cluster. Document Layer 1.6.3 and FDB 6.1.8 with 2 CPU/4 GB RAM requested and 4 CPU/4 GB RAM limits for the pod. Upon testing with ~2.5 reads/second for a per…

---

## [Mixed ascending/descending sort?](https://forums.foundationdb.org/t/mixed-ascending-descending-sort/1582)

<div class="topic-metadata">

**Author:** [@jkominek](https://forums.foundationdb.org/u/jkominek)\
**Replies:** 1\
**Last updated:** [August 12, 2019, 11:19pm UTC](https://forums.foundationdb.org/t/mixed-ascending-descending-sort/1582 "2019-08-12T23:19:20Z")

</div>

I’d like to store records of orders which, like the getting started example, have an order ID, and a price. I’ll then want to query them sorted first by descending price, and then by ascending order ID. So I can’t just u…

---

## [Record Layer with DynamicMessage?](https://forums.foundationdb.org/t/record-layer-with-dynamicmessage/1576)

<div class="topic-metadata">

**Author:** [@Sraw](https://forums.foundationdb.org/u/Sraw)\
**Replies:** 1\
**Last updated:** [August 9, 2019, 6:54am UTC](https://forums.foundationdb.org/t/record-layer-with-dynamicmessage/1576 "2019-08-09T06:54:19Z")

</div>

Suppose we are using a dynamically generated message like: MessageDefinition msgDef = MessageDefinition.newBuilder("Person") // message Person .addField("required", "int32", "id", 1) // required int32 id = 1 …

---

## [Regarding issue facing while try to build fdbdoc binary in macOS](https://forums.foundationdb.org/t/regarding-issue-facing-while-try-to-build-fdbdoc-binary-in-macos/1530)

<div class="topic-metadata">

**Author:** [@pragawaran](https://forums.foundationdb.org/u/pragawaran)\
**Replies:** 5\
**Last updated:** [July 23, 2019, 10:38am UTC](https://forums.foundationdb.org/t/regarding-issue-facing-while-try-to-build-fdbdoc-binary-in-macos/1530 "2019-07-23T10:38:25Z")

</div>

Hi, I am trying to build the fdbdoc binary using GitHub source code in macOS. But I am facing issue while building the binary. I have followed the below steps : clone the source code from GitHub cd /fdb document laye…

---

## [Behaviour of saveRecord to the recordStore?](https://forums.foundationdb.org/t/behaviour-of-saverecord-to-the-recordstore/1516)

<div class="topic-metadata">

**Author:** [@amarjeet000](https://forums.foundationdb.org/u/amarjeet000)\
**Replies:** 3\
**Last updated:** [July 11, 2019, 5:54pm UTC](https://forums.foundationdb.org/t/behaviour-of-saverecord-to-the-recordstore/1516 "2019-07-11T17:54:24Z")

</div>

I guess the behaviour of saveRecord is like an upsert - am I correct?. Also, as per docs, if an attribute with an aggregate expression (available ones) is indexed, then every update goes through a differential computati…

---

## [With the Record Layer, does the keyspace path get re-created when app re-starts?](https://forums.foundationdb.org/t/with-the-record-layer-does-the-keyspace-path-get-re-created-when-app-re-starts/1513)

<div class="topic-metadata">

**Author:** [@amarjeet000](https://forums.foundationdb.org/u/amarjeet000)\
**Replies:** 3\
**Last updated:** [July 11, 2019, 5:04am UTC](https://forums.foundationdb.org/t/with-the-record-layer-does-the-keyspace-path-get-re-created-when-app-re-starts/1513 "2019-07-11T05:04:03Z")

</div>

A path has been defined at line 125: https://github.com/FoundationDB/fdb-record-layer/blob/master/examples/src/main/java/com/apple/foundationdb/record/sample/Main.java#L125. Does this path get re-created each time the a…

---

## [1 M rows write via Mongo client using document layer](https://forums.foundationdb.org/t/1-m-rows-write-via-mongo-client-using-document-layer/1157)

<div class="topic-metadata">

**Author:** [@vaggarwal](https://forums.foundationdb.org/u/vaggarwal)\
**Replies:** 12\
**Last updated:** [June 13, 2019, 1:08pm UTC](https://forums.foundationdb.org/t/1-m-rows-write-via-mongo-client-using-document-layer/1157 "2019-06-13T13:08:26Z")

</div>

1 M rows write via Mongo client using document layer is very slow comparatively loading it in mongodb database . I got 26 minutes versus 7 minutes Here is the document- for(var i = 1; i &lt;= 1000000 ; i++) { db.…

---

## [Auto-incrementing id](https://forums.foundationdb.org/t/auto-incrementing-id/1393)

<div class="topic-metadata">

**Author:** [@max](https://forums.foundationdb.org/u/max)\
**Replies:** 3\
**Last updated:** [May 29, 2019, 11:47pm UTC](https://forums.foundationdb.org/t/auto-incrementing-id/1393 "2019-05-29T23:47:06Z")

</div>

In comparing the record layer to a traditional relational database there is no mention of an incrementing id field. It seems like atomic operations on a counter are easily supported by foundationdb. Is this an anti-patte…

---

## [Document Layer Performance](https://forums.foundationdb.org/t/document-layer-performance/1255)

<div class="topic-metadata">

**Author:** [@jonahwest](https://forums.foundationdb.org/u/jonahwest)\
**Replies:** 1\
**Last updated:** [April 8, 2019, 8:36pm UTC](https://forums.foundationdb.org/t/document-layer-performance/1255 "2019-04-08T20:36:48Z")

</div>

The Document Layer looks very promising, however, is there a performance overhead to using it? What are some real-world performance expectations? (operations/sec, latency, CPU usage) How much overhead does the Docu…

---

## [Document Layer 1.6.3 release](https://forums.foundationdb.org/t/document-layer-1-6-3-release/1210)

<div class="topic-metadata">

**Author:** [@dongxinEric](https://forums.foundationdb.org/u/dongxinEric)\
**Replies:** 0\
**Last updated:** [March 8, 2019, 11:50pm UTC](https://forums.foundationdb.org/t/document-layer-1-6-3-release/1210 "2019-03-08T23:50:13Z")

</div>

We are glad to announce that Document Layer 1.6.3 has been released! You can download binaries from the foundation website, or from GitHub release page. The new release comes with several important bug fixes and compati…

[Previous page](https://forums.foundationdb.org/c/using-layers/14.md?page=1)

[Next page](https://forums.foundationdb.org/c/using-layers/14.md?page=3)
