Skip to content

Connection Pooling Maybe?  #1

@rovirmani

Description

@rovirmani

Issue 1: Implement Connection Pooling and Batch Operations

Description:
The current approach to storing restaurants in RestaurantDB is inefficient, as each restaurant insertion makes an individual call to the database. We can improve performance by implementing batch operations.

Current Implementation:

# Current inefficient approach in RestaurantDB:
for restaurant in restaurants:
    self.supabase.store_restaurant(data)  # Makes individual calls

Proposed Change:

We should replace the individual calls with batch operations that reduce the number of database calls. The updated function could look like this:

Should be replaced with batch operations:

    data = [rest.model_dump() for rest in restaurants]
    await self.supabase.bulk_upsert_restaurants(data)  # Single database call

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions