# Using C Client in Lua in Non-Blocking Context

**URL:** <https://discuss.aerospike.com/t/using-c-client-in-lua-in-non-blocking-context/1157>\
**Category:** C Client Library\
**Created:** [April 8, 2015, 3:19pm UTC](https://discuss.aerospike.com/t/using-c-client-in-lua-in-non-blocking-context/1157 "2015-04-08T15:19:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcritt](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@rcritt](https://discuss.aerospike.com/u/rcritt)\
**Post date:** [April 8, 2015, 3:19pm UTC](https://discuss.aerospike.com/t/using-c-client-in-lua-in-non-blocking-context/1157/1 "2015-04-08T15:19:43Z")

</div>

Aerospike has a page at [https://www.aerospike.com/community/labs/aerospike\_lua\_client.html](https://www.aerospike.com/community/labs/aerospike_lua_client.html) on getting a C client running in a Lua app.

In particular I would like to run a client within the OpenResty Nginx ecosystem.

QUESTION: Is this approach non-blocking in something like OpenResty, or can it be if not? QUESTION: Is non-blocking the key driver for performance in this context? I am assuming non-blocking is the fastest, but wanted to make sure that assumption was correct.

I was also wondering about the distinction between non-blocking and asynchronous in the C Client context with Lua.

Thank you for any information.

---

<div class="post-metadata">

**Author:** ![wchu](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@wchu](https://discuss.aerospike.com/u/wchu)\
**Post date:** [April 19, 2015, 5:40pm UTC](https://discuss.aerospike.com/t/using-c-client-in-lua-in-non-blocking-context/1157/2 "2015-04-19T17:40:10Z")

</div>

We have not attempted in-housing running the lab version of the Aerospike lua client in a production environment. The lab code is a proof-of-concept. We’d want to hear from the community any experience, particularly if any special steps are needed for integrating with OpenResty.

Re: performance on blocking/non-blocking calls - even though in theory that async calls allows applications to pump as many requests as possible, it can also easily bring a system to its knees without careful consideration of overloading and throttling. The async models are generally harder to understand and harder to adopt.

In short, Aerospike is already a high performance system, and provide more than plenty for headroom for applications in synchronous environment. This is the best place to start.

---

<div class="post-metadata">

**Author:** ![rcritt](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@rcritt](https://discuss.aerospike.com/u/rcritt)\
**Post date:** [April 20, 2015, 2:13pm UTC](https://discuss.aerospike.com/t/using-c-client-in-lua-in-non-blocking-context/1157/3 "2015-04-20T14:13:21Z")

</div>

Thank you for the info on this wchu. Is there a preferred platform at Aerospike in which to use a client from? For example, a C client or Java or Lua.

---

<div class="post-metadata">

**Author:** ![wchu](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@wchu](https://discuss.aerospike.com/u/wchu)\
**Post date:** [April 20, 2015, 4:37pm UTC](https://discuss.aerospike.com/t/using-c-client-in-lua-in-non-blocking-context/1157/4 "2015-04-20T16:37:18Z")

</div>

Java, C#, or C would be the best choices, with the most production deployments. After that, there are also Node.js, Go, Ruby, PHP, Python libraries.

Lua would not be a good choice, since it is not a fully supported SDK.
