# Mix API: On-Prem and Client

**URL:** <https://forum.datomic.com/t/mix-api-on-prem-and-client/1927>\
**Category:** General\
**Created:** [August 12, 2021, 12:52pm UTC](https://forum.datomic.com/t/mix-api-on-prem-and-client/1927 "2021-08-12T12:52:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikolayandr](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/nikolayandr/32/375_2.png) [@nikolayandr](https://forum.datomic.com/u/nikolayandr)\
**Post date:** [August 12, 2021, 12:52pm UTC](https://forum.datomic.com/t/mix-api-on-prem-and-client/1927/1 "2021-08-12T12:52:47Z")

</div>

What are your thoughts when the single app consumes both **OnPrem** and **Client** APIs, our app is built on using **OnPrem** solution everything is good until we have a lot of instances which are allocated a lot of memory for to execute queries. We tried **Client** API and were surprised that queries are executed faster and some of them consume less memory. The answer why we still need **OnPrem** API is ability to listen on transactions and it is convenient to use entity API to get attributes data on demand, we are getting entity IDs from queries and then get entity for each returned ID. But there is a question for the next case: if to transact data through **Client** API and get entity from database returned from **OnPrem** connection using function [datomic.api - Datomic Clojure API documentation](https://docs.datomic.com/on-prem/clojure/index.html#datomic.api/db), is there any guaranties that the function returns the database which represents the last available data on transactor side? Doc says: Retrieves a value of the database for reading. Does not communicate with the transactor, nor block.  
So, looks like no

P.S. Looks like the only guaranty to have full sync between **Client** and **OnPrem** connections if to use [datomic.api - Datomic Clojure API documentation](https://docs.datomic.com/on-prem/clojure/index.html#datomic.api/sync) passing t gotten from transaction previously sent though client connection

---

<div class="post-metadata">

**Author:** ![adam](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@adam](https://forum.datomic.com/u/adam)\
**Post date:** [August 12, 2021, 8:05pm UTC](https://forum.datomic.com/t/mix-api-on-prem-and-client/1927/2 "2021-08-12T20:05:59Z")

</div>

I think you answered your own question in your “P.S.”…`sync` with the `t` returned by the completed transaction is the way to do this in any distributed situation. I think calling it a “full sync” overstates the cost compared to the alternatives: it should be the same as if the transaction were executed using the peer API and the resultant `:db-after` were then used for a query.
