# Request for feedback: Full export, Go binding usage, Future plans

**URL:** <https://forums.foundationdb.org/t/request-for-feedback-full-export-go-binding-usage-future-plans/2620>\
**Category:** Using FoundationDB\
**Created:** [March 22, 2021, 4:46pm UTC](https://forums.foundationdb.org/t/request-for-feedback-full-export-go-binding-usage-future-plans/2620 "2021-03-22T16:46:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harikb](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/harikb/32/1033_2.png) [@harikb](https://forums.foundationdb.org/u/harikb)\
**Post date:** [March 22, 2021, 4:46pm UTC](https://forums.foundationdb.org/t/request-for-feedback-full-export-go-binding-usage-future-plans/2620/1 "2021-03-22T16:46:22Z")

</div>

Hello,

I am working on a utility for a full export (inconsistent, non-transactional) for subsequent data processing elsewhere. I would appreciate your feedback on the approach and any concerns.

(For now, ignore the fact that the client runs from only one client node and not scalable)

The first thing to get over was to batch taking care of the 5s limit. Based on your feedback in other threads, I have the following code that is the crux of the loop to fetch a given range of keys

> <https://github.com/adobe/ferry/blob/86be2b5487db505efb24dcd63cd9a45337211f6e/lib/exporter/exporter.go#L133:L206>

Couple of questions on this

1. I know there is a newer split-key-ranges-by-size API coming up in 7.0 . But for now, is the approach of ‘creating a new txn after a failure’ the best approach?

2. I feel a bit uneasy about the byte slice returned by `.Get()` - how long is that slice valid? Should I clone it before assigning it to a variable (see line 178) which is referenced in the next loop?

Future plans

Ideal setup, if it is possible, would be to make sure I can narrow down each key-range to a particular host and make the read local (by having an agent run local to that node), filter some data locally, and then return data to caller. The challenge of course would be test if filtering would add any value and how to make it generic to be useful in an open-source project. But I am working on it. Let me know if you have any thoughts on it. Lot of this is based on hunches, only tests will show if there is any value in doing this.

Any feed back is appreciated. The wip code is open-source, although it is just a prototype now

> **[adobe/ferry](https://github.com/adobe/ferry)**
>
> Contribute to adobe/ferry development by creating an account on GitHub.

Thank you for your time  
Hari

---

<div class="post-metadata">

**Author:** ![harikb](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/harikb/32/1033_2.png) [@harikb](https://forums.foundationdb.org/u/harikb)\
**Post date:** [March 29, 2021, 7:12pm UTC](https://forums.foundationdb.org/t/request-for-feedback-full-export-go-binding-usage-future-plans/2620/2 "2021-03-29T19:12:46Z")

</div>

> [@harikb](#):
>
> byte slice returned by `.Get()` - how long is that slice valid?

I appreciate if anyone who knows the Go binding has any input on this.

I see that this code is creating a new slice of KeyValue structs, but since the `.Value` is being recast with unsafe, I am not quite sure what is going on

> <https://github.com/apple/foundationdb/blob/main/bindings/go/src/fdb/futures.go#L297>

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [March 29, 2021, 11:49pm UTC](https://forums.foundationdb.org/t/request-for-feedback-full-export-go-binding-usage-future-plans/2620/3 "2021-03-29T23:49:17Z")

</div>

I am not a Go expert, but looking at this, it appears that `stringRefToSlice` is using `C.GoBytes` to copy the data from the C buffer into a Go buffer. My understanding, then, is that the memory lifetime is not tied to any underlying native object.
