1.
Real-Time
Definition → refers to systems that can process and deliver data immediately or
within milliseconds after an event occurs.
Examples:
• Chat applications (like WhatsApp, Messenger)
• Live stock market updates
• Online gaming
• Real-time order status tracking in e-commerce
Key Technologies:
• WebSockets (bi-directional communication between client and server)
• Django Channels (for real-time support in Django)
• Socket.IO (commonly used with Node.js)
• Firebase Realtime Database or Firestore (by Google)
Use Case in Django→ When a user places an order, notify the artisan immediately
without refreshing the page.
🔔 2. Notifications
Definition → inform users of events or updates, either:
• In-app (real-time or triggered updates inside the app)
• Push (browser or mobile notifications)
• Email/SMS (sent asynchronously via 3rd-party services like Twilio, SendGrid)
Types:
• Real-time notifications: Uses WebSockets (e.g., "Your order has been accepted")
• Scheduled/Delayed notifications: Sent later, like reminders
• Transactional notifications: Based on user actions (signup, password reset)
Tools & Libraries:
• Django Channels (real-time in-app)
• Django-Q, Celery (task queues for sending async notifications)
• Twilio (SMS)
• Firebase Cloud Messaging (FCM) or OneSignal (push notifications)
• Toastr.js, Notyf, or custom toast alerts in frontend (React/Vue)
🧵 3. Asynchronous (Async)
Definition → Asynchronous operations allow tasks to run in the background so the
system doesn't wait (or block) the main thread.
Why It’s Needed:
• Avoids blocking user interaction while doing long tasks (e.g., sending emails, calling APIs)
• Helps with scalability and performance
Examples:
• Sending emails
• Processing uploaded files
• Making external API requests
• Notifying users in the background
In Python/Django:
• async def functions (Python 3.7+)
• Celery with a broker like Redis or RabbitMQ for background tasks
• Django Channels for WebSocket communication
• asyncio (Python’s async framework)
Frontend (e.g., React/JS):
• fetch() or axios with async/await to handle HTTP calls
🚦Summary Table
Concept Purpose Common Tools
Real-Time Live updates without refresh WebSockets, Django Channels
Notifications Alert users about events Celery, Twilio, FCM, Toastr
Asynchronous Non-blocking operations asyncio, Celery, Task Queues
so I don't need a real time functionality in this scenario
Correct — you don’t necessarily need real-time functionality (like WebSockets or Django
Channels) in this specific beacon scenario, as long as you're okay with the mobile app polling
the backend on demand.
✅ Why Real-Time Isn't Required Here
Your current flow works well with a request-response model:
1. Beacon broadcasts UUID over BLE.
2. Mobile app detects UUID, along with optional battery info or signal strength.
3. Mobile app sends a GET request to the backend with the UUID.
4. Backend returns relevant ads (based on current assignments and ad status).
5. App shows the user the ads.
No live streaming or push notification is involved — it's client-initiated communication.
🧠 When You Would Need Real-Time Functionality
You’d only need something like real-time updates (e.g., using WebSockets) if:
• Ads change frequently and must be pushed immediately to users.
• You want to track user proximity in real time and update the UI reactively.
• You want to push notifications to users (e.g., "You're near Beacon X! Tap for a deal!").
• You need to monitor and visualize beacons’ activity on a dashboard live.
✅ Conclusion
Your current approach using API calls is:
• Sufficient
• Scalable
• Easier to implement and maintain
Stick with it unless you have a strong reason to push updates live.
Let me know if you'd like to add:
• Beacon signal strength logging
• Battery monitoring
• Visit tracking or analytics
These can all be handled without real-time components too.