I am creating an IOT device where the user can set a particular time to trigger an action by an IOT device. For eg: At 01:00 PM, the Air Conditioner starts automatically. I am using Google Cloud Platform. I checked the Cron job in GCP, which triggers a particular URL at particular time or a specified interval. Since my trigger time is stored in the datastore so either i've to query the database after every minute using cron job where i can write the logic, to trigger the action if the time matches. but there will always be 59 seconds lag in worst case else i can call the URL after every second. Calling a ulr after every second will be very costly since i need to query the database every 1 second.. Is there any other efficient way to achieve this?
Related Questions in GOOGLE-APP-ENGINE
- Deployment through app engine, cloud sql database, problem connecting with server code, doesn't connect
- Jetty 12 idle timeout limited to 30 seconds when upgrading to Java 21 in Google App Engine Standard Environment
- Unable to deploy to GAE from Github Actions
- Migrating Google App Engine - Eclipse Java 8
- How to use Oauth in order to log‑in on .googleapis.com on almost any arbitrary endpoints domains from the web browser?
- Running gcloud app deploy and getting PERMISSION_DENIED 'compute.regions.get', despite having Owner and Compute admin permissions
- Spring security CORS configuration not working after deploying to App Engine
- Google App Engine: manual scaling with one instance suddenly created multiple instances
- gcloud.app.deploy Error Response: [13] Failed to create cloud build: invalid bucket
- gcloud.app.deploy Error Response: [13] default Cloud Build service account or user-specified service account does not have access to the bucket
- GCP Java dev_appserver Can't make API call memcache.Get in a thread that is neither the original request thread nor a thread created by ThreadManager
- How to correlate and aggregate logs in Google App Engine Python 3?
- App Engine Python3 db / ndb & eventual consistency
- How do I connect to Google Cloud mySQL from App Engine using Django-Environ?
- How to deploy my fast api with llama 2 on app engine
Related Questions in GOOGLE-CLOUD-DATASTORE
- Unable to call datastore using GCP service account key json
- Hello I just started with google cloud storage, size of bucket online help doesnt
- GCP Java dev_appserver Can't make API call memcache.Get in a thread that is neither the original request thread nor a thread created by ThreadManager
- How can I improve the performance of a Dataflow job using the Firestore Bulk Delete template?
- Database Id config when Loading data to datastore using apache beam
- Trigger eventarc event ONLY when a particular cloud datastore entry is committed
- How to delete a Datastore database with Google App Engine search data in it without Python 2.7
- DataNucleus to Objectify on Google Datastore
- Usage of the Java com.google.cloud.datastore.* APIs to access a "Datastore" database on google cloud
- how to create index GCP datastore?
- Google datastore queries fail with ApiProxy$CallNotFoundException
- Datastore query inconsistencies
- No current context. NDB calls must be made in context established by google.cloud.ndb.Client.context
- Datastore: FailedPrecondition: 400 The query requires an ASC or DESC index for kind transcription and property status
- Fetching data back from datastore in GCP
Related Questions in GAE-MODULE
- What are the possible values for X-AppEngine-TaskRetryReason header in Google app engine request headers?
- How to update file when hosting in Google App Engine?
- Google App Engine: Disable session middleware for services
- How to make a service discovery for Google App Engine? How to get service URL?
- Undoing a routes deploy
- Google App Engine Flex Health Checks on Docker Containers
- error when I tried to install locally the modules Gae and Siena on play framework 1.4.3
- Run function after task retry limit reached google app engine
- Create scheduled events in Google Cloud Platform
- AppEngine Flexible with custom runtime - logging challenge
- App Engine - subdomain pointing to particular service
- Incomplete/cropped entries in google app engine logs
- Google App Engine Java Logging, specifically Slf4j
- Communication methods between two GAE services in the same project
- How to get current num of google app engine instances?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Just to be sure I'm understanding, the use-case you're trying to avoid, is a user setting the AC to go on at, say, 1PM, and set it at 13:00:01 (so they'd have to wait until 13:01:00 for the AC to turn on)?
Assuming that's the case, then, if you're using Firebase/Firestore, you can use a GCF (Google Cloud Function) to actually trigger the AC turning on (send an IoT Core config message to the device, for example, not sure how you're actually physically turning on the AC). The GCF can be triggered by either the CRON job which fires every minute, or have it respond (it's one of the event triggers) to a database value change in Firebase.
So the user sets the time for the AC to come on, which sets a value in the Firebase database, which triggers the GCF to check the value and see if it should be turning on the AC or not. That way you're not relying on the CRON job alone to turn on the AC, you also have a data-changed event to check the time as well. That should eliminate the 59 second wait time in your case.