# How to read/Write FDB Record layer using Golang

**URL:** <https://forums.foundationdb.org/t/how-to-read-write-fdb-record-layer-using-golang/3440>\
**Category:** Using FoundationDB\
**Created:** [July 8, 2022, 1:39pm UTC](https://forums.foundationdb.org/t/how-to-read-write-fdb-record-layer-using-golang/3440 "2022-07-08T13:39:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chetan\_pg](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@chetan\_pg](https://forums.foundationdb.org/u/chetan_pg)\
**Post date:** [July 8, 2022, 1:39pm UTC](https://forums.foundationdb.org/t/how-to-read-write-fdb-record-layer-using-golang/3440/1 "2022-07-08T13:39:38Z")

</div>

I was reading about FDB record layer and so far it looks like only JAVA application can use the FDB record layer as it is a JAVA library. Please correct me if wrong.

Is it possible to read/write FDB record layer using golang? Any such support will be available in near future?

---

<div class="post-metadata">

**Author:** ![johscheuer](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@johscheuer](https://forums.foundationdb.org/u/johscheuer)\
**Post date:** [July 9, 2022, 9:17am UTC](https://forums.foundationdb.org/t/how-to-read-write-fdb-record-layer-using-golang/3440/2 "2022-07-09T09:17:02Z")

</div>

Like you correctly said, the record layer is currently a Java library, so it’s limited to jvm languages.

I’m not aware of any efforts to make the record layer available in other languages (which would be probably a completely new implementation).

---

<div class="post-metadata">

**Author:** ![rajivr](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/rajivr/32/1100_2.png) [@rajivr](https://forums.foundationdb.org/u/rajivr)\
**Post date:** [July 11, 2022, 6:14am UTC](https://forums.foundationdb.org/t/how-to-read-write-fdb-record-layer-using-golang/3440/3 "2022-07-11T06:14:36Z")

</div>

Also checkout this blog post by @damienleroux.

[Bigblue’s multi-model database on FoundationDB](https://medium.com/bigblue-engineering/bigblues-multi-model-database-on-foundationdb-5c54b8d61942)

It talks about a layer implementation using Golang.

---

<div class="post-metadata">

**Author:** ![chetan\_pg](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@chetan\_pg](https://forums.foundationdb.org/u/chetan_pg)\
**Post date:** [July 11, 2022, 5:09pm UTC](https://forums.foundationdb.org/t/how-to-read-write-fdb-record-layer-using-golang/3440/4 "2022-07-11T17:09:20Z")

</div>

thanks for the info . I will take a look …

---

<div class="post-metadata">

**Author:** ![chetan\_pg](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@chetan\_pg](https://forums.foundationdb.org/u/chetan_pg)\
**Post date:** [July 12, 2022, 9:51pm UTC](https://forums.foundationdb.org/t/how-to-read-write-fdb-record-layer-using-golang/3440/5 "2022-07-12T21:51:22Z")

</div>

Is it possible to use record layer to design parent-child table relationship and update in one transaction .Any article/sample code for the same. I have read few articles such as [FoundationDB Record Layer Overview](https://foundationdb.github.io/fdb-record-layer/Overview.html) but still it is not clear

---

<div class="post-metadata">

**Author:** ![alloc](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alloc/32/9_2.png) [@alloc](https://forums.foundationdb.org/u/alloc)\
**Post date:** [July 26, 2022, 2:46pm UTC](https://forums.foundationdb.org/t/how-to-read-write-fdb-record-layer-using-golang/3440/6 "2022-07-26T14:46:46Z")

</div>

The Record Layer has support for transactions with an arbitrary set of changes in it (up to FDB limits like the transaction size limit: [Known Limitations — FoundationDB 7.1](https://apple.github.io/foundationdb/known-limitations.html#large-transactions)). So, it can support parent-child relationships with transactional updates. I’m not sure there’s sample code anywhere for that specific data model, though you can see a bit of that in the sample code here where there are Vendor records and Item records, and the Item records all have Vendor IDs: [fdb-record-layer/Main.java at 2f0b6e7de2fdabee1579f9969a958e145852c003 · FoundationDB/fdb-record-layer · GitHub](https://github.com/FoundationDB/fdb-record-layer/blob/2f0b6e7de2fdabee1579f9969a958e145852c003/examples/src/main/java/com/apple/foundationdb/record/sample/Main.java#L147)

The Record Layer doesn’t have any built-in support for validating foreign key relationships, which is probably the biggest missing piece in a parent-child data model. The suggestion there would be to build it on top of the Record Layer, by validating the presence of the parent when adding a new child (for example) by looking it up by ID. But more in-depth foreign key support is also a feature the Record Layer team has been thinking about how to properly push down as well

---

<div class="post-metadata">

**Author:** ![chetan\_pg](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@chetan\_pg](https://forums.foundationdb.org/u/chetan_pg)\
**Post date:** [July 26, 2022, 3:07pm UTC](https://forums.foundationdb.org/t/how-to-read-write-fdb-record-layer-using-golang/3440/7 "2022-07-26T15:07:40Z")

</div>

thanks … i will read on the link you have shared. Currently creating monitoring using golang and New relic API (we use New Rerlic API for custom metrics). Still new to FDB so thanks for the help
