Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 425
» Latest member: AmeliaCharlotte
» Forum threads: 242
» Forum posts: 1,073

Full Statistics

Online Users
There are currently 38 online users.
» 0 Member(s) | 37 Guest(s)
Applebot

Latest Threads
User authentication: lost...
Forum: Getting Started
Last Post: stamatis
04-22-2025, 07:03 PM
» Replies: 18
» Views: 42,839
"Manage Emails" - changin...
Forum: Bug Reports
Last Post: stamatis
04-22-2025, 03:56 PM
» Replies: 1
» Views: 1,301
CDB will not load in Live...
Forum: General
Last Post: stamatis
04-16-2025, 03:11 PM
» Replies: 0
» Views: 814
using cdb_auth with Live...
Forum: General
Last Post: JereMiami
12-19-2024, 01:58 AM
» Replies: 0
» Views: 1,245
BLOBs - not possible to a...
Forum: General
Last Post: stamatis
10-06-2024, 06:28 PM
» Replies: 0
» Views: 1,155
Allow users to change the...
Forum: General
Last Post: mark_talluto
01-18-2024, 01:09 AM
» Replies: 8
» Views: 15,694
cdb_sendEmail
Forum: General
Last Post: mark_talluto
11-07-2023, 09:57 PM
» Replies: 0
» Views: 1,463
cdb_sync & cdb_lookupvalu...
Forum: General
Last Post: mark_talluto
11-07-2023, 09:45 PM
» Replies: 1
» Views: 2,391
cdb cdb_sendEmail
Forum: Bug Reports
Last Post: JereMiami
10-05-2023, 01:57 PM
» Replies: 0
» Views: 2,619
LCM: "Please inform Canel...
Forum: General
Last Post: mark_talluto
07-12-2023, 07:58 PM
» Replies: 24
» Views: 34,887

 
  Methods for integrating cdbUsers table with stored user content
Posted by: mark_talluto - 10-27-2021, 11:05 PM - Forum: Code Samples - No Replies

Once in a while, we will provide support via email. I want to share that experience with everyone with the hope that others will benefit. When this happens, We'll leave out the person's name.

On to the question:
I've never really done nosql, was always able to query specific records against a user_id.
I want a quick way to save and query all of a user's records in this nosql way.

Do you see any limits or problems with creating a table for each user? and place all their data there?

I know for low numbers of user's thats not a big deal.
How about 10,000 tables?


The response:
There is always more than one way to model your data.

Method 1
You could use your cdbRecordID (primary key) for each user in the cdbUsers table as a linking key (foreign key) to records in another table.

cdbUsers table
Record 1: [a2ad3bc9-8ef8-4c36-9c4d-00d109600cd9] [Marco] [Polo]


someDataTable that contains data for all of your users
Record 34545 [0a43839f-ad5c-4089-a864-c6bfa10942be] [a2ad3bc9-8ef8-4c36-9c4d-00d109600cd9] [import] [data] [in] [these] [columns]


TableID:fbb12a0d-8189-4fb4-a906-12166445f54b
0a43839f-ad5c-4089-a864-c6bfa10942be


//Untested come code that should work:
//GET THE RECORD ID OF A PARTICULAR USER
local tOutputA, tRecordID
put cdb_query("email","=","marco@polo.com","cdbUsers","cloud","recordData") into tOutputA
put tOutputA["cdb"]["cdbRecordID"] into tRecordID


//USE THE cdbRecordID FROM THE FIRST QUERY TO FIND ALL RELATED DATA TO THIS USER
local tOutputA
put cdb_query("userForeignKey","=",tRecordID,"someDataTable","cloud","recordData") into tOutputA

//tOutputA will contain an array that for every record in the 'someDataTable' table that is related to your user. 
//For this to work, every commit to this table needs you to include the foreign key value in each record for every user.
//Since the user is probably authenticated, you can get this value one time during their session and use it everywhere you need.


Method 2
You can store the tableID in the cdbUsers table as a foreign key.
The optimization is that you can read on a single table and know that all the data is related to that particular user. You will not need to query a table to find related data. 

I am in favor of this model. The only negative is that a user can not create a table programmatically. It is something we intend to resolve. You could pre-create tables with a developer-signed app programmatically. If you get serious with this method, we can look at a longer-term solution to make this happen. 

You can connect as many tables as you like to a particular user. Just create the foreign key columns in the cdbUsers table to track the tableIDs.


Limitations
The free account “Mist” and entry level account “Rain" are running on a shared cloud cluster. They are great for developing concepts and low-data consumption apps. They will not work out for you if you plan to have 10k or more users. 

You will want to build a “Storm” account to customize the cluster just for your app. If you have 10k paying customers, our Storm plans are cheap. 


  hello
Posted by: Samuele - 10-20-2021, 06:08 PM - Forum: Getting Started - Replies (9)

