Note, This plugin utilizes a database external to Bubble to create and track values.
The documentation has lots of details, but basically you:
Create a “service account” which establishes a user name and password for the service (You can use the demo page or an action within your own app to do this)
Create either a UniqueID or a UniqueCounter using an action within your own app. This creates the field and thus is done only once per field.
You then can check/generate values based on your needs using workflow actions and external api retrieval.
Interesting, thanks. If two simultaneous calls are made, two different id will be generated and incremental? It is the principal reason having created this plugin?
And my second question is what’s the chance the external server crash or will not be available? weird question
john
Correct, if two simultaneous calls are made, two different id’s will be generated when using the UniqueCounter flavor. I created this portion of the plugin for generating invoice id’s, order id’s, etc. where you want something unique, but also something presentable to the user. It’s pretty easy to create a race condition in Bubble, hence the need if you have any type of load.
The second flavor, UniqueID, was created to deal with incoming webhooks. In my case I had a stream of webhooks coming in from Eventbrite, which caused me to do all sorts of tricks to avoid dupes. So this flavor takes an ID value and inserts it into index, so that if a second call comes in at the same time, it will fail.
Second question is not weird at all, and definitely a risk. The plugin makes calls to an endpoint that resides on a Google Cloud Compute linux instance, so very reliable. That being said, I don’t have automated failover’s in place right now.
But, I’m building an app for a funded company… And if this thing fails I would be screwed. What option would I have to host it myself somehow so I can control the code? It would be irresponsible of me to let a tiny piece of code jeopardize the whole operation.
I haven’t been around here for several years, but was just notified that this plugin was temporarily inoperable. Sorry to anybody impacted by that! It is back online now.
To anybody using this plugin, please migrate to a new solution asap. The outage was triggered by the deprecation of the server it is running on. I completely forgot about the plugin’s need for the server as I no longer use Bubble.
At any rate, I can keep that server online for another couple months, but I will be shutting it down in Q1 next year.