# Handling concurrent users for calculator apps

**URL:** https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237
**Category:** Ask for Help
**Created:** [March 30, 2022, 4:22am UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237 "2022-03-30T04:22:55Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![shoumikgoswami](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shoumikgoswami/32/40969_2.png) [@shoumikgoswami](https://community.glideapps.com/u/shoumikgoswami)
#### Post date: [March 30, 2022, 4:22am UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/1 "2022-03-30T04:22:55Z")

</div>

I am currently working on building a financial calculator app and my use case is similar to these in terms of data structure and layout -

> **[Future Value Calculator Template • Glide](https://www.glideapps.com/templates/future-value-calculator-6z)**
>
> Future Value calculator with 3 popular finance functions:
> 1. Compound Interest with regular contributions - future value based on current principal, interest rate and regular contributions
> 2. Interest Rate - what rate is needed to achieve a future...

> **[Present Value Calculator Template • Glide](https://www.glideapps.com/templates/present-value-calculator-ps)**
>
> This app calculates:
> 
> 1. Present Value of a future sum of money given an expected interest rate 
> 
> 2. Present Value of an Annuity with future periodic payments given an expected interest rate

There are google sheets with just 1 row where user input is collected and then the outputs are captured in the same row based on calculations. These calculations involve a few other sheets in the background where the input is taken and output is generated.

I realized that since the backend data is simply 1 row, is it right to assume that these apps cannot handle concurrent users? Because, as soon as 1 user enters a value in the sheet, any other user using the app at that moment will start seeing the input values in their app as there is just 1 common database.

One option is to create user inputs per user but that causes issues while sending inputs to the calculations as they can accept only 1 input at a time. It cannot handle multiple inputs from different users at the same instance.

The calculations are complex so doing the calculations per user will obviously slow down the app.

Any thoughts or recommendation on how to allow concurrent users to use these kind of apps?

Thanks.

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [March 30, 2022, 4:27am UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/2 "2022-03-30T04:27:43Z")

</div>

> [@shoumikgoswami](#):
>
> I realized that since the backend data is simply 1 row, is it right to assume that these apps cannot handle concurrent users?

Yes, that assumption is correct. To properly handle concurrent users you should be collecting your input in User Specific Columns, and performing all calculations in Glide.

See below for some inspiration:

> [@March Challenge - Calculator](https://community.glideapps.com/t/march-challenge-calculator/24091):
>
> I had an idea a while ago to see if I could build a reasonably functional calculator in Glide. I decided to give it a shot and came up with one that actually works pretty well. It’s nothing fancy like a scientific calculator, but it handles the basics (addition, subtraction, multiplication, division). OK, it turned out to have a lot more functionality than originally planned. It took a lot of trial and error to work out most of the bugs and have it work how I would expect a basic calculator t…

---

<div class="post-metadata">

### Author: ![shoumikgoswami](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shoumikgoswami/32/40969_2.png) [@shoumikgoswami](https://community.glideapps.com/u/shoumikgoswami)
#### Post date: [March 30, 2022, 1:35pm UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/3 "2022-03-30T13:35:26Z")

</div>

Thank you for your response.

The calculations I am performing are slightly complex.

For example - this is a returns calculator, it takes the inputs (highlighted cells) and outputs the returns

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/e/eece8c54e80fa8ddd12f662139a54fb7a5b17b30.png)

This uses a bigger calculation table which has 100s of rows which calculates the returns per month for the whole period.

Any recommendation on how best to structure this to make it User Specific? One thing I worry about is doing the calculations per user will make the app very slow given the size of calculations.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 30, 2022, 2:03pm UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/4 "2022-03-30T14:03:05Z")

</div>

This still sounds doable. I like to use what I call work tables, which are pre-populated tables, but have some values that can be entered or passed in from user input which determines how the rest of the table will calculate a result. So, one of your tables could hold your user inputs in user specific columns, and then you pull those user specific values into your working table, where all of the other calculations can be performed.

Building all of this in glide and making it work, using user specific columns, for multiple users to use it, would be absolutely night and day as far as performance and speed. Right now, if you are relying on the Google sheet to handle all of the calculations, then you have a cringeworthy delay waiting for those results to come back. Plus you are most likely stuck with one user using the app at a time. When you move everything into glide, then your calculations are working as fast as you can type. Like the calculator app @Darren_Murphy shared, it’s performing those calculations instantly as you are typing numbers. None of it uses a google sheet, so it’s all real time. And at the same time, since I use user specific columns to store values, hundreds of thousands of users could be using my calculator at the same time and nobody would be interfering with anybody else.

---

<div class="post-metadata">

### Author: ![shoumikgoswami](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shoumikgoswami/32/40969_2.png) [@shoumikgoswami](https://community.glideapps.com/u/shoumikgoswami)
#### Post date: [March 31, 2022, 4:26am UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/5 "2022-03-31T04:26:22Z")

</div>

@Jeff_Hager Yes, I am struggling with the Gsheets and want to migrate it over to Glide tables.

Quoting your comment “pull those user-specific values into your working table, where all of the other calculations can be performed.”  
can you share how best to do this? I can create user-specific columns but wondering how i can pass user-specific inputs to the common working table because the working table can only handle 1 input at a time? Or am i wrong here?  
Do you have any examples where I can see this being implemented?

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [March 31, 2022, 4:34am UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/6 "2022-03-31T04:34:49Z")

</div>

> [@shoumikgoswami](#):
>
> because the working table can only handle 1 input at a time? Or am i wrong here?

As long as you made those columns user-specific, it will only handle the input of the signed-in user, so that they don’t override each other.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 31, 2022, 12:48pm UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/7 "2022-03-31T12:48:59Z")

</div>

Yes, as @ThinhDinh pointed out, as long as the computed columns use user specific columns in their calculations, then the result will also be user specific. This is something you just can’t do in a google sheet, but can in glide.

You can use Single Value columns or Relation/Lookup columns to bring data into a working table.

Again, my calculator app linked above is probably the best example I have. The math occurs in one row, but the user input is through user specific columns, so each user’s experience is unique to them. Even the calculation history table is user specific. Only 20 rows of history, but what each user actually sees is their own history and not anyone else’s.

It’s important to know that computations/calculations in glide happen directly on the user’s device. Not on the server. As a result, those calculations use whatever they “see” for data. If the data is user specific, then those calculations are based on that particular user’s specific data. Each user has a separate copy of the database that is synchronized between their device and Glide…and from Glide to Google. It’s not like a google sheet where everybody works with one copy, and all calculations are happening in that one copy. When you use user specific columns in glide, the experience can be quite different from user to user. It’s all about thinking a little differently from what you are used to with Google sheets.

---

<div class="post-metadata">

### Author: ![shoumikgoswami](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/shoumikgoswami/32/40969_2.png) [@shoumikgoswami](https://community.glideapps.com/u/shoumikgoswami)
#### Post date: [April 1, 2022, 11:05am UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/8 "2022-04-01T11:05:03Z")

</div>

Thank you for the detailed explanation, it makes sense to me now.

Create the input cells as User-specific and use another generic table, but we have to do this with Glide Tables to make it work. It wont work with Google sheets.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [April 1, 2022, 2:20pm UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/9 "2022-04-01T14:20:34Z")

</div>

Correct…mostly.

While the generic table would probably make more sense as a glide table, it can still be a google sheet, but all you would have on the google sheet side is probably a single column with some random data, or maybe some sort of a number that would help to determine your calculations on each row. At that point, it would just be easier to use a glide table instead. All of the rest of the logic would be within glide, using glide computed columns, regardless if it was part of a glide table or a google sheet.

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [April 2, 2022, 2:21pm UTC](https://community.glideapps.com/t/handling-concurrent-users-for-calculator-apps/40237/10 "2022-04-02T14:21:31Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