hello I'm Samuele, i tried to use livecloud but it doesn't work i have put the created folder (by livcloud, with in it database...) in the same folder as the livecode stack file and run livecode but the stacks that are supposed to be there (the libraries ecc.) are not thereany help would be great. thanks!


  Using Livecloud on a website
Posted by: philippecoenen - 10-17-2021, 08:34 AM - Forum: General - Replies (11)

Hi,

In my use-case I may need to let people register from a website.
Is there any API I can use for that?

Smile


  LiveCode Conference in New York - April 25-27
Posted by: mark_talluto - 10-14-2021, 05:20 PM - Forum: Announcements - No Replies

Hey everyone! LiveCode is holding another in-person conference early next year. Canela will be there to demonstrate Appli.

Appli is a new front-end IDE to LiveCloud that aids you in making desktop and mobile apps. You can ship your apps without a developer kit from Apple or Google. We provide a player that your clients can download from both app stores. Of course, if you need a standalone, you will be able to do that too.

Appli provides a modern IDE for making apps. You do not have to worry about the complexity typically found in mobile app design. Appli solves the various screen sizes and dpi differences for you. Appli ties in with LiveCloud providing a native database. This design allows you to bind your data to your app elements with ease.

Appli will come with a no-code, low-code, and high-code feature set. These features will allow you to build projects faster than ever. Should you need more power, you can use the powerful LiveCode language to fill in the gaps as needed.

Appli is still under development. We have a single-page site to get you thinking about the great things that are coming. Check it out at: appli.io. We expect to have an open beta in November.

The goal is to provide a session and a workshop at the LiveCode conference in April. We hope to see all of you there!


  Android Support Notice
Posted by: mark_talluto - 10-07-2021, 05:01 PM - Forum: Announcements - Replies (1)

Yesterday, we learned about an issue that will affect all LiveCode Android developers. LiveCloud servers use Let's Encrypt SSL certs. 

A recent change in how Let's Encrypt SSL certs work will break apps made in LiveCode before version 9.6.5.
https://letsencrypt.org/docs/dst-root-ca...mber-2021/

The solution is to rebuild your app in LiveCode 9.6.5. We tested 9.6.5 with our Appli Player. Everything works as expected.

Please let us know if you have any problems.


  LiveCloud outage
Posted by: mark_talluto - 10-01-2021, 10:07 PM - Forum: Announcements - Replies (3)

Hey guys. I wanted to let you know that Digital Ocean is reporting an outage covering a range of regions, including London, New York, and San Francisco. They are working on the problem. Their outage will affect the LiveCloud service from being able to process some of your cloud calls. 

Your local database is not affected by this problem. I am sorry this is happening. Outages are rare with them. I suspect they will have it resolved soon. When I have more details, I'll report back to you here.

Please let us know if you have any questions.

-Mark


  lib and project
Posted by: philippecoenen - 09-12-2021, 03:17 PM - Forum: General - Replies (2)

Hello Mark,

I have tried to simply copy the lib from one project to another.
But it seems it was not working.
Finally, I create a stack with an empty sample and that was good. I can now log in properly.

Is it in the config file that the project is identified? So if I copy the config things will work?
And what is the format of the config (it looks like an encoded array I didn't check though)
I suspect that it's mandatory to create a new stack using an empty sample (or one of the samples) to export a project config?
But what if I want to change the project keeping the same stack? How does it work?

It's not 100% useful for me to know that but I feel a little uncomfortable not knowing what is what.
How do the libraries (or my stack) understand which project to connect to?

In a couple of days, I will start some more serious development and I would prefer to know where I put my feet  Cool

I thank you already,  Smile

-Phil


  custom record ID
Posted by: philippecoenen - 09-10-2021, 02:14 PM - Forum: General - Replies (9)

Is there a way for me to modify the record Id
I already have a database and they have their records Id already. It's a UUID similar to the ones you are using but slightly different.
If I create new records that are not a problem (as these ids are alpha so it does not matter as long as they are unique).
But if I want to use existing records it's another problem.

I can definitively ignore your ids but I think it's a bit of waste.

However, if I can change an id or provide the id when I create a new record it will be OK.

Please let me know...

Best,


  array as value
Posted by: philippecoenen - 08-26-2021, 06:34 PM - Forum: General - Replies (2)

Can I store an array in a value?
I have a design format that represents a graph with links and different display attributes.
I store this data in an array.
I want to store all the information at once. the key would be "board" and the value, the array.
Will it work without to encode the array?


  Emailing
Posted by: philippecoenen - 08-24-2021, 08:26 AM - Forum: General - Replies (2)

Hi,

I saw that it's easy to send mails.
But how many emails can I send?
If I have 10.000 users or 100.000 users can I mail all of them?